sapling/eden/fs/service/TARGETS
Philip Jameson 8604b8f5b0 Migrate TARGETS files from @/ to //
Summary:
This is a codemod to change from using @/ to // in basic cases.
- TARGETS files with lines starting with @/ (but excluding @/third-party:
- autodeps lines in source and TARGETS files ( (dep|manual)=@/ ), excluding @/third-party
- Targets in string macros

The only thing left of the old format should be @/third-party:foo:bar

drop-conflicts

Reviewed By: ttsugriy

Differential Revision: D6605465

fbshipit-source-id: ae50de2e1edb3f97c0b839d4021f38d77b7ab64c
2017-12-20 16:57:41 -08:00

224 lines
6.6 KiB
Plaintext

# @noautodeps
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 = [
"EdenCPUThreadPool.cpp",
"EdenError.cpp",
"EdenServer.cpp",
"EdenServiceHandler.cpp",
"GlobNode.cpp",
"StreamingSubscriber.cpp",
],
headers = [
"EdenCPUThreadPool.h",
"EdenError.h",
"EdenServer.h",
"EdenServiceHandler.h",
"GlobNode.h",
"StreamingSubscriber.h",
],
undefined_symbols = True, # TODO(T23121628): fix deps and remove
deps = [
":thrift_cpp",
"//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",
],
)
# 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 = [
"javadeprecated",
"py",
"rust",
],
py_base_module = "facebook",
thrift_args = ["--strict"],
thrift_srcs = {
"eden.thrift": ["EdenService"],
},
deps = [
"//common/fb303/if:fb303",
],
)
# 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",
],
)
# 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",
"//folly:optional",
"//folly:range",
],
)
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-javadeprecated',
'//third-party-java/org.slf4j:slf4j-api',
'//thrift/lib/java:thrift',
],
)