Skip to content

Commit bc161c1

Browse files
committed
Upgrade the buck2 support with newest buckal
Signed-off-by: Eli Ma <[email protected]>
1 parent 581feb3 commit bc161c1

File tree

57 files changed

+508
-1043
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+508
-1043
lines changed

.buckconfig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
[cells]
2-
root = .
2+
buckal = buckal
3+
none = none
34
prelude = prelude
5+
root = .
46
toolchains = toolchains
5-
none = none
6-
buckal = buckal
77

88
[cell_aliases]
99
config = prelude
@@ -13,13 +13,17 @@
1313
fbcode_macros = none
1414
buck = none
1515

16+
# Uses a copy of the prelude bundled with the buck2 binary. You can alternatively delete this
17+
# section and vendor a copy of the prelude to the `prelude` directory of your project.
1618
[external_cells]
1719
prelude = bundled
20+
21+
# Added by cargo-buckal. See [external_cell_buckal] for git configuration.
1822
buckal = git
1923

2024
[external_cell_buckal]
25+
commit_hash = 22bd38c79d2348d9a6591b7156c42d615377eaad
2126
git_origin = https://github.com/buck2hub/buckal-bundles
22-
commit_hash = f9c4f306b1aad816fa520fe361f4f03d28cd5b7b
2327

2428
[parser]
2529
target_platform_detector_spec = target:root//...->prelude//platforms:default \

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ buck-out/
99

1010
src/.DS_Store
1111
.DS_Store
12-
examples/output_packs
12+
examples/output_packs/buck-out

BUCK

