sapling/eden/fs/service/TARGETS
Christopher Dykes 4d602516ca Shift folly:synchronized out of folly:folly
Summary:
```
foundation/dependency_management/ensure-explicit-dependencies.sh folly:synchronized
```

Reviewed By: yfeldblum

Differential Revision: D5802850

fbshipit-source-id: 7587e6352953879ed193b4931617db7028f730b1
2017-09-13 16:53:47 -07:00

207 lines
6.1 KiB
Plaintext

include_defs("//eden/DEFS")
include_defs("//eden/fs/service/DEFS")
create_eden_fs_rules(
server_deps = [],
server_srcs = ["oss/RunServer.cpp"],
subdir = "out.oss",
suffix = get_oss_suffix(),
)
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 = [
'@/common/services/cpp:cpp',
],
)
cpp_library(
name = "server",
srcs = [
"EdenError.cpp",
"EdenServer.cpp",
"EdenServiceHandler.cpp",
"GlobNode.cpp",
"StreamingSubscriber.cpp",
],
headers = [
"EdenError.h",
"EdenServer.h",
"EdenServiceHandler.h",
"GlobNode.h",
"StreamingSubscriber.h",
],
deps = [
":thrift_cpp",
"@/common/fb303/cpp:fb303",
"@/eden/fs/config:config",
"@/eden/fs/fuse:fusell",
"@/eden/fs/fuse/privhelper:privhelper",
"@/eden/fs/inodes:hgdirstate-cpp2",
"@/eden/fs/inodes:inodes",
"@/eden/fs/store/git:git",
"@/eden/fs/store/hg:hg",
"@/folly:network_address",
"@/folly:synchronized",
"@/folly:thread_local",
"@/folly/experimental:string_keyed_map",
"@/folly/experimental/logging:init",
"@/folly/experimental/logging:logging",
"@/folly/init:init",
"@/thrift/lib/cpp2:server",
],
external_deps = [
("boost", None, "boost_filesystem"),
],
)
# 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.
thrift_library(
name = "thrift",
languages = [
"java",
"py",
],
py_base_module = "facebook",
thrift_args = ["--strict"],
thrift_srcs = {
"eden.thrift": ["EdenService"],
},
deps = [
"@/common/fb303/if:fb303",
"@/eden/fs/inodes:hgdirstate",
],
)
# 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).
thrift_library(
name = "thrift-streaming",
languages = ["cpp2"],
thrift_args = ["--strict"],
thrift_cpp2_options = "py_generator",
thrift_srcs = {
"streamingeden.thrift": [
"StreamingEdenService",
],
"eden.thrift": [
"EdenService",
],
},
deps = [
"@/common/fb303/if:fb303",
"@/eden/fs/inodes:hgdirstate",
],
)
# 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(
name = "thrift_cpp",
srcs = [
"PrettyPrinters.cpp",
],
headers = [
"PrettyPrinters.h",
"ThriftUtil.h",
],
deps = [
":thrift-streaming-cpp2",
],
)
python_library(
name = "py-client",
srcs = [
"__init__.py",
"client.py",
],
base_module = "eden.thrift",
deps = [
":thrift-py",
],
)
# 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.
#
# For 1, when eden.thrift changes:
#
# buck build \
# --config java.target_level=7 \
# --config java.source_level=7 \
# //eden/fs/service:thrift-java
#
# Copy the resulting JAR
# (`buck targets --show-output //eden/fs/service:thrift-java`) to the project
# 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.)
#
# For 2, you should only have to build this once:
#
# buck build \
# --config java.target_level=7 \
# --config java.source_level=7 \
# //eden/fs/service:java-thrift-dependencies
#
# Copy the resulting JAR
# (`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.
# 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.
#
# 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',
# 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 = [
'//common/fb303/if:fb303-java',
'//thrift/lib/java:thrift',
],
)