Skip to content

Commit

Permalink
Revert D66561338: Rewrite TARGETS files to BUCK files for facebookexp…
Browse files Browse the repository at this point in the history
…erimental/rust-shed

Differential Revision:
D66561338

Original commit changeset: dba51b9be776

Original Phabricator Diff: D66561338

fbshipit-source-id: b64eb543fa4826884ac17a004894b6832e48a6b2
  • Loading branch information
Alex Jackson Lambert authored and facebook-github-bot committed Dec 3, 2024
1 parent 53f34dc commit 9ae37ca
Show file tree
Hide file tree
Showing 46 changed files with 2,135 additions and 0 deletions.
16 changes: 16 additions & 0 deletions shed/abomonable_string/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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",
],
)
19 changes: 19 additions & 0 deletions shed/ascii_ext/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
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",
],
)
17 changes: 17 additions & 0 deletions shed/async_once_cell/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
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",
],
)
15 changes: 15 additions & 0 deletions shed/borrowed/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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",
},
},
},
)
41 changes: 41 additions & 0 deletions shed/buffered_weighted/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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",
],
)
41 changes: 41 additions & 0 deletions shed/cached_config/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
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",
],
)
42 changes: 42 additions & 0 deletions shed/cachelib_stub/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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 []),
)
28 changes: 28 additions & 0 deletions shed/chrome_trace/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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",
],
)
15 changes: 15 additions & 0 deletions shed/cloned/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
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",
},
},
},
)
40 changes: 40 additions & 0 deletions shed/codegen_includer_proc_macro/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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",
],
)
8 changes: 8 additions & 0 deletions shed/codegen_includer_proc_macro/example/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
load("@fbcode_macros//build_defs:native_rules.bzl", "buck_filegroup")

oncall("autocargo")

buck_filegroup(
name = "doc_test_out_dir",
srcs = ["lib.rs"],
)
26 changes: 26 additions & 0 deletions shed/detect_eden/BUCK
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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",
],
)
Loading

0 comments on commit 9ae37ca

Please sign in to comment.