Lines changed: 0 additions & 141 deletions
Original file line numberDiff line numberDiff line change
@@ -67,144 +67,3 @@ rust_library(
6767
"//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys",
6868
],
6969
)
70-
71-
rust_test(
72-
name = "git_internal-unittest",
73-
srcs = [":git-internal-vendor"],
74-
crate = "git_internal",
75-
crate_root = "vendor/src/lib.rs",
76-
edition = "2024",
77-
features = [
78-
"default",
79-
"diff_mydrs",
80-
],
81-
rustc_flags = ["@$(location :git-internal-manifest[env_flags])"] + select({
82-
"prelude//os/constraints:windows": select({
83-
"prelude//abi/constraints:gnu": [
84-
"@$(location //third-party/rust/crates/windows_x86_64_gnu/0.48.5:windows_x86_64_gnu-build-script-run[rustc_flags])",
85-
"@$(location //third-party/rust/crates/windows_x86_64_gnu/0.53.1:windows_x86_64_gnu-build-script-run[rustc_flags])",
86-
],
87-
"DEFAULT": [
88-
"@$(location //third-party/rust/crates/windows_x86_64_msvc/0.48.5:windows_x86_64_msvc-build-script-run[rustc_flags])",
89-
"@$(location //third-party/rust/crates/windows_x86_64_msvc/0.53.1:windows_x86_64_msvc-build-script-run[rustc_flags])",
90-
],
91-
}),
92-
"DEFAULT": [],
93-
}),
94-
visibility = ["PUBLIC"],
95-
deps = [
96-
"//third-party/rust/crates/ahash/0.8.12:ahash",
97-
"//third-party/rust/crates/async-trait/0.1.89:async-trait",
98-
"//third-party/rust/crates/axum/0.8.8:axum",
99-
"//third-party/rust/crates/bincode/2.0.1:bincode",
100-
"//third-party/rust/crates/bstr/1.12.1:bstr",
101-
"//third-party/rust/crates/byteorder/1.5.0:byteorder",
102-
"//third-party/rust/crates/bytes/1.11.0:bytes",
103-
"//third-party/rust/crates/chrono/0.4.43:chrono",
104-
"//third-party/rust/crates/colored/3.1.1:colored",
105-
"//third-party/rust/crates/crc32fast/1.5.0:crc32fast",
106-
"//third-party/rust/crates/dashmap/6.1.0:dashmap",
107-
"//third-party/rust/crates/diffs/0.5.1:diffs",
108-
"//third-party/rust/crates/encoding_rs/0.8.35:encoding_rs",
109-
"//third-party/rust/crates/flate2/1.1.8:flate2",
110-
"//third-party/rust/crates/futures-util/0.3.31:futures-util",
111-
"//third-party/rust/crates/futures/0.3.31:futures",
112-
"//third-party/rust/crates/hex/0.4.3:hex",
113-
"//third-party/rust/crates/libc/0.2.180:libc",
114-
"//third-party/rust/crates/lru-mem/0.3.0:lru-mem",
115-
"//third-party/rust/crates/memchr/2.7.6:memchr",
116-
"//third-party/rust/crates/natord/1.0.9:natord",
117-
"//third-party/rust/crates/num_cpus/1.17.0:num_cpus",
118-
"//third-party/rust/crates/path-absolutize/3.1.1:path-absolutize",
119-
"//third-party/rust/crates/quickcheck/1.0.3:quickcheck",
120-
"//third-party/rust/crates/rand/0.9.2:rand",
121-
"//third-party/rust/crates/rand_chacha/0.9.0:rand_chacha",
122-
"//third-party/rust/crates/rayon/1.11.0:rayon",
123-
"//third-party/rust/crates/sea-orm/1.1.19:sea-orm",
124-
"//third-party/rust/crates/serde/1.0.228:serde",
125-
"//third-party/rust/crates/sha1/0.10.6:sha1",
126-
"//third-party/rust/crates/sha2/0.10.9:sha2",
127-
"//third-party/rust/crates/similar/2.7.0:similar",
128-
"//third-party/rust/crates/tempfile/3.24.0:tempfile",
129-
"//third-party/rust/crates/thiserror/2.0.18:thiserror",
130-
"//third-party/rust/crates/threadpool/1.8.1:threadpool",
131-
"//third-party/rust/crates/tokio-stream/0.1.18:tokio-stream",
132-
"//third-party/rust/crates/tokio-util/0.7.18:tokio-util",
133-
"//third-party/rust/crates/tokio/1.49.0:tokio",
134-
"//third-party/rust/crates/tracing-subscriber/0.3.22:tracing-subscriber",
135-
"//third-party/rust/crates/tracing/0.1.44:tracing",
136-
"//third-party/rust/crates/uuid/1.19.0:uuid",
137-
"//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys",
138-
],
139-
)
140-
141-
rust_test(
142-
name = "decode-index-pack",
143-
srcs = [":git-internal-vendor"],
144-
crate = "decode_index_pack",
145-
crate_root = "vendor/tests/decode-index-pack.rs",
146-
edition = "2024",
147-
features = [
148-
"default",
149-
"diff_mydrs",
150-
],
151-
rustc_flags = ["@$(location :git-internal-manifest[env_flags])"] + select({
152-
"prelude//os/constraints:windows": select({
153-
"prelude//abi/constraints:gnu": [
154-
"@$(location //third-party/rust/crates/windows_x86_64_gnu/0.48.5:windows_x86_64_gnu-build-script-run[rustc_flags])",
155-
"@$(location //third-party/rust/crates/windows_x86_64_gnu/0.53.1:windows_x86_64_gnu-build-script-run[rustc_flags])",
156-
],
157-
"DEFAULT": [
158-
"@$(location //third-party/rust/crates/windows_x86_64_msvc/0.48.5:windows_x86_64_msvc-build-script-run[rustc_flags])",
159-
"@$(location //third-party/rust/crates/windows_x86_64_msvc/0.53.1:windows_x86_64_msvc-build-script-run[rustc_flags])",
160-
],
161-
}),
162-
"DEFAULT": [],
163-
}),
164-
visibility = ["PUBLIC"],
165-
deps = [
166-
"//third-party/rust/crates/ahash/0.8.12:ahash",
167-
"//third-party/rust/crates/async-trait/0.1.89:async-trait",
168-
"//third-party/rust/crates/axum/0.8.8:axum",
169-
"//third-party/rust/crates/bincode/2.0.1:bincode",
170-
"//third-party/rust/crates/bstr/1.12.1:bstr",
171-
"//third-party/rust/crates/byteorder/1.5.0:byteorder",
172-
"//third-party/rust/crates/bytes/1.11.0:bytes",
173-
"//third-party/rust/crates/chrono/0.4.43:chrono",
174-
"//third-party/rust/crates/colored/3.1.1:colored",
175-
"//third-party/rust/crates/crc32fast/1.5.0:crc32fast",
176-
"//third-party/rust/crates/dashmap/6.1.0:dashmap",
177-
"//third-party/rust/crates/diffs/0.5.1:diffs",
178-
"//third-party/rust/crates/encoding_rs/0.8.35:encoding_rs",
179-
"//third-party/rust/crates/flate2/1.1.8:flate2",
180-
"//third-party/rust/crates/futures-util/0.3.31:futures-util",
181-
"//third-party/rust/crates/futures/0.3.31:futures",
182-
"//third-party/rust/crates/hex/0.4.3:hex",
183-
"//third-party/rust/crates/libc/0.2.180:libc",
184-
"//third-party/rust/crates/lru-mem/0.3.0:lru-mem",
185-
"//third-party/rust/crates/memchr/2.7.6:memchr",
186-
"//third-party/rust/crates/natord/1.0.9:natord",
187-
"//third-party/rust/crates/num_cpus/1.17.0:num_cpus",
188-
"//third-party/rust/crates/path-absolutize/3.1.1:path-absolutize",
189-
"//third-party/rust/crates/quickcheck/1.0.3:quickcheck",
190-
"//third-party/rust/crates/rand/0.9.2:rand",
191-
"//third-party/rust/crates/rand_chacha/0.9.0:rand_chacha",
192-
"//third-party/rust/crates/rayon/1.11.0:rayon",
193-
"//third-party/rust/crates/sea-orm/1.1.19:sea-orm",
194-
"//third-party/rust/crates/serde/1.0.228:serde",
195-
"//third-party/rust/crates/sha1/0.10.6:sha1",
196-
"//third-party/rust/crates/sha2/0.10.9:sha2",
197-
"//third-party/rust/crates/similar/2.7.0:similar",
198-
"//third-party/rust/crates/tempfile/3.24.0:tempfile",
199-
"//third-party/rust/crates/thiserror/2.0.18:thiserror",
200-
"//third-party/rust/crates/threadpool/1.8.1:threadpool",
201-
"//third-party/rust/crates/tokio-stream/0.1.18:tokio-stream",
202-
"//third-party/rust/crates/tokio-util/0.7.18:tokio-util",
203-
"//third-party/rust/crates/tokio/1.49.0:tokio",
204-
"//third-party/rust/crates/tracing-subscriber/0.3.22:tracing-subscriber",
205-
"//third-party/rust/crates/tracing/0.1.44:tracing",
206-
"//third-party/rust/crates/uuid/1.19.0:uuid",
207-
"//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys",
208-
":git_internal",
209-
],
210-
)

