2017-11-22 05:17:47 +03:00
|
|
|
# @noautodeps
|
|
|
|
|
2017-06-02 03:41:11 +03:00
|
|
|
include_defs("//eden/DEFS")
|
|
|
|
|
|
|
|
include_defs("//eden/fs/service/DEFS")
|
2016-05-13 02:07:33 +03:00
|
|
|
|
|
|
|
create_eden_fs_rules(
|
2017-06-02 03:41:11 +03:00
|
|
|
server_deps = [],
|
|
|
|
server_srcs = ["oss/RunServer.cpp"],
|
|
|
|
subdir = "out.oss",
|
|
|
|
suffix = get_oss_suffix(),
|
2016-05-13 02:07:33 +03:00
|
|
|
)
|
|
|
|
|
2017-04-14 21:31:49 +03:00
|
|
|
if is_facebook_internal():
|
|
|
|
include_defs('//eden/fs/service/facebook/DEFS')
|
|
|
|
create_eden_fs_rules(
|
|
|
|
suffix = get_fb_suffix(),
|
|
|
|
subdir = 'out.fb',
|
|
|
|
server_srcs = [
|
|
|
|
'facebook/RunServer.cpp',
|
|
|
|
],
|
|
|
|
server_deps = [
|
2017-12-21 03:50:21 +03:00
|
|
|
'//common/services/cpp:cpp',
|
2017-04-14 21:31:49 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
cpp_library(
|
|
|
|
name = "server",
|
|
|
|
srcs = [
|
2017-12-12 23:23:57 +03:00
|
|
|
"EdenCPUThreadPool.cpp",
|
2017-04-14 21:31:49 +03:00
|
|
|
"EdenError.cpp",
|
|
|
|
"EdenServer.cpp",
|
|
|
|
"EdenServiceHandler.cpp",
|
|
|
|
"GlobNode.cpp",
|
|
|
|
"StreamingSubscriber.cpp",
|
|
|
|
],
|
2017-06-02 03:41:11 +03:00
|
|
|
headers = [
|
2017-12-12 23:23:57 +03:00
|
|
|
"EdenCPUThreadPool.h",
|
2017-06-02 03:41:11 +03:00
|
|
|
"EdenError.h",
|
|
|
|
"EdenServer.h",
|
|
|
|
"EdenServiceHandler.h",
|
|
|
|
"GlobNode.h",
|
|
|
|
"StreamingSubscriber.h",
|
|
|
|
],
|
2017-11-30 04:30:43 +03:00
|
|
|
undefined_symbols = True, # TODO(T23121628): fix deps and remove
|
2017-04-14 21:31:49 +03:00
|
|
|
deps = [
|
|
|
|
":thrift_cpp",
|
2017-12-21 03:50:21 +03:00
|
|
|
"//common/fb303/cpp:fb303",
|
|
|
|
"//eden/fs/config:config",
|
|
|
|
"//eden/fs/fuse:fusell",
|
|
|
|
"//eden/fs/fuse/privhelper:privhelper",
|
|
|
|
"//eden/fs/inodes:inodes",
|
|
|
|
"//eden/fs/store/git:git",
|
|
|
|
"//eden/fs/store/hg:hg",
|
|
|
|
"//eden/fs/takeover:takeover",
|
|
|
|
"//folly:conv",
|
|
|
|
"//folly:exception",
|
|
|
|
"//folly:exception_wrapper",
|
|
|
|
"//folly:executor",
|
|
|
|
"//folly:file",
|
|
|
|
"//folly:file_util",
|
|
|
|
"//folly:format",
|
|
|
|
"//folly:network_address",
|
|
|
|
"//folly:portability",
|
|
|
|
"//folly:range",
|
|
|
|
"//folly:stop_watch",
|
|
|
|
"//folly:string",
|
|
|
|
"//folly:synchronized",
|
|
|
|
"//folly:thread_local",
|
|
|
|
"//folly/container:access",
|
|
|
|
"//folly/experimental:string_keyed_map",
|
|
|
|
"//folly/experimental/logging:init",
|
|
|
|
"//folly/experimental/logging:logging",
|
|
|
|
"//folly/init:init",
|
|
|
|
"//thrift/lib/cpp/concurrency:thread_manager",
|
|
|
|
"//thrift/lib/cpp2:server",
|
2017-04-14 21:31:49 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2017-03-21 22:44:21 +03:00
|
|
|
# The eden.thrift interface.
|
|
|
|
#
|
|
|
|
# Note: C++ users should probably depend on the thrift_cpp rule below,
|
|
|
|
# rather than directly depending on this thrift_library(). The thrift_cpp rule
|
|
|
|
# includes this thrift_library() plus some extra utility code for working with
|
|
|
|
# the thrift C++ data structures.
|
2016-05-13 02:07:33 +03:00
|
|
|
thrift_library(
|
2017-06-02 03:41:11 +03:00
|
|
|
name = "thrift",
|
|
|
|
languages = [
|
2017-11-02 00:11:49 +03:00
|
|
|
"javadeprecated",
|
2017-06-02 03:41:11 +03:00
|
|
|
"py",
|
2017-10-03 10:38:10 +03:00
|
|
|
"rust",
|
2017-06-02 03:41:11 +03:00
|
|
|
],
|
|
|
|
py_base_module = "facebook",
|
|
|
|
thrift_args = ["--strict"],
|
|
|
|
thrift_srcs = {
|
|
|
|
"eden.thrift": ["EdenService"],
|
|
|
|
},
|
|
|
|
deps = [
|
2017-12-21 03:50:21 +03:00
|
|
|
"//common/fb303/if:fb303",
|
2017-06-02 03:41:11 +03:00
|
|
|
],
|
2016-05-13 02:07:33 +03:00
|
|
|
)
|
|
|
|
|
2017-03-02 10:02:33 +03:00
|
|
|
# This includes EdenService that is also present in the :thrift
|
|
|
|
# target defined in this file. Ideally we'd simply depend upon
|
|
|
|
# :thrift and just define StreamingEdenService here as a separate
|
|
|
|
# target, but Buck has problems locating the eden_types.h header
|
|
|
|
# during compilation. Instead we need to duplicate EdenService
|
|
|
|
# here and add StreamingEdenService alongside it. The result
|
|
|
|
# of this is that we cannot then include cpp2 in the languages
|
|
|
|
# selection for :thrift because Buck complains about the header
|
|
|
|
# mapping being ambiguous (the headers are present in both of
|
|
|
|
# these thrift_library targets).
|
2016-09-19 22:48:12 +03:00
|
|
|
thrift_library(
|
2017-06-02 03:41:11 +03:00
|
|
|
name = "thrift-streaming",
|
|
|
|
languages = ["cpp2"],
|
|
|
|
thrift_args = ["--strict"],
|
2017-08-01 19:11:42 +03:00
|
|
|
thrift_cpp2_options = "py_generator",
|
2017-06-02 03:41:11 +03:00
|
|
|
thrift_srcs = {
|
|
|
|
"streamingeden.thrift": [
|
|
|
|
"StreamingEdenService",
|
|
|
|
],
|
|
|
|
"eden.thrift": [
|
|
|
|
"EdenService",
|
|
|
|
],
|
|
|
|
},
|
|
|
|
deps = [
|
2017-12-21 03:50:21 +03:00
|
|
|
"//common/fb303/if:fb303",
|
2017-03-02 10:02:33 +03:00
|
|
|
],
|
2016-09-19 22:48:12 +03:00
|
|
|
)
|
|
|
|
|
2017-03-21 22:44:21 +03:00
|
|
|
# A helper library for C++ that depends on the generated thrift stubs,
|
|
|
|
# and includes a few other utilities for working with the thrift types.
|
|
|
|
#
|
|
|
|
# Most C++ users should depend on this rule rather than directly using the
|
|
|
|
# thrift or thrift-streaming rules above.
|
|
|
|
cpp_library(
|
2017-06-02 03:41:11 +03:00
|
|
|
name = "thrift_cpp",
|
|
|
|
srcs = [
|
|
|
|
"PrettyPrinters.cpp",
|
|
|
|
],
|
|
|
|
headers = [
|
|
|
|
"PrettyPrinters.h",
|
|
|
|
"ThriftUtil.h",
|
|
|
|
],
|
|
|
|
deps = [
|
|
|
|
":thrift-streaming-cpp2",
|
2017-12-21 03:50:21 +03:00
|
|
|
"//folly:optional",
|
|
|
|
"//folly:range",
|
2017-06-02 03:41:11 +03:00
|
|
|
],
|
2017-03-21 22:44:21 +03:00
|
|
|
)
|
|
|
|
|
2016-05-26 07:43:44 +03:00
|
|
|
python_library(
|
2017-06-02 03:41:11 +03:00
|
|
|
name = "py-client",
|
|
|
|
srcs = [
|
|
|
|
"__init__.py",
|
|
|
|
"client.py",
|
|
|
|
],
|
|
|
|
base_module = "eden.thrift",
|
|
|
|
deps = [
|
|
|
|
":thrift-py",
|
|
|
|
],
|
2016-05-26 07:43:44 +03:00
|
|
|
)
|
|
|
|
|
2016-05-13 02:07:33 +03:00
|
|
|
# JAVA BINDINGS FOR THRIFT ENDPOINT
|
|
|
|
#
|
|
|
|
# There are two JAR files that we expect Java clients to use:
|
|
|
|
# 1. A JAR that defines Eden's Thrift API.
|
|
|
|
# 2. A JAR that contains the general Java library for Thrift.
|
|
|
|
#
|
2016-05-25 07:52:07 +03:00
|
|
|
# For 1, when eden.thrift changes:
|
2016-05-13 02:07:33 +03:00
|
|
|
#
|
2016-05-25 07:52:07 +03:00
|
|
|
# buck build \
|
|
|
|
# --config java.target_level=7 \
|
|
|
|
# --config java.source_level=7 \
|
2016-07-02 21:30:29 +03:00
|
|
|
# //eden/fs/service:thrift-java
|
2016-05-13 02:07:33 +03:00
|
|
|
#
|
2016-05-25 07:52:07 +03:00
|
|
|
# Copy the resulting JAR
|
2016-07-02 21:30:29 +03:00
|
|
|
# (`buck targets --show-output //eden/fs/service:thrift-java`) to the project
|
2016-05-25 07:52:07 +03:00
|
|
|
# where you are using Eden in Java. (Note that the Java 7 config options are
|
|
|
|
# specified because Buck itself is currently limited to Java 7.)
|
2016-05-13 02:07:33 +03:00
|
|
|
#
|
|
|
|
# For 2, you should only have to build this once:
|
|
|
|
#
|
2016-05-25 07:52:07 +03:00
|
|
|
# buck build \
|
|
|
|
# --config java.target_level=7 \
|
|
|
|
# --config java.source_level=7 \
|
|
|
|
# //eden/fs/service:java-thrift-dependencies
|
2016-05-13 02:07:33 +03:00
|
|
|
#
|
|
|
|
# Copy the resulting JAR
|
2016-05-25 07:52:07 +03:00
|
|
|
# (`buck targets --show-output //eden/fs/service:java-thrift-dependencies`) to
|
|
|
|
# any project where you are using Thrift in Java. In theory, if the Java
|
|
|
|
# bindings for Thrift change, you will have to rebuild this, but it's unclear
|
|
|
|
# whether that code sees much activity these days. To be safe, you could always
|
|
|
|
# update this JAR when you update the Eden JAR.
|
2016-05-13 02:07:33 +03:00
|
|
|
|
|
|
|
# This java_binary() exists as a simple way to get //thrift/lib/java/src:thrift
|
|
|
|
# and all of its transitive dependencies into one JAR file.
|
2017-03-07 07:24:44 +03:00
|
|
|
#
|
|
|
|
# TODO: This is disabled in the open source build for now just because we
|
|
|
|
# don't have java build rules working yet. We should re-enable it once
|
|
|
|
# we get java+thrift working in the open source build.
|
|
|
|
if is_facebook_internal():
|
|
|
|
java_binary(
|
|
|
|
name = 'java-thrift-dependencies',
|
|
|
|
# Currently, //thrift/lib/java/src:thrift pulls in org.slf4j,
|
|
|
|
# org.iq80.snappy, and org.apache.commons.lang. org.iq80.snappy is the only
|
|
|
|
# one we keep.
|
|
|
|
blacklist = [
|
|
|
|
# Thrift only needs this dependency if the generated Java code uses
|
|
|
|
# `HashCodeBuilder`, which we do not.
|
|
|
|
'org.apache.commons.lang',
|
2016-09-02 00:19:30 +03:00
|
|
|
|
2017-03-07 07:24:44 +03:00
|
|
|
# The primary consumer of this JAR is Buck. Buck already has its own copy
|
|
|
|
# of slf4j that should be compatible with the one we are pulling in as
|
|
|
|
# part of this build. We decide to strip it rather than jarjar it.
|
|
|
|
'org.slf4j',
|
|
|
|
],
|
|
|
|
deps = [
|
2017-11-02 00:11:47 +03:00
|
|
|
'//common/fb303/if:fb303-javadeprecated',
|
2017-11-17 08:49:09 +03:00
|
|
|
'//third-party-java/org.slf4j:slf4j-api',
|
2017-03-07 07:24:44 +03:00
|
|
|
'//thrift/lib/java:thrift',
|
|
|
|
],
|
|
|
|
)
|