From f935985d8391f7ce4ed2418dfa22f890ee6847bc Mon Sep 17 00:00:00 2001 From: Jon Janzen Date: Wed, 4 Dec 2024 16:04:41 -0800 Subject: [PATCH] Rewrite TARGETS files to BUCK files for facebookexperimental/rust-shed Summary: This diff migrates TARGETS file to BUCK files that are synced for an open source project. Differential Revision: D66729606 fbshipit-source-id: 03931c077a33ac2057bb18a6049ce9137b4e179f --- shed/abomonable_string/BUCK | 16 -- shed/ascii_ext/BUCK | 19 -- shed/async_once_cell/BUCK | 17 -- shed/borrowed/BUCK | 15 -- shed/buffered_weighted/BUCK | 41 ---- shed/cached_config/BUCK | 41 ---- shed/cachelib_stub/BUCK | 42 ---- shed/chrome_trace/BUCK | 28 --- shed/cloned/BUCK | 15 -- shed/codegen_includer_proc_macro/BUCK | 40 ---- shed/codegen_includer_proc_macro/example/BUCK | 8 - shed/detect_eden/BUCK | 26 --- shed/facet/BUCK | 146 ------------ shed/failure_ext/BUCK | 29 --- shed/fbinit/BUCK | 99 -------- shed/fbthrift_ext/BUCK | 135 ----------- shed/futures_01_ext/BUCK | 27 --- shed/futures_ext/BUCK | 29 --- shed/futures_lazy_shared/BUCK | 21 -- shed/futures_stats/BUCK | 33 --- shed/hash_memo/BUCK | 31 --- shed/hlist_to_tuple/BUCK | 18 -- shed/hostname/BUCK | 37 --- shed/justknobs_stub/BUCK | 55 ----- .../cached_config_thrift_struct/BUCK | 12 - shed/lock_ext/BUCK | 16 -- shed/memcache_stub/BUCK | 49 ---- shed/netstring/BUCK | 22 -- shed/ods/BUCK | 30 --- shed/panichandler/BUCK | 129 ----------- shed/perthread/BUCK | 21 -- shed/quickcheck_arbitrary_derive/BUCK | 30 --- shed/scuba_sample/BUCK | 103 --------- shed/scuba_stub/BUCK | 39 ---- shed/secure_utils/BUCK | 37 --- shed/services/BUCK | 74 ------ shed/shared_error/BUCK | 20 -- shed/slog_glog_fmt/BUCK | 88 ------- shed/slog_stats/BUCK | 19 -- shed/sorted_vector_map/BUCK | 50 ---- shed/sql/BUCK | 217 ------------------ shed/stats/BUCK | 58 ----- shed/thrift_compiler/BUCK | 35 --- shed/time_ext/BUCK | 20 -- shed/tokio-detectors/BUCK | 41 ---- shed/tokio-uds-compat/BUCK | 57 ----- 46 files changed, 2135 deletions(-) delete mode 100644 shed/abomonable_string/BUCK delete mode 100644 shed/ascii_ext/BUCK delete mode 100644 shed/async_once_cell/BUCK delete mode 100644 shed/borrowed/BUCK delete mode 100644 shed/buffered_weighted/BUCK delete mode 100644 shed/cached_config/BUCK delete mode 100644 shed/cachelib_stub/BUCK delete mode 100644 shed/chrome_trace/BUCK delete mode 100644 shed/cloned/BUCK delete mode 100644 shed/codegen_includer_proc_macro/BUCK delete mode 100644 shed/codegen_includer_proc_macro/example/BUCK delete mode 100644 shed/detect_eden/BUCK delete mode 100644 shed/facet/BUCK delete mode 100644 shed/failure_ext/BUCK delete mode 100644 shed/fbinit/BUCK delete mode 100644 shed/fbthrift_ext/BUCK delete mode 100644 shed/futures_01_ext/BUCK delete mode 100644 shed/futures_ext/BUCK delete mode 100644 shed/futures_lazy_shared/BUCK delete mode 100644 shed/futures_stats/BUCK delete mode 100644 shed/hash_memo/BUCK delete mode 100644 shed/hlist_to_tuple/BUCK delete mode 100644 shed/hostname/BUCK delete mode 100644 shed/justknobs_stub/BUCK delete mode 100644 shed/justknobs_stub/cached_config_thrift_struct/BUCK delete mode 100644 shed/lock_ext/BUCK delete mode 100644 shed/memcache_stub/BUCK delete mode 100644 shed/netstring/BUCK delete mode 100644 shed/ods/BUCK delete mode 100644 shed/panichandler/BUCK delete mode 100644 shed/perthread/BUCK delete mode 100644 shed/quickcheck_arbitrary_derive/BUCK delete mode 100644 shed/scuba_sample/BUCK delete mode 100644 shed/scuba_stub/BUCK delete mode 100644 shed/secure_utils/BUCK delete mode 100644 shed/services/BUCK delete mode 100644 shed/shared_error/BUCK delete mode 100644 shed/slog_glog_fmt/BUCK delete mode 100644 shed/slog_stats/BUCK delete mode 100644 shed/sorted_vector_map/BUCK delete mode 100644 shed/sql/BUCK delete mode 100644 shed/stats/BUCK delete mode 100644 shed/thrift_compiler/BUCK delete mode 100644 shed/time_ext/BUCK delete mode 100644 shed/tokio-detectors/BUCK delete mode 100644 shed/tokio-uds-compat/BUCK diff --git a/shed/abomonable_string/BUCK b/shed/abomonable_string/BUCK deleted file mode 100644 index 5091c8063..000000000 --- a/shed/abomonable_string/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "abomonable_string", - srcs = glob([ - "src/**/*.rs", - "README.*", - ]), - deps = [ - "fbsource//third-party/rust:abomonation", - "fbsource//third-party/rust:quickcheck", - "//common/rust/shed/quickcheck_arbitrary_derive:quickcheck_arbitrary_derive", - ], -) diff --git a/shed/ascii_ext/BUCK b/shed/ascii_ext/BUCK deleted file mode 100644 index 4288f04e2..000000000 --- a/shed/ascii_ext/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "ascii_ext", - srcs = ["src/lib.rs"], - autocargo = { - "cargo_toml_config": { - "package": { - "description": "ascii crate extensions", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:ascii", - "fbsource//third-party/rust:quickcheck", - ], -) diff --git a/shed/async_once_cell/BUCK b/shed/async_once_cell/BUCK deleted file mode 100644 index 3badb376f..000000000 --- a/shed/async_once_cell/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "async_once_cell", - srcs = glob([ - "src/**/*.rs", - ]), - named_deps = { - "tokio": "fbsource//third-party/rust:tokio", - }, - test_deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:rand", - ], -) diff --git a/shed/borrowed/BUCK b/shed/borrowed/BUCK deleted file mode 100644 index 94fb1e029..000000000 --- a/shed/borrowed/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "borrowed", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Borrow macro", - }, - }, - }, -) diff --git a/shed/buffered_weighted/BUCK b/shed/buffered_weighted/BUCK deleted file mode 100644 index feb5f3fc1..000000000 --- a/shed/buffered_weighted/BUCK +++ /dev/null @@ -1,41 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "buffered_weighted", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Ordered stream implementation that allows for concurrent polling constrained by the weight of the futures", - }, - }, - }, - compatible_with = [ - "ovr_config//os:linux", - ], - doc_deps = [ - "fbsource//third-party/rust:futures", - ], - os_deps = [ - ( - "linux", - [ - "fbsource//third-party/rust:procfs", - ], - ), - ], - test_deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:proptest", - "fbsource//third-party/rust:proptest-derive", - "fbsource//third-party/rust:tokio", - "fbsource//third-party/rust:tokio-stream", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:futures-util", - "fbsource//third-party/rust:pin-project", - ], -) diff --git a/shed/cached_config/BUCK b/shed/cached_config/BUCK deleted file mode 100644 index 4b60dfb53..000000000 --- a/shed/cached_config/BUCK +++ /dev/null @@ -1,41 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "cached_config", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Helpers to maintain cached set of configs", - }, - }, - }, - compatible_with = [ - "ovr_config//os:linux", - ], - test_deps = [ - "fbsource//third-party/rust:serde_derive", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - "fbsource//third-party/rust:chrono", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:serde_json", - "fbsource//third-party/rust:slog", - "fbsource//third-party/rust:tokio", - "//common/rust/configerator:configerator_client", - "//common/rust/shed/fbinit:fbinit", - "//thrift/lib/rust:fbthrift", - ], -) diff --git a/shed/cachelib_stub/BUCK b/shed/cachelib_stub/BUCK deleted file mode 100644 index d68d5954b..000000000 --- a/shed/cachelib_stub/BUCK +++ /dev/null @@ -1,42 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "cachelib", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - "fbsource//third-party/rust:abomonation", - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Cache library", - }, - }, - }, - compatible_with = [ - "ovr_config//os:linux", - ], - named_deps = { - "fb_cachelib": "//cachelib/rust:cachelib", - }, - deps = [] + ([ - "fbsource//third-party/rust:abomonation", - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - ] if rust_oss.is_oss_build() else []), -) diff --git a/shed/chrome_trace/BUCK b/shed/chrome_trace/BUCK deleted file mode 100644 index 815967498..000000000 --- a/shed/chrome_trace/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "chrome-trace", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Crate for writing Trace Event JSON files", - }, - }, - }, - test_deps = [ - "fbsource//third-party/rust:maplit", - "fbsource//third-party/rust:tempfile", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - "fbsource//third-party/rust:flate2", - "fbsource//third-party/rust:libc", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:serde_json", - "fbsource//third-party/rust:zstd", - ], -) diff --git a/shed/cloned/BUCK b/shed/cloned/BUCK deleted file mode 100644 index b87c3fbf8..000000000 --- a/shed/cloned/BUCK +++ /dev/null @@ -1,15 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "cloned", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Cloned macro", - }, - }, - }, -) diff --git a/shed/codegen_includer_proc_macro/BUCK b/shed/codegen_includer_proc_macro/BUCK deleted file mode 100644 index 89c54b0d5..000000000 --- a/shed/codegen_includer_proc_macro/BUCK +++ /dev/null @@ -1,40 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs:rust_unittest.bzl", "rust_unittest") - -oncall("autocargo") - -rust_library( - name = "codegen_includer_proc_macro", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "build": "build.rs", - "description": "Workaround for https://github.com/rust-lang/rfcs/issues/752", - }, - }, - }, - crate_root = "src/lib.rs", - doc_env = { - "OUT_DIR": "$(location //common/rust/shed/codegen_includer_proc_macro/example:doc_test_out_dir)", - }, - proc_macro = True, - tests = [ - ":tests", - ], - deps = [ - "fbsource//third-party/rust:quote", - ], -) - -rust_unittest( - name = "tests", - srcs = glob(["tests/**/*.rs"]), - crate_root = "tests/main.rs", - env = { - "OUT_DIR": "tests/fixtures/", - }, - deps = [ - ":codegen_includer_proc_macro", - ], -) diff --git a/shed/codegen_includer_proc_macro/example/BUCK b/shed/codegen_includer_proc_macro/example/BUCK deleted file mode 100644 index 244cebf6b..000000000 --- a/shed/codegen_includer_proc_macro/example/BUCK +++ /dev/null @@ -1,8 +0,0 @@ -load("@fbcode_macros//build_defs:native_rules.bzl", "buck_filegroup") - -oncall("autocargo") - -buck_filegroup( - name = "doc_test_out_dir", - srcs = ["lib.rs"], -) diff --git a/shed/detect_eden/BUCK b/shed/detect_eden/BUCK deleted file mode 100644 index 1db4ddf90..000000000 --- a/shed/detect_eden/BUCK +++ /dev/null @@ -1,26 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("build_infra") - -rust_library( - name = "detect_eden", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Detect if a directory is in an EdenFS", - }, - }, - }, - os_deps = [ - ( - "windows", - [ - "fbsource//third-party/rust:winapi", - ], - ), - ], - deps = [ - "fbsource//third-party/rust:dunce", - ], -) diff --git a/shed/facet/BUCK b/shed/facet/BUCK deleted file mode 100644 index 0f6fce7b0..000000000 --- a/shed/facet/BUCK +++ /dev/null @@ -1,146 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs:rust_unittest.bzl", "rust_unittest") - -oncall("autocargo") - -rust_library( - name = "facet", - srcs = glob(["src/**/*.rs"]), - doc_deps = [ - "fbsource//third-party/rust:tokio", - ], - features = ["impl_never_type"], - tests = [ - ":facet_async_test", - ":facet_basic_test", - ":facet_delegate_test", - ":facet_deps_test", - ":facet_fallible_test", - ":facet_params_test", - ":facet_static_test", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:async-trait", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:thiserror", - "fbsource//third-party/rust:trait-set", - ":facet_proc_macros", - ], -) - -rust_library( - name = "facet_proc_macros", - srcs = glob(["proc_macros/*.rs"]), - autocargo = { - "cargo_toml_config": { - "dependencies_override": { - "dependencies": { - "proc-macro-crate": { - "version": "1.1.0", - }, - }, - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fb_buck_build)"], - "level": "warn", - }, - }, - }, - }, - "cargo_toml_dir": "proc_macros", - }, - crate_root = "proc_macros/lib.rs", - proc_macro = True, - deps = [ - "fbsource//third-party/rust:proc-macro2", - "fbsource//third-party/rust:quote", - "fbsource//third-party/rust:syn", - ], -) - -rust_unittest( - name = "facet_basic_test", - srcs = ["test/basic_test.rs"], - crate_root = "test/basic_test.rs", - deps = [ - ":facet", - ], -) - -rust_unittest( - name = "facet_async_test", - srcs = ["test/async_test.rs"], - crate_root = "test/async_test.rs", - deps = [ - "fbsource//third-party/rust:async-trait", - "fbsource//third-party/rust:tokio", - ":facet", - ], -) - -rust_unittest( - name = "facet_params_test", - srcs = ["test/params_test.rs"], - crate_root = "test/params_test.rs", - deps = [ - ":facet", - ], -) - -rust_unittest( - name = "facet_deps_test", - srcs = ["test/deps_test.rs"], - crate_root = "test/deps_test.rs", - deps = [ - ":facet", - ], -) - -rust_unittest( - name = "facet_fallible_test", - srcs = ["test/fallible_test.rs"], - crate_root = "test/fallible_test.rs", - deps = [ - "fbsource//third-party/rust:thiserror", - ":facet", - ], -) - -rust_unittest( - name = "facet_static_test", - srcs = ["test/static_test.rs"], - crate_root = "test/static_test.rs", - deps = [ - ":facet", - ], -) - -rust_unittest( - name = "facet_delegate_test", - srcs = ["test/delegate_test.rs"], - crate_root = "test/delegate_test.rs", - deps = [ - ":facet", - ], -) - -rust_unittest( - name = "facet_from_container_test", - srcs = ["test/from_container_test.rs"], - crate_root = "test/from_container_test.rs", - deps = [ - ":facet", - ], -) - -rust_unittest( - name = "facet_tuple_struct_test", - srcs = ["test/tuple_struct_test.rs"], - crate_root = "test/tuple_struct_test.rs", - deps = [ - ":facet", - ], -) diff --git a/shed/failure_ext/BUCK b/shed/failure_ext/BUCK deleted file mode 100644 index 81ae603db..000000000 --- a/shed/failure_ext/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "failure_ext", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Extensions to the anyhow crate", - }, - }, - }, - test_deps = ["fbsource//third-party/rust:thiserror"], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:futures-old", - "fbsource//third-party/rust:slog", - ], -) diff --git a/shed/fbinit/BUCK b/shed/fbinit/BUCK deleted file mode 100644 index 527404584..000000000 --- a/shed/fbinit/BUCK +++ /dev/null @@ -1,99 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs:rust_unittest.bzl", "rust_unittest") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "fbinit", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - "fbsource//third-party/rust:quickcheck", - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Facebook init token", - "version": "0.2.0", - }, - }, - }, - doc_deps = [ - "//common/rust/shed/fbinit:fbinit-tokio", - ], - named_deps = { - "real_fbinit": "//common/rust/fbinit:fbinit", - }, - tests = [ - ":fbinit_test", - ], - unittests = False, - deps = [ - ":fbinit_macros", - ] + ([ - "fbsource//third-party/rust:quickcheck", - ] if rust_oss.is_oss_build() else []), -) - -rust_library( - name = "fbinit_macros", - srcs = glob(["fbinit_macros/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Facebook init token macros", - "readme": "../../../README.md", - "version": "0.2.0", - }, - }, - "cargo_toml_dir": "fbinit_macros", - }, - crate_root = "fbinit_macros/lib.rs", - doctests = False, - proc_macro = True, - unittests = False, - deps = [ - "fbsource//third-party/rust:proc-macro2", - "fbsource//third-party/rust:quote", - "fbsource//third-party/rust:syn", - ], -) - -rust_unittest( - name = "fbinit_test", - srcs = ["test/fbinit_test.rs"], - crate_root = "test/fbinit_test.rs", - deps = [ - ":fbinit", - "//common/rust/shed/fbinit:fbinit-tokio", - ], -) - -rust_library( - name = "fbinit-tokio", - srcs = glob(["fbinit-tokio/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "name": "fbinit-tokio", - "version": "0.1.2", - }, - }, - "cargo_toml_dir": "fbinit-tokio", - }, - crate = "fbinit_tokio", - deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:tokio", - ], -) diff --git a/shed/fbthrift_ext/BUCK b/shed/fbthrift_ext/BUCK deleted file mode 100644 index 51ca09ecf..000000000 --- a/shed/fbthrift_ext/BUCK +++ /dev/null @@ -1,135 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "framed", - srcs = glob(["framed/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "fbthrift extensions for framed transport", - "name": "fbthrift_framed", - "readme": "../../../../README.md", - }, - }, - "cargo_toml_dir": "framed", - }, - crate = "fbthrift_framed", - named_deps = { - "bytes": "fbsource//third-party/rust:bytes", - }, - test_deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:tokio", - ], - deps = [ - "fbsource//third-party/rust:byteorder", - "fbsource//third-party/rust:bytes", - "fbsource//third-party/rust:tokio-util", - ], -) - -rust_library( - name = "socket", - srcs = glob(["socket/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "fbthrift extensions for socket transport", - "name": "fbthrift_socket", - "readme": "../../../../README.md", - }, - }, - "cargo_toml_dir": "socket", - }, - crate = "fbthrift_socket", - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:tokio", - "fbsource//third-party/rust:tokio-tower", - "fbsource//third-party/rust:tokio-util", - "fbsource//third-party/rust:tower-service", - ":framed", - ":util", - "//thrift/lib/rust:fbthrift", - ], -) - -rust_library( - name = "tcp", - srcs = glob(["tcp/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "fbthrift extensions for tcp transport", - "name": "fbthrift_tcp", - "readme": "../../../../README.md", - }, - }, - "cargo_toml_dir": "tcp", - }, - crate = "fbthrift_tcp", - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:tokio", - "fbsource//third-party/rust:tokio-tower", - "fbsource//third-party/rust:tokio-util", - "fbsource//third-party/rust:tower-service", - ":framed", - ":util", - "//thrift/lib/rust:fbthrift", - ], -) - -rust_library( - name = "util", - srcs = glob(["util/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "fbthrift extensions utilities", - "name": "fbthrift_util", - "readme": "../../../../README.md", - }, - }, - "cargo_toml_dir": "util", - }, - crate = "fbthrift_util", - deps = [ - "fbsource//third-party/rust:tokio", - ], -) - -rust_library( - name = "adapters", - srcs = glob(["adapters/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "fbthrift extensions for thrift adapters", - "name": "fbthrift_adapters", - "readme": "../../../../README.md", - }, - }, - "cargo_toml_dir": "adapters", - }, - crate = "fbthrift_adapters", - deps = [ - "fbsource//third-party/rust:bstr", - "fbsource//third-party/rust:camino", - "fbsource//third-party/rust:chrono", - "fbsource//third-party/rust:ordered-float", - "fbsource//third-party/rust:paste", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:serde_derive", - "fbsource//third-party/rust:thiserror", - "fbsource//third-party/rust:uuid", - "fbsource//third-party/rust:valuable", - "//thrift/lib/rust:fbthrift", - ], -) diff --git a/shed/futures_01_ext/BUCK b/shed/futures_01_ext/BUCK deleted file mode 100644 index d598e5ded..000000000 --- a/shed/futures_01_ext/BUCK +++ /dev/null @@ -1,27 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "futures_01_ext", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Extensions for future 0.1 crate", - }, - }, - }, - test_deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:assert_matches", - "fbsource//third-party/rust:tokio", - "//common/rust/shed/cloned:cloned", - ], - test_named_deps = { - "futures03": "fbsource//third-party/rust:futures", - }, - deps = [ - "fbsource//third-party/rust:futures-old", - ], -) diff --git a/shed/futures_ext/BUCK b/shed/futures_ext/BUCK deleted file mode 100644 index 9011ae948..000000000 --- a/shed/futures_ext/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "futures_ext", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "future crate extensions", - }, - }, - }, - test_deps = [ - "fbsource//third-party/rust:assert_matches", - "fbsource//third-party/rust:async-stream", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:maybe-owned", - "fbsource//third-party/rust:pin-project", - "fbsource//third-party/rust:slog", - "fbsource//third-party/rust:thiserror", - "fbsource//third-party/rust:tokio", - "//common/rust/shed/shared_error:shared_error", - ], -) diff --git a/shed/futures_lazy_shared/BUCK b/shed/futures_lazy_shared/BUCK deleted file mode 100644 index 20c0f2f2f..000000000 --- a/shed/futures_lazy_shared/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "futures_lazy_shared", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "LazyShared extension to futures crate", - }, - }, - }, - test_deps = [ - "fbsource//third-party/rust:tokio", - ], - deps = [ - "fbsource//third-party/rust:futures", - ], -) diff --git a/shed/futures_stats/BUCK b/shed/futures_stats/BUCK deleted file mode 100644 index 131dc0ebd..000000000 --- a/shed/futures_stats/BUCK +++ /dev/null @@ -1,33 +0,0 @@ -load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "futures_stats", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Stats extension to futures crate", - }, - }, - }, - test_deps = [ - "fbsource//third-party/rust:tokio", - ], - deps = [ - "fbsource//third-party/rust:futures", - "//common/rust/shed/futures_ext:futures_ext", - ], -) - -rust_binary( - name = "futures_stats_test", - srcs = glob(["test/**/*.rs"]), - deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:tokio", - ":futures_stats", - ], -) diff --git a/shed/hash_memo/BUCK b/shed/hash_memo/BUCK deleted file mode 100644 index de8d4ba59..000000000 --- a/shed/hash_memo/BUCK +++ /dev/null @@ -1,31 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "hash_memo", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "authors": [ - "Facebook ", - ], - "categories": ["data-structures"], - "description": "memoization/caching of hash values by Hash and Hasher implementations", - "keywords": [ - "cache", - "hash", - "map", - "memo", - "memoize", - "set", - ], - "readme": "README.md", - "repository": "https://github.com/facebookexperimental/rust-shed", - }, - }, - }, - test_deps = ["fbsource//third-party/rust:ahash"], - deps = ["fbsource//third-party/rust:once_cell"], -) diff --git a/shed/hlist_to_tuple/BUCK b/shed/hlist_to_tuple/BUCK deleted file mode 100644 index 667006894..000000000 --- a/shed/hlist_to_tuple/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("source_control") - -rust_library( - name = "hlist_to_tuple", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Crate for converting HList to tuple", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:frunk", - ], -) diff --git a/shed/hostname/BUCK b/shed/hostname/BUCK deleted file mode 100644 index 9fa54a9fd..000000000 --- a/shed/hostname/BUCK +++ /dev/null @@ -1,37 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "hostname", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - ("real_hostname", "fbsource//third-party/rust:hostname"), - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Crate for getting hostname", - }, - }, - }, - named_deps = {} | ({ - "real_hostname": "fbsource//third-party/rust:hostname", - } if rust_oss.is_oss_build() else {}), - deps = [ - "fbsource//third-party/rust:anyhow", - ] + ([] if rust_oss.is_oss_build() else [ - "//common/rust/fbwhoami:fbwhoami", - ]), -) diff --git a/shed/justknobs_stub/BUCK b/shed/justknobs_stub/BUCK deleted file mode 100644 index f484a0e4a..000000000 --- a/shed/justknobs_stub/BUCK +++ /dev/null @@ -1,55 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs:rust_unittest.bzl", "rust_unittest") - -oncall("autocargo") - -rust_library( - name = "justknobs", - srcs = glob(["src/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Client for accessing JustKnobs. Noop crate for now", - }, - }, - }, - named_deps = { - "fb_justknobs": "//justknobs/rust:justknobs", - }, - test_deps = [ - "fbsource//third-party/rust:maplit", - "fbsource//third-party/rust:tokio", - "//common/rust/shed/fbinit:fbinit", - "//common/rust/shed/slog_glog_fmt:slog_glog_fmt", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:arc-swap", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:serde_json", - "fbsource//third-party/rust:slog", - "fbsource//third-party/rust:tokio", - "//common/rust/shed/cached_config:cached_config", - "//common/rust/shed/justknobs_stub/cached_config_thrift_struct:just_knobs_struct-rust", - ], -) - -rust_unittest( - name = "justknobs_in_unnitest", - srcs = ["tests/justknobs_in_unittest.rs"], - crate_root = "tests/justknobs_in_unittest.rs", - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:maplit", - ":justknobs", - ], -) diff --git a/shed/justknobs_stub/cached_config_thrift_struct/BUCK b/shed/justknobs_stub/cached_config_thrift_struct/BUCK deleted file mode 100644 index 3b2249ac5..000000000 --- a/shed/justknobs_stub/cached_config_thrift_struct/BUCK +++ /dev/null @@ -1,12 +0,0 @@ -load("@fbcode_macros//build_defs:thrift_library.bzl", "thrift_library") - -oncall("autocargo") - -thrift_library( - name = "just_knobs_struct", - languages = [ - "rust", - ], - thrift_rust_options = "serde", - thrift_srcs = {"just_knobs.thrift": None}, -) diff --git a/shed/lock_ext/BUCK b/shed/lock_ext/BUCK deleted file mode 100644 index d7a16096a..000000000 --- a/shed/lock_ext/BUCK +++ /dev/null @@ -1,16 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "lock_ext", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Extensions to std::sync::Mutex", - }, - }, - }, - deps = ["fbsource//third-party/rust:parking_lot"], -) diff --git a/shed/memcache_stub/BUCK b/shed/memcache_stub/BUCK deleted file mode 100644 index da994af3d..000000000 --- a/shed/memcache_stub/BUCK +++ /dev/null @@ -1,49 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "memcache", - srcs = glob(["src/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - ":memcache_common", - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Client for accessing Memcache. Noop crate for now", - }, - }, - }, - compatible_with = [ - "ovr_config//os:linux", - ], - named_deps = { - "fb_memcache": "//common/rust/memcache:memcache", - }, - deps = [] + ([ - ":memcache_common", - ] if rust_oss.is_oss_build() else []), -) - -rust_library( - name = "memcache_common", - srcs = glob(["common/*.rs"]), - autocargo = {"cargo_toml_dir": "common"}, - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - "//common/rust/shed/fbinit:fbinit", - ], -) diff --git a/shed/netstring/BUCK b/shed/netstring/BUCK deleted file mode 100644 index 6d22d3d8d..000000000 --- a/shed/netstring/BUCK +++ /dev/null @@ -1,22 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "netstring", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Tokio based implementation of netstrings", - }, - }, - }, - test_deps = ["fbsource//third-party/rust:quickcheck"], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:bytes", - "fbsource//third-party/rust:thiserror", - "fbsource//third-party/rust:tokio-util", - ], -) diff --git a/shed/ods/BUCK b/shed/ods/BUCK deleted file mode 100644 index 46ddc51a0..000000000 --- a/shed/ods/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "ods", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Library that points to meta specific ods for fbcode builds and to the stub for non-fbcode builds", - }, - }, - }, - named_deps = { - "fb_ods": "//common/rust/multiplatform/ods:ods", - }, - deps = [ - "fbsource//third-party/rust:anyhow", - "//common/rust/shed/fbinit:fbinit", - ], -) diff --git a/shed/panichandler/BUCK b/shed/panichandler/BUCK deleted file mode 100644 index 583f1f395..000000000 --- a/shed/panichandler/BUCK +++ /dev/null @@ -1,129 +0,0 @@ -load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs:rust_unittest.bzl", "rust_unittest") - -oncall("autocargo") - -rust_library( - name = "panichandler", - srcs = glob(["src/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Makes it easier to define a handler for panics", - }, - }, - }, - os_deps = [ - ( - "linux", - [ - "fbsource//third-party/rust:libc", - ], - ), - ( - "macos", - [ - "fbsource//third-party/rust:libc", - ], - ), - ], - tests = [ - ":panichandler_tests", - ], - unittests = False, - deps = [ - "fbsource//third-party/rust:backtrace", - ], -) - -rust_binary( - name = "shed_panic_simple", - srcs = [ - "test/shed_panic_simple.rs", - ], - unittests = False, - deps = [ - ":panichandler", - ], -) - -rust_binary( - name = "shed_panic_deep", - srcs = [ - "test/shed_panic_deep.rs", - ], - unittests = False, - deps = [ - ":panichandler", - ], -) - -rust_binary( - name = "shed_panic_multithread", - srcs = [ - "test/shed_panic_multithread.rs", - ], - unittests = False, - deps = [ - ":panichandler", - ], -) - -rust_binary( - name = "shed_panic_multithread_abort", - srcs = [ - "test/shed_panic_multithread_abort.rs", - ], - os_deps = [ - ( - "linux", - [ - "fbsource//third-party/rust:libc", - ], - ), - ( - "macos", - [ - "fbsource//third-party/rust:libc", - ], - ), - ], - unittests = False, - deps = [ - ":panichandler", - ], -) - -rust_unittest( - name = "panichandler_tests", - srcs = [ - "test/testrunner.rs", - ], - # * fbcode_build builds use buck resources to get the binary names. - # * Cargo builds use Cargo to get the binary names. - # * non-fbcode_build builds (aka //mode/dev-rust-oss) can't do either, - # so ignore it. - allow_oss_build = False, - crate_root = "test/testrunner.rs", - resources = { - "shed_panic_deep": "//common/rust/shed/panichandler:shed_panic_deep", - "shed_panic_multithread": "//common/rust/shed/panichandler:shed_panic_multithread", - "shed_panic_multithread_abort": "//common/rust/shed/panichandler:shed_panic_multithread_abort", - "shed_panic_simple": "//common/rust/shed/panichandler:shed_panic_simple", - }, - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:assert_cmd", - "fbsource//third-party/rust:buck-resources", - "fbsource//third-party/rust:predicates", - ], -) diff --git a/shed/perthread/BUCK b/shed/perthread/BUCK deleted file mode 100644 index 010228396..000000000 --- a/shed/perthread/BUCK +++ /dev/null @@ -1,21 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "perthread", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Provides ThreadMap structure for accessing PerThread thread local variables form a static context", - }, - }, - }, - doc_deps = [ - "fbsource//third-party/rust:once_cell", - ], - test_deps = [ - "fbsource//third-party/rust:once_cell", - ], -) diff --git a/shed/quickcheck_arbitrary_derive/BUCK b/shed/quickcheck_arbitrary_derive/BUCK deleted file mode 100644 index 78bf4cf43..000000000 --- a/shed/quickcheck_arbitrary_derive/BUCK +++ /dev/null @@ -1,30 +0,0 @@ -load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "quickcheck_arbitrary_derive", - srcs = glob([ - "src/**/*.rs", - ]), - doc_deps = [ - "fbsource//third-party/rust:quickcheck", - ], - proc_macro = True, - deps = [ - "fbsource//third-party/rust:proc-macro2", - "fbsource//third-party/rust:quote", - "fbsource//third-party/rust:syn", - ], -) - -rust_binary( - name = "quickcheck_arbitrary_example", - srcs = ["examples/example.rs"], - crate_root = "examples/example.rs", - deps = [ - "fbsource//third-party/rust:quickcheck", - ":quickcheck_arbitrary_derive", - ], -) diff --git a/shed/scuba_sample/BUCK b/shed/scuba_sample/BUCK deleted file mode 100644 index bf96181be..000000000 --- a/shed/scuba_sample/BUCK +++ /dev/null @@ -1,103 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs:rust_unittest.bzl", "rust_unittest") - -oncall("autocargo") - -rust_library( - name = "scuba_sample", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Provides Scuba sample type and sampling", - }, - }, - }, - test_deps = [ - "fbsource//third-party/rust:assert_matches", - "fbsource//third-party/rust:nonzero_ext", - "fbsource//third-party/rust:quickcheck", - "fbsource//third-party/rust:rand_chacha", - ], - deps = [ - "fbsource//third-party/rust:rand", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:serde_json", - "fbsource//third-party/rust:thiserror", - ":scuba_sample_derive", - ], -) - -rust_library( - name = "scuba_sample_derive", - srcs = glob(["derive/src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Provides derive(StructuredSample)", - }, - }, - "cargo_toml_dir": "derive/", - }, - proc_macro = True, - unittests = False, - deps = [ - "fbsource//third-party/rust:proc-macro2", - "fbsource//third-party/rust:quote", - "fbsource//third-party/rust:syn", - ], -) - -rust_library( - name = "scuba_sample_builder", - srcs = glob(["builder/src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Helps build scuba samples", - }, - }, - "cargo_toml_dir": "builder/", - }, - deps = [ - "fbsource//third-party/rust:rand", - "fbsource//third-party/rust:serde_json", - ":scuba_sample", - "//common/rust/shed/fbinit:fbinit", - ], -) - -rust_library( - name = "scuba_sample_client", - srcs = glob(["client/src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Provides scuba sample client stub", - }, - }, - "cargo_toml_dir": "client/", - }, - deps = [ - ":scuba_sample", - "//common/rust/shed/fbinit:fbinit", - ], -) - -rust_unittest( - name = "scuba_sample_derive_test", - srcs = glob(["derive_tests/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Tests derive(StructuredSample)", - }, - }, - "cargo_toml_dir": "derive_tests/", - }, - crate_root = "derive_tests/test.rs", - deps = [ - "fbsource//third-party/rust:serde_json", - ":scuba_sample", - ], -) diff --git a/shed/scuba_stub/BUCK b/shed/scuba_stub/BUCK deleted file mode 100644 index ebfc22a15..000000000 --- a/shed/scuba_stub/BUCK +++ /dev/null @@ -1,39 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "scuba", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - "//common/rust/shed/scuba_sample:scuba_sample", - "//common/rust/shed/scuba_sample:scuba_sample_builder", - "//common/rust/shed/scuba_sample:scuba_sample_client", - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Stub for scuba client", - }, - }, - }, - named_deps = { - "fb_scuba": "//common/rust/scuba:scuba", - }, - deps = [] + ([ - "//common/rust/shed/scuba_sample:scuba_sample", - "//common/rust/shed/scuba_sample:scuba_sample_builder", - "//common/rust/shed/scuba_sample:scuba_sample_client", - ] if rust_oss.is_oss_build() else []), -) diff --git a/shed/secure_utils/BUCK b/shed/secure_utils/BUCK deleted file mode 100644 index cd110941a..000000000 --- a/shed/secure_utils/BUCK +++ /dev/null @@ -1,37 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "secure_utils", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Crate with useful security utilities", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:openssl", - "fbsource//third-party/rust:slog", - ] + ([ - ] if rust_oss.is_oss_build() else [ - # buildifier: keep sorted - "fbsource//third-party/rust:hex", - "fbsource//third-party/rust:libc", - "fbsource//third-party/rust:openssl-sys", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:serde_json", - ]), -) diff --git a/shed/services/BUCK b/shed/services/BUCK deleted file mode 100644 index b9bc73452..000000000 --- a/shed/services/BUCK +++ /dev/null @@ -1,74 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "services", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - ":services_common", - "//common/rust/shed/fbinit:fbinit", - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Stubs for facebook services", - }, - }, - }, - compatible_with = [ - "ovr_config//os:linux", - ], - named_deps = { - "fb_services": "//common/rust/services:services", - }, - deps = [] + ([ - # buildifier: keep sorted - ":services_common", - "//common/rust/shed/fbinit:fbinit", - ] if rust_oss.is_oss_build() else []), -) - -rust_library( - name = "services_common", - srcs = glob(["common/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Common code for stubbed facebook services", - "homepage": "https://github.com/facebookexperimental/rust-shed/", - "readme": "../../README.md", - "repository": "https://github.com/facebookexperimental/rust-shed/", - }, - }, - "cargo_toml_dir": "common", - }, - compatible_with = [ - "ovr_config//os:linux", - ], - deps = [ - "fbsource//third-party/rust:cxx", - "fbsource//third-party/rust:thiserror", - ] + ([] if rust_oss.is_oss_build() else [ - "//common/fb303/if:fb303-rust", - ]), -) diff --git a/shed/shared_error/BUCK b/shed/shared_error/BUCK deleted file mode 100644 index 71fcf8688..000000000 --- a/shed/shared_error/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "shared_error", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Provides SharedError wrapper for cloneable Error", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:slog", - "fbsource//third-party/rust:thiserror", - ], -) diff --git a/shed/slog_glog_fmt/BUCK b/shed/slog_glog_fmt/BUCK deleted file mode 100644 index 13a460a04..000000000 --- a/shed/slog_glog_fmt/BUCK +++ /dev/null @@ -1,88 +0,0 @@ -load("@fbcode_macros//build_defs:cpp_binary.bzl", "cpp_binary") -load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbsource//tools/build_defs:cram_test.bzl", "cram_test") - -oncall("autocargo") - -rust_library( - name = "slog_glog_fmt", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "slog Drain for glog-formatted logs", - }, - }, - }, - os_deps = [ - ( - "linux", - [ - "fbsource//third-party/rust:nix", - ], - ), - ( - "macos", - [ - "fbsource//third-party/rust:nix", - ], - ), - ], - test_deps = [ - "fbsource//third-party/rust:once_cell", - "fbsource//third-party/rust:rand", - "fbsource//third-party/rust:regex", - "fbsource//third-party/rust:thiserror", - ], - tests = [ - ":rust-slog-glog-comparison", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:chrono", - "fbsource//third-party/rust:hostname", - "fbsource//third-party/rust:itertools", - "fbsource//third-party/rust:slog", - "fbsource//third-party/rust:slog-term", - "//common/rust/shed/failure_ext:failure_ext", - ], -) - -rust_binary( - name = "slog_glog_fmt_example", - srcs = glob(["example/**/*.rs"]), - crate = "slog_glog_fmt_example", - deps = [ - "fbsource//third-party/rust:slog", - ":slog_glog_fmt", - ], -) - -cpp_binary( - name = "rust_slog_glog_cmp_cpp", - srcs = ["facebook/RustSlogGlogCmp.cpp"], - deps = ["//common/init:light"], - external_deps = ["glog"], -) - -rust_binary( - name = "rust_slog_glog_cmp_rust", - srcs = ["facebook/rust_slog_glog_cmp.rs"], - autocargo = {"ignore_rule": True}, - crate_root = "facebook/rust_slog_glog_cmp.rs", - deps = [ - "fbsource//third-party/rust:slog", - "//common/rust/shed/slog_glog_fmt:slog_glog_fmt", - ], -) - -# buck run :rust-slog-glog-comparison-cram -- test-rust-slog-glog-comparison.t -iy -cram_test( - name = "rust-slog-glog-comparison", - srcs = ["facebook/test-rust-slog-glog-comparison.t"], - env = { - "RUST_SLOG_GLOG_CMP_CPP": "$(location :rust_slog_glog_cmp_cpp)", - "RUST_SLOG_GLOG_CMP_RUST": "$(location :rust_slog_glog_cmp_rust)", - }, -) diff --git a/shed/slog_stats/BUCK b/shed/slog_stats/BUCK deleted file mode 100644 index fa6fbe2a4..000000000 --- a/shed/slog_stats/BUCK +++ /dev/null @@ -1,19 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "slog_stats", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Enables exposing counters for number of slog records per level", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:slog", - "//common/rust/shed/stats:stats", - ], -) diff --git a/shed/sorted_vector_map/BUCK b/shed/sorted_vector_map/BUCK deleted file mode 100644 index cfb72eebc..000000000 --- a/shed/sorted_vector_map/BUCK +++ /dev/null @@ -1,50 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "sorted_vector_map", - srcs = glob([ - "src/**/*.rs", - "benches/**/*.rs", - "README.*", - ]), - autocargo = { - "cargo_toml_config": { - "bench": [ - { - "harness": False, - "name": "map", - }, - { - "harness": False, - "name": "set", - }, - ], - "dependencies_override": {"dev-dependencies": {"sapling-minibench": {"version": None}}}, - "extra_buck_dependencies": { - "dev-dependencies": [ - "//eden/scm/lib/minibench:minibench", - ], - }, - "package": { - "authors": [ - "Facebook ", - ], - "categories": ["data-structures"], - "description": "maps and sets backed by sorted vectors", - "keywords": [ - "map", - "set", - ], - "readme": "README.md", - "repository": "https://github.com/facebookexperimental/rust-shed", - "version": "0.2.0", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:itertools", - "fbsource//third-party/rust:quickcheck", - ], -) diff --git a/shed/sql/BUCK b/shed/sql/BUCK deleted file mode 100644 index 8a3307a3b..000000000 --- a/shed/sql/BUCK +++ /dev/null @@ -1,217 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") -load("@fbcode_macros//build_defs/lib:rust_oss.bzl", "rust_oss") - -oncall("autocargo") - -rust_library( - name = "sql", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - "fbsource//third-party/rust:mysql_common", - ], - }, - "features": { - "default": [ - "mysql_common/chrono", - "mysql_common/default", - ], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Crate for accessing sql databases", - }, - }, - }, - compatible_with = [ - "ovr_config//os:linux", - ], - doctests = False, # FIXME - test_deps = [ - "fbsource//third-party/rust:tokio", - ":sql_tests_lib", - "//common/rust/mysql:mysql_client", - ] + ([] if rust_oss.is_oss_build() else [ - # buildifier: keep sorted - "//common/rust/shed/fbinit:fbinit", - "//common/rust/shed/fbinit:fbinit-tokio", - ]), - test_labels = [ - "exclude_from_coverage", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:frunk", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:futures-util", - "fbsource//third-party/rust:mysql_async", - "fbsource//third-party/rust:rusqlite", - ":sql_common", - "//common/rust/shed/cloned:cloned", - "//common/rust/shed/futures_ext:futures_ext", - ], -) - -rust_library( - name = "sql_common", - srcs = glob(["common/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "extra_buck_dependencies": { - "dependencies": [ - "fbsource//third-party/rust:thiserror", - ], - "dev-dependencies": [ - ":sql", # Used in docs - ":sql_tests_lib", # Used in docs - ], - }, - "features": { - "default": ["rusqlite/bundled"], - }, - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Common definitions for sql crate", - "readme": "../../../README.md", - }, - }, - "cargo_toml_dir": "common", - }, - compatible_with = [ - "ovr_config//os:linux", - ], - doctests = False, # FIXME - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:async-trait", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:itertools", - "fbsource//third-party/rust:mysql_async", - "fbsource//third-party/rust:rusqlite", - "fbsource//third-party/rust:vec1", - ":mysql_client_traits", - ":mysql_derive", - "//common/rust/mysql:mysql_client", - "//common/rust/shed/futures_stats:futures_stats", - "//common/rust/shed/stats:stats", - "//common/rust/shed/time_ext:time_ext", - ] + ([ - "fbsource//third-party/rust:thiserror", - ] if rust_oss.is_oss_build() else [ - # buildifier: keep sorted - "fbsource//third-party/rust:tokio", - "//common/rust/shed/cloned:cloned", - ]), -) - -rust_library( - name = "mysql_derive", - srcs = glob(["derive/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "proc macro for sql_common::mysql", - "readme": "../../../README.md", - }, - }, - "cargo_toml_dir": "derive", - }, - crate_root = "derive/lib.rs", - proc_macro = True, - deps = [ - "fbsource//third-party/rust:quote", - "fbsource//third-party/rust:syn", - ], -) - -rust_library( - name = "mysql_client_traits", - srcs = glob(["mysql_client_traits/*.rs"]), - autocargo = {"cargo_toml_dir": "mysql_client_traits"}, - crate_root = "mysql_client_traits/lib.rs", - deps = [ - "fbsource//third-party/rust:chrono", - "fbsource//third-party/rust:mysql_common", - "fbsource//third-party/rust:seq-macro", - "fbsource//third-party/rust:thiserror", - ], -) - -rust_library( - name = "sql_facebook", - srcs = glob(["facebook/src/**/*.rs"]), - allow_oss_build = False, - autocargo = {"ignore_rule": True}, - compatible_with = [ - "ovr_config//os:linux", - ], - test_deps = [ - "fbsource//third-party/rust:rand", - ":sql_tests_lib", - "//common/rust/shed/fbinit:fbinit-tokio", - ], - deps = [ - "fbsource//third-party/rust:anyhow", - ":db-bridge", - ":sql_common", - "//common/rust/mysql:mysql_client", - "//common/rust/shed/fbinit:fbinit", - ], -) - -rust_library( - name = "sql_tests_lib", - srcs = glob(["tests_lib/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Test library for sql crate", - "readme": "../../../README.md", - }, - }, - "cargo_toml_dir": "tests_lib", - }, - compatible_with = [ - "ovr_config//os:linux", - ], - deps = [ - "fbsource//third-party/rust:chrono", - "fbsource//third-party/rust:rand", - ":sql", - ], -) - -rust_library( - name = "db-bridge", - srcs = ["facebook/sys/db.rs"], - allow_oss_build = False, - autocargo = {"ignore_rule": True}, - compatible_with = [ - "ovr_config//os:linux", - ], - crate_root = "facebook/sys/db.rs", - named_deps = { - "mysql_client": "//common/db/lang:client-rs_bindings", - "mysql_test_db": "//common/db/lang:test_db-rs_bindings", - "mysql_types": "//common/db/lang:db-rust", - }, - deps = [ - "fbsource//third-party/rust:anyhow", - ], -) diff --git a/shed/stats/BUCK b/shed/stats/BUCK deleted file mode 100644 index 964b6f197..000000000 --- a/shed/stats/BUCK +++ /dev/null @@ -1,58 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "stats", - srcs = glob([ - "src/**/*.rs", - ]), - autocargo = { - "cargo_toml_config": { - "lints": { - "rust": { - "unexpected_cfgs": { - "check-cfg": ["cfg(fbcode_build)"], - "level": "warn", - }, - }, - }, - "package": { - "description": "Stats library", - }, - }, - }, - deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:once_cell", - "fbsource//third-party/rust:tokio", - "fbsource//third-party/rust:tokio-stream", - ":stats_traits", - "//common/rust/shed/fbinit:fbinit", - "//common/rust/shed/perthread:perthread", - "//common/rust/shed/stats/facebook:stats_facebook", - ], -) - -rust_library( - name = "stats_traits", - srcs = glob([ - "traits/**/*.rs", - ]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Traits for stats crate", - "homepage": "https://github.com/facebookexperimental/rust-shed/", - "readme": "../../README.md", - "repository": "https://github.com/facebookexperimental/rust-shed/", - }, - }, - "cargo_toml_dir": "traits", - }, - deps = [ - "fbsource//third-party/rust:auto_impl", - "fbsource//third-party/rust:dashmap", - "//common/rust/shed/fbinit:fbinit", - ], -) diff --git a/shed/thrift_compiler/BUCK b/shed/thrift_compiler/BUCK deleted file mode 100644 index 2ca1164ef..000000000 --- a/shed/thrift_compiler/BUCK +++ /dev/null @@ -1,35 +0,0 @@ -load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_binary( - name = "compiler", - srcs = ["src/main.rs"], - crate_root = "src/main.rs", - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:clap", - ":lib", - ], -) - -rust_library( - name = "lib", - srcs = ["src/lib.rs"], - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Calls fbthrift compiler to produce unified lib.rs from thrift files", - }, - }, - }, - crate = "thrift_compiler", - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:clap", - "fbsource//third-party/rust:dunce", - "fbsource//third-party/rust:serde", - "fbsource//third-party/rust:which", - ], -) diff --git a/shed/time_ext/BUCK b/shed/time_ext/BUCK deleted file mode 100644 index 7f1ae6c2a..000000000 --- a/shed/time_ext/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "time_ext", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "package": { - "description": "Crate exxtending functionality of std::time", - }, - }, - }, - test_deps = ["fbsource//third-party/rust:quickcheck"], - deps = [ - "fbsource//third-party/rust:anyhow", - "fbsource//third-party/rust:thiserror", - ], -) diff --git a/shed/tokio-detectors/BUCK b/shed/tokio-detectors/BUCK deleted file mode 100644 index 47bd60f5b..000000000 --- a/shed/tokio-detectors/BUCK +++ /dev/null @@ -1,41 +0,0 @@ -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "tokio-detectors", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "example": [ - { - "name": "server", - "path": "examples/server.rs", - }, - ], - "package": { - "description": "Provides utility for detection of blocked tokio runtimes.", - "name": "tokio-detectors", - }, - }, - }, - crate = "tokio-detectors", - os_deps = [ - ( - "linux", - [ - "fbsource//third-party/rust:libc", - ], - ), - ( - "macos", - [ - "fbsource//third-party/rust:libc", - ], - ), - ], - deps = [ - "fbsource//third-party/rust:rand", - "fbsource//third-party/rust:tokio", - ], -) diff --git a/shed/tokio-uds-compat/BUCK b/shed/tokio-uds-compat/BUCK deleted file mode 100644 index 2bec8ff26..000000000 --- a/shed/tokio-uds-compat/BUCK +++ /dev/null @@ -1,57 +0,0 @@ -load("@fbcode_macros//build_defs:rust_binary.bzl", "rust_binary") -load("@fbcode_macros//build_defs:rust_library.bzl", "rust_library") - -oncall("autocargo") - -rust_library( - name = "tokio-uds-compat", - srcs = glob(["src/**/*.rs"]), - autocargo = { - "cargo_toml_config": { - "example": [ - { - "name": "server", - "path": "examples/server.rs", - }, - ], - "extra_buck_dependencies": { - "dev-dependencies": [ - "fbsource//third-party/rust:futures", - ], - }, - "package": { - "description": "Provides a compatibile layer for using UNIX domain socket on UNIX-like systems and Windows with tokio", - "name": "tokio-uds-compat", - }, - }, - }, - crate = "tokio-uds-compat", - os_deps = [ - ( - "windows", - [ - "fbsource//third-party/rust:async-io", - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:uds_windows", - "fbsource//third-party/rust:tracing", - ], - ), - ], - deps = [ - "fbsource//third-party/rust:tokio", - ], -) - -rust_binary( - name = "example_server", - srcs = ["examples/server.rs"], - autocargo = { - "ignore_rule": True, - }, - crate_root = "examples/server.rs", - deps = [ - "fbsource//third-party/rust:futures", - "fbsource//third-party/rust:tokio", - ":tokio-uds-compat", - ], -)