PACKAGE

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# @generated by `cargo buckal`
2+
3+
load("@prelude//cfg/modifier:set_cfg_modifiers.bzl", "set_cfg_modifiers")
4+
load("@prelude//rust:with_workspace.bzl", "with_rust_workspace")
5+
load("@buckal//config:set_cfg_constructor.bzl", "set_cfg_constructor")
6+
7+
ALIASES = {
8+
"debug": "buckal//config/mode:debug",
9+
"release": "buckal//config/mode:release",
10+
}
11+
set_cfg_constructor(aliases = ALIASES)
12+
13+
set_cfg_modifiers(
14+
cfg_modifiers = [
15+
"buckal//config/mode:debug",
16+
],
17+
)

buckal.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

platforms/BUCK

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# @generated by `cargo buckal`
2+
#
3+
# Target platforms expressed using Rust-style triples.
4+
# These are intended for `--target-platforms` and to make `select()`s in
5+
# buckal-generated rules match on OS/CPU/ABI constraints.
6+
7+
load("@prelude//platforms:defs.bzl", "execution_platform")
8+
9+
platform(
10+
name = "aarch64-apple-darwin",
11+
constraint_values = [
12+
"prelude//os/constraints:macos",
13+
"prelude//cpu/constraints:arm64",
14+
],
15+
visibility = ["PUBLIC"],
16+
)
17+
18+
platform(
19+
name = "x86_64-pc-windows-msvc",
20+
constraint_values = [
21+
"prelude//os/constraints:windows",
22+
"prelude//cpu/constraints:x86_64",
23+
"prelude//abi/constraints:msvc",
24+
],
25+
visibility = ["PUBLIC"],
26+
)
27+
28+
platform(
29+
name = "x86_64-unknown-linux-gnu",
30+
constraint_values = [
31+
"prelude//os/constraints:linux",
32+
"prelude//cpu/constraints:x86_64",
33+
"prelude//abi/constraints:gnu",
34+
],
35+
visibility = ["PUBLIC"],
36+
)
37+
38+
config_setting(
39+
name = "cross",
40+
values = {
41+
"cross.skip_test": "true",
42+
},
43+
visibility = ["PUBLIC"],
44+
)
45+
46+
config_setting(
47+
name = "windows-msvc",
48+
constraint_values = [
49+
"prelude//os/constraints:windows",
50+
"prelude//abi/constraints:msvc",
51+
],
52+
visibility = ["PUBLIC"],
53+
)

third-party/README.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

third-party/rust/crates/ahash/0.7.8/BUCK

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,20 @@ rust_library(
3030
"@$(location :ahash-build-script-run[rustc_flags])",
3131
"@$(location :ahash-manifest[env_flags])",
3232
],
33-
deps = [] + select({
34-
"DEFAULT": [],
35-
"config//os:linux": [
33+
os_deps = {
34+
"linux": [
3635
"//third-party/rust/crates/getrandom/0.2.16:getrandom",
3736
"//third-party/rust/crates/once_cell/1.21.3:once_cell",
3837
],
39-
"config//os:macos": [
38+
"macos": [
4039
"//third-party/rust/crates/getrandom/0.2.16:getrandom",
4140
"//third-party/rust/crates/once_cell/1.21.3:once_cell",
4241
],
43-
"config//os:windows": [
42+
"windows": [
4443
"//third-party/rust/crates/getrandom/0.2.16:getrandom",
4544
"//third-party/rust/crates/once_cell/1.21.3:once_cell",
4645
],
47-
}),
46+
},
4847
visibility = ["PUBLIC"],
4948
)
5049

third-party/rust/crates/ahash/0.8.12/BUCK

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ rust_library(
3636
"@$(location :ahash-build-script-run[rustc_flags])",
3737
"@$(location :ahash-manifest[env_flags])",
3838
],
39+
os_deps = {
40+
"linux": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"],
41+
"macos": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"],
42+
"windows": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"],
43+
},
44+
visibility = ["PUBLIC"],
3945
deps = [
4046
"//third-party/rust/crates/cfg-if/1.0.4:cfg-if",
4147
"//third-party/rust/crates/getrandom/0.3.4:getrandom",
4248
"//third-party/rust/crates/zerocopy/0.8.31:zerocopy",
43-
] + select({
44-
"DEFAULT": [],
45-
"config//os:linux": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"],
46-
"config//os:macos": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"],
47-
"config//os:windows": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"],
48-
}),
49-
visibility = ["PUBLIC"],
49+
],
5050
)
5151

5252
rust_binary(

third-party/rust/crates/cc/1.2.49/BUCK

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ rust_library(
2525
edition = "2018",
2626
features = ["parallel"],
2727
rustc_flags = ["@$(location :cc-manifest[env_flags])"],
28+
os_deps = {
29+
"linux": ["//third-party/rust/crates/libc/0.2.180:libc"],
30+
"macos": ["//third-party/rust/crates/libc/0.2.180:libc"],
31+
},
2832
visibility = ["PUBLIC"],
2933
deps = [
3034
"//third-party/rust/crates/find-msvc-tools/0.1.5:find-msvc-tools",
3135
"//third-party/rust/crates/jobserver/0.1.34:jobserver",
3236
"//third-party/rust/crates/shlex/1.3.0:shlex",
33-
] + select({
34-
"DEFAULT": [],
35-
"config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"],
36-
"config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"],
37-
}),
37+
],
3838
)

0 commit comments

Comments
 (0)