From bc161c193c35c590fdf7f113c96c26635830a229 Mon Sep 17 00:00:00 2001 From: Eli Ma Date: Wed, 21 Jan 2026 20:32:40 +0800 Subject: [PATCH] Upgrade the buck2 support with newest buckal Signed-off-by: Eli Ma --- .buckconfig | 12 +- .gitignore | 2 +- BUCK | 141 ------------------ PACKAGE | 17 +++ buckal.toml | 1 - platforms/BUCK | 53 +++++++ third-party/README.md | 33 ---- third-party/rust/crates/ahash/0.7.8/BUCK | 11 +- third-party/rust/crates/ahash/0.8.12/BUCK | 14 +- third-party/rust/crates/cc/1.2.49/BUCK | 10 +- third-party/rust/crates/chrono/0.4.43/BUCK | 14 +- third-party/rust/crates/colored/3.0.0/BUCK | 28 ---- third-party/rust/crates/colored/3.1.1/BUCK | 7 +- .../rust/crates/cpufeatures/0.2.17/BUCK | 7 +- third-party/rust/crates/errno/0.3.14/BUCK | 11 +- third-party/rust/crates/etcetera/0.8.0/BUCK | 10 +- .../rust/crates/event-listener/5.4.1/BUCK | 14 +- third-party/rust/crates/getrandom/0.2.16/BUCK | 10 +- third-party/rust/crates/getrandom/0.3.4/BUCK | 12 +- third-party/rust/crates/home/0.5.12/BUCK | 7 +- .../rust/crates/iana-time-zone/0.1.64/BUCK | 9 +- third-party/rust/crates/jobserver/0.1.34/BUCK | 11 +- third-party/rust/crates/libloading/0.8.9/BUCK | 11 +- third-party/rust/crates/mio/1.1.1/BUCK | 11 +- .../rust/crates/nu-ansi-term/0.50.3/BUCK | 9 +- third-party/rust/crates/num_cpus/1.17.0/BUCK | 9 +- .../rust/crates/parking_lot_core/0.9.12/BUCK | 14 +- third-party/rust/crates/rand/0.8.5/BUCK | 12 +- third-party/rust/crates/rustix/1.1.3/BUCK | 30 ++-- third-party/rust/crates/sha1/0.10.6/BUCK | 14 +- third-party/rust/crates/sha2/0.10.9/BUCK | 14 +- third-party/rust/crates/socket2/0.6.1/BUCK | 11 +- .../rust/crates/sqlx-postgres/0.8.6/BUCK | 10 +- third-party/rust/crates/tempfile/3.24.0/BUCK | 18 +-- .../rust/crates/thiserror-impl/2.0.17/BUCK | 34 ----- third-party/rust/crates/thiserror/2.0.17/BUCK | 67 --------- third-party/rust/crates/tokio/1.49.0/BUCK | 26 ++-- third-party/rust/crates/uuid/1.19.0/BUCK | 12 +- .../rust/crates/windows-sys/0.59.0/BUCK | 36 ----- .../rust/crates/windows-targets/0.48.5/BUCK | 12 +- .../rust/crates/windows-targets/0.52.6/BUCK | 29 ---- .../rust/crates/windows-targets/0.53.5/BUCK | 12 +- .../windows_aarch64_gnullvm/0.52.6/BUCK | 54 ------- .../crates/windows_aarch64_msvc/0.52.6/BUCK | 54 ------- .../rust/crates/windows_i686_gnu/0.52.6/BUCK | 54 ------- .../crates/windows_i686_gnullvm/0.52.6/BUCK | 54 ------- .../rust/crates/windows_i686_msvc/0.52.6/BUCK | 54 ------- .../crates/windows_x86_64_gnu/0.52.6/BUCK | 54 ------- .../crates/windows_x86_64_gnullvm/0.52.6/BUCK | 54 ------- .../crates/windows_x86_64_msvc/0.52.6/BUCK | 54 ------- toolchains/BUCK | 62 +++----- toolchains/cxx/demo_cxx.bzl | 40 +++++ .../cxx/tools/g++-x86_64-gnu-sysroot.bat | 54 +++++++ toolchains/cxx/tools/lld-link-aarch64.bat | 4 + toolchains/cxx/tools/lld-link-i686.bat | 4 + toolchains/cxx/tools/lld_link.py | 112 ++++++++++++++ toolchains/rust/demo_rust.bzl | 18 +++ 57 files changed, 508 insertions(+), 1043 deletions(-) create mode 100644 PACKAGE delete mode 100644 buckal.toml create mode 100644 platforms/BUCK delete mode 100644 third-party/README.md delete mode 100644 third-party/rust/crates/colored/3.0.0/BUCK delete mode 100644 third-party/rust/crates/thiserror-impl/2.0.17/BUCK delete mode 100644 third-party/rust/crates/thiserror/2.0.17/BUCK delete mode 100644 third-party/rust/crates/windows-sys/0.59.0/BUCK delete mode 100644 third-party/rust/crates/windows-targets/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_aarch64_gnullvm/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_aarch64_msvc/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_i686_gnu/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_i686_gnullvm/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_i686_msvc/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_x86_64_gnu/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_x86_64_gnullvm/0.52.6/BUCK delete mode 100644 third-party/rust/crates/windows_x86_64_msvc/0.52.6/BUCK create mode 100644 toolchains/cxx/demo_cxx.bzl create mode 100644 toolchains/cxx/tools/g++-x86_64-gnu-sysroot.bat create mode 100644 toolchains/cxx/tools/lld-link-aarch64.bat create mode 100644 toolchains/cxx/tools/lld-link-i686.bat create mode 100644 toolchains/cxx/tools/lld_link.py create mode 100644 toolchains/rust/demo_rust.bzl diff --git a/.buckconfig b/.buckconfig index a42fe5f4..db7f47fd 100644 --- a/.buckconfig +++ b/.buckconfig @@ -1,9 +1,9 @@ [cells] - root = . + buckal = buckal + none = none prelude = prelude + root = . toolchains = toolchains - none = none - buckal = buckal [cell_aliases] config = prelude @@ -13,13 +13,17 @@ fbcode_macros = none buck = none +# Uses a copy of the prelude bundled with the buck2 binary. You can alternatively delete this +# section and vendor a copy of the prelude to the `prelude` directory of your project. [external_cells] prelude = bundled + + # Added by cargo-buckal. See [external_cell_buckal] for git configuration. buckal = git [external_cell_buckal] + commit_hash = 22bd38c79d2348d9a6591b7156c42d615377eaad git_origin = https://github.com/buck2hub/buckal-bundles - commit_hash = f9c4f306b1aad816fa520fe361f4f03d28cd5b7b [parser] target_platform_detector_spec = target:root//...->prelude//platforms:default \ diff --git a/.gitignore b/.gitignore index 8d67d2e0..bf57e836 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,4 @@ buck-out/ src/.DS_Store .DS_Store -examples/output_packs \ No newline at end of file +examples/output_packs/buck-out diff --git a/BUCK b/BUCK index 6bc4a502..2966e310 100644 --- a/BUCK +++ b/BUCK @@ -67,144 +67,3 @@ rust_library( "//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys", ], ) - -rust_test( - name = "git_internal-unittest", - srcs = [":git-internal-vendor"], - crate = "git_internal", - crate_root = "vendor/src/lib.rs", - edition = "2024", - features = [ - "default", - "diff_mydrs", - ], - rustc_flags = ["@$(location :git-internal-manifest[env_flags])"] + select({ - "prelude//os/constraints:windows": select({ - "prelude//abi/constraints:gnu": [ - "@$(location //third-party/rust/crates/windows_x86_64_gnu/0.48.5:windows_x86_64_gnu-build-script-run[rustc_flags])", - "@$(location //third-party/rust/crates/windows_x86_64_gnu/0.53.1:windows_x86_64_gnu-build-script-run[rustc_flags])", - ], - "DEFAULT": [ - "@$(location //third-party/rust/crates/windows_x86_64_msvc/0.48.5:windows_x86_64_msvc-build-script-run[rustc_flags])", - "@$(location //third-party/rust/crates/windows_x86_64_msvc/0.53.1:windows_x86_64_msvc-build-script-run[rustc_flags])", - ], - }), - "DEFAULT": [], - }), - visibility = ["PUBLIC"], - deps = [ - "//third-party/rust/crates/ahash/0.8.12:ahash", - "//third-party/rust/crates/async-trait/0.1.89:async-trait", - "//third-party/rust/crates/axum/0.8.8:axum", - "//third-party/rust/crates/bincode/2.0.1:bincode", - "//third-party/rust/crates/bstr/1.12.1:bstr", - "//third-party/rust/crates/byteorder/1.5.0:byteorder", - "//third-party/rust/crates/bytes/1.11.0:bytes", - "//third-party/rust/crates/chrono/0.4.43:chrono", - "//third-party/rust/crates/colored/3.1.1:colored", - "//third-party/rust/crates/crc32fast/1.5.0:crc32fast", - "//third-party/rust/crates/dashmap/6.1.0:dashmap", - "//third-party/rust/crates/diffs/0.5.1:diffs", - "//third-party/rust/crates/encoding_rs/0.8.35:encoding_rs", - "//third-party/rust/crates/flate2/1.1.8:flate2", - "//third-party/rust/crates/futures-util/0.3.31:futures-util", - "//third-party/rust/crates/futures/0.3.31:futures", - "//third-party/rust/crates/hex/0.4.3:hex", - "//third-party/rust/crates/libc/0.2.180:libc", - "//third-party/rust/crates/lru-mem/0.3.0:lru-mem", - "//third-party/rust/crates/memchr/2.7.6:memchr", - "//third-party/rust/crates/natord/1.0.9:natord", - "//third-party/rust/crates/num_cpus/1.17.0:num_cpus", - "//third-party/rust/crates/path-absolutize/3.1.1:path-absolutize", - "//third-party/rust/crates/quickcheck/1.0.3:quickcheck", - "//third-party/rust/crates/rand/0.9.2:rand", - "//third-party/rust/crates/rand_chacha/0.9.0:rand_chacha", - "//third-party/rust/crates/rayon/1.11.0:rayon", - "//third-party/rust/crates/sea-orm/1.1.19:sea-orm", - "//third-party/rust/crates/serde/1.0.228:serde", - "//third-party/rust/crates/sha1/0.10.6:sha1", - "//third-party/rust/crates/sha2/0.10.9:sha2", - "//third-party/rust/crates/similar/2.7.0:similar", - "//third-party/rust/crates/tempfile/3.24.0:tempfile", - "//third-party/rust/crates/thiserror/2.0.18:thiserror", - "//third-party/rust/crates/threadpool/1.8.1:threadpool", - "//third-party/rust/crates/tokio-stream/0.1.18:tokio-stream", - "//third-party/rust/crates/tokio-util/0.7.18:tokio-util", - "//third-party/rust/crates/tokio/1.49.0:tokio", - "//third-party/rust/crates/tracing-subscriber/0.3.22:tracing-subscriber", - "//third-party/rust/crates/tracing/0.1.44:tracing", - "//third-party/rust/crates/uuid/1.19.0:uuid", - "//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys", - ], -) - -rust_test( - name = "decode-index-pack", - srcs = [":git-internal-vendor"], - crate = "decode_index_pack", - crate_root = "vendor/tests/decode-index-pack.rs", - edition = "2024", - features = [ - "default", - "diff_mydrs", - ], - rustc_flags = ["@$(location :git-internal-manifest[env_flags])"] + select({ - "prelude//os/constraints:windows": select({ - "prelude//abi/constraints:gnu": [ - "@$(location //third-party/rust/crates/windows_x86_64_gnu/0.48.5:windows_x86_64_gnu-build-script-run[rustc_flags])", - "@$(location //third-party/rust/crates/windows_x86_64_gnu/0.53.1:windows_x86_64_gnu-build-script-run[rustc_flags])", - ], - "DEFAULT": [ - "@$(location //third-party/rust/crates/windows_x86_64_msvc/0.48.5:windows_x86_64_msvc-build-script-run[rustc_flags])", - "@$(location //third-party/rust/crates/windows_x86_64_msvc/0.53.1:windows_x86_64_msvc-build-script-run[rustc_flags])", - ], - }), - "DEFAULT": [], - }), - visibility = ["PUBLIC"], - deps = [ - "//third-party/rust/crates/ahash/0.8.12:ahash", - "//third-party/rust/crates/async-trait/0.1.89:async-trait", - "//third-party/rust/crates/axum/0.8.8:axum", - "//third-party/rust/crates/bincode/2.0.1:bincode", - "//third-party/rust/crates/bstr/1.12.1:bstr", - "//third-party/rust/crates/byteorder/1.5.0:byteorder", - "//third-party/rust/crates/bytes/1.11.0:bytes", - "//third-party/rust/crates/chrono/0.4.43:chrono", - "//third-party/rust/crates/colored/3.1.1:colored", - "//third-party/rust/crates/crc32fast/1.5.0:crc32fast", - "//third-party/rust/crates/dashmap/6.1.0:dashmap", - "//third-party/rust/crates/diffs/0.5.1:diffs", - "//third-party/rust/crates/encoding_rs/0.8.35:encoding_rs", - "//third-party/rust/crates/flate2/1.1.8:flate2", - "//third-party/rust/crates/futures-util/0.3.31:futures-util", - "//third-party/rust/crates/futures/0.3.31:futures", - "//third-party/rust/crates/hex/0.4.3:hex", - "//third-party/rust/crates/libc/0.2.180:libc", - "//third-party/rust/crates/lru-mem/0.3.0:lru-mem", - "//third-party/rust/crates/memchr/2.7.6:memchr", - "//third-party/rust/crates/natord/1.0.9:natord", - "//third-party/rust/crates/num_cpus/1.17.0:num_cpus", - "//third-party/rust/crates/path-absolutize/3.1.1:path-absolutize", - "//third-party/rust/crates/quickcheck/1.0.3:quickcheck", - "//third-party/rust/crates/rand/0.9.2:rand", - "//third-party/rust/crates/rand_chacha/0.9.0:rand_chacha", - "//third-party/rust/crates/rayon/1.11.0:rayon", - "//third-party/rust/crates/sea-orm/1.1.19:sea-orm", - "//third-party/rust/crates/serde/1.0.228:serde", - "//third-party/rust/crates/sha1/0.10.6:sha1", - "//third-party/rust/crates/sha2/0.10.9:sha2", - "//third-party/rust/crates/similar/2.7.0:similar", - "//third-party/rust/crates/tempfile/3.24.0:tempfile", - "//third-party/rust/crates/thiserror/2.0.18:thiserror", - "//third-party/rust/crates/threadpool/1.8.1:threadpool", - "//third-party/rust/crates/tokio-stream/0.1.18:tokio-stream", - "//third-party/rust/crates/tokio-util/0.7.18:tokio-util", - "//third-party/rust/crates/tokio/1.49.0:tokio", - "//third-party/rust/crates/tracing-subscriber/0.3.22:tracing-subscriber", - "//third-party/rust/crates/tracing/0.1.44:tracing", - "//third-party/rust/crates/uuid/1.19.0:uuid", - "//third-party/rust/crates/zstd-sys/2.0.16+zstd.1.5.7:zstd-sys", - ":git_internal", - ], -) diff --git a/PACKAGE b/PACKAGE new file mode 100644 index 00000000..2af030bb --- /dev/null +++ b/PACKAGE @@ -0,0 +1,17 @@ +# @generated by `cargo buckal` + +load("@prelude//cfg/modifier:set_cfg_modifiers.bzl", "set_cfg_modifiers") +load("@prelude//rust:with_workspace.bzl", "with_rust_workspace") +load("@buckal//config:set_cfg_constructor.bzl", "set_cfg_constructor") + +ALIASES = { + "debug": "buckal//config/mode:debug", + "release": "buckal//config/mode:release", +} +set_cfg_constructor(aliases = ALIASES) + +set_cfg_modifiers( + cfg_modifiers = [ + "buckal//config/mode:debug", + ], +) diff --git a/buckal.toml b/buckal.toml deleted file mode 100644 index cd2f5c85..00000000 --- a/buckal.toml +++ /dev/null @@ -1 +0,0 @@ -ignore_tests = false \ No newline at end of file diff --git a/platforms/BUCK b/platforms/BUCK new file mode 100644 index 00000000..59f242e1 --- /dev/null +++ b/platforms/BUCK @@ -0,0 +1,53 @@ +# @generated by `cargo buckal` +# +# Target platforms expressed using Rust-style triples. +# These are intended for `--target-platforms` and to make `select()`s in +# buckal-generated rules match on OS/CPU/ABI constraints. + +load("@prelude//platforms:defs.bzl", "execution_platform") + +platform( + name = "aarch64-apple-darwin", + constraint_values = [ + "prelude//os/constraints:macos", + "prelude//cpu/constraints:arm64", + ], + visibility = ["PUBLIC"], +) + +platform( + name = "x86_64-pc-windows-msvc", + constraint_values = [ + "prelude//os/constraints:windows", + "prelude//cpu/constraints:x86_64", + "prelude//abi/constraints:msvc", + ], + visibility = ["PUBLIC"], +) + +platform( + name = "x86_64-unknown-linux-gnu", + constraint_values = [ + "prelude//os/constraints:linux", + "prelude//cpu/constraints:x86_64", + "prelude//abi/constraints:gnu", + ], + visibility = ["PUBLIC"], +) + +config_setting( + name = "cross", + values = { + "cross.skip_test": "true", + }, + visibility = ["PUBLIC"], +) + +config_setting( + name = "windows-msvc", + constraint_values = [ + "prelude//os/constraints:windows", + "prelude//abi/constraints:msvc", + ], + visibility = ["PUBLIC"], +) diff --git a/third-party/README.md b/third-party/README.md deleted file mode 100644 index e2bf7836..00000000 --- a/third-party/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# Third-party Dependency Management - -Buckal (a.k.a. `cargo-buckal`) is a Cargo plugin that enables seamless migration of Cargo packages to the Buck2 build system. It automatically resolves Cargo dependencies and generates BUCK files, allowing developers to use Buck2 as effortlessly as they would use `cargo`, with minimal manual configuration required. - -## Install Buckal - -The Git-Internal project leverages Buckal for managing third-party dependencies and generating Buck2 build configurations. Install the Buckal plugin using the following command: - -```bash -cargo install --git https://github.com/buck2hub/cargo-buckal.git -``` - -NOTE: Buckal requires Buck2 and Python 3. Please ensure both are installed on your system before proceeding. - -## Manage dependencies - -You're working away on your code, and you suddenly need to use some third-party crates. With Buckal, you can keep using the familiar Cargo workflow. Simply prepend `buckal` to your usual command, and stay right in your project directory. - -To add a dependency, run: - -```bash -cargo buckal add [@] [--features ] -``` - -This command adds the specified crate to your `Cargo.toml` and automatically generates or updates the corresponding BUCK build rules for Buck2. - -If you prefer editing `Cargo.toml` manually, just make your changes as usual and then synchronize them to Buck2 by running: - -```bash -cargo buckal migrate -``` - -This parses your dependencies and updates only the BUCK files that need to change, keeping your build configuration in sync with your Cargo manifest — automatically and without manual effort. \ No newline at end of file diff --git a/third-party/rust/crates/ahash/0.7.8/BUCK b/third-party/rust/crates/ahash/0.7.8/BUCK index f4ff45eb..f33e1a92 100644 --- a/third-party/rust/crates/ahash/0.7.8/BUCK +++ b/third-party/rust/crates/ahash/0.7.8/BUCK @@ -30,21 +30,20 @@ rust_library( "@$(location :ahash-build-script-run[rustc_flags])", "@$(location :ahash-manifest[env_flags])", ], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": [ + os_deps = { + "linux": [ "//third-party/rust/crates/getrandom/0.2.16:getrandom", "//third-party/rust/crates/once_cell/1.21.3:once_cell", ], - "config//os:macos": [ + "macos": [ "//third-party/rust/crates/getrandom/0.2.16:getrandom", "//third-party/rust/crates/once_cell/1.21.3:once_cell", ], - "config//os:windows": [ + "windows": [ "//third-party/rust/crates/getrandom/0.2.16:getrandom", "//third-party/rust/crates/once_cell/1.21.3:once_cell", ], - }), + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/ahash/0.8.12/BUCK b/third-party/rust/crates/ahash/0.8.12/BUCK index f44fdebb..fe79a9fd 100644 --- a/third-party/rust/crates/ahash/0.8.12/BUCK +++ b/third-party/rust/crates/ahash/0.8.12/BUCK @@ -36,17 +36,17 @@ rust_library( "@$(location :ahash-build-script-run[rustc_flags])", "@$(location :ahash-manifest[env_flags])", ], + os_deps = { + "linux": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"], + "macos": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"], + "windows": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/cfg-if/1.0.4:cfg-if", "//third-party/rust/crates/getrandom/0.3.4:getrandom", "//third-party/rust/crates/zerocopy/0.8.31:zerocopy", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"], - "config//os:macos": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"], - "config//os:windows": ["//third-party/rust/crates/once_cell/1.21.3:once_cell"], - }), - visibility = ["PUBLIC"], + ], ) rust_binary( diff --git a/third-party/rust/crates/cc/1.2.49/BUCK b/third-party/rust/crates/cc/1.2.49/BUCK index 19947ab2..6e570ee1 100644 --- a/third-party/rust/crates/cc/1.2.49/BUCK +++ b/third-party/rust/crates/cc/1.2.49/BUCK @@ -25,14 +25,14 @@ rust_library( edition = "2018", features = ["parallel"], rustc_flags = ["@$(location :cc-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + }, visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/find-msvc-tools/0.1.5:find-msvc-tools", "//third-party/rust/crates/jobserver/0.1.34:jobserver", "//third-party/rust/crates/shlex/1.3.0:shlex", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - }), + ], ) diff --git a/third-party/rust/crates/chrono/0.4.43/BUCK b/third-party/rust/crates/chrono/0.4.43/BUCK index 3e9d4b28..d9c3e0dc 100644 --- a/third-party/rust/crates/chrono/0.4.43/BUCK +++ b/third-party/rust/crates/chrono/0.4.43/BUCK @@ -39,14 +39,14 @@ rust_library( "windows-link", ], rustc_flags = ["@$(location :chrono-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/iana-time-zone/0.1.64:iana-time-zone"], + "macos": ["//third-party/rust/crates/iana-time-zone/0.1.64:iana-time-zone"], + "windows": ["//third-party/rust/crates/windows-link/0.2.1:windows-link"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/num-traits/0.2.19:num-traits", "//third-party/rust/crates/serde/1.0.228:serde", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/iana-time-zone/0.1.64:iana-time-zone"], - "config//os:macos": ["//third-party/rust/crates/iana-time-zone/0.1.64:iana-time-zone"], - "config//os:windows": ["//third-party/rust/crates/windows-link/0.2.1:windows-link"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/colored/3.0.0/BUCK b/third-party/rust/crates/colored/3.0.0/BUCK deleted file mode 100644 index 4fbaf1a8..00000000 --- a/third-party/rust/crates/colored/3.0.0/BUCK +++ /dev/null @@ -1,28 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "colored-vendor", - urls = ["https://static.crates.io/crates/colored/colored-3.0.0.crate"], - sha256 = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e", - type = "tar.gz", - strip_prefix = "colored-3.0.0", - out = "vendor", -) - -cargo_manifest( - name = "colored-manifest", - vendor = ":colored-vendor", -) - -rust_library( - name = "colored", - srcs = [":colored-vendor"], - crate = "colored", - crate_root = "vendor/src/lib.rs", - edition = "2021", - rustc_flags = ["@$(location :colored-manifest[env_flags])"], - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/colored/3.1.1/BUCK b/third-party/rust/crates/colored/3.1.1/BUCK index 7790fb3b..f308a1df 100644 --- a/third-party/rust/crates/colored/3.1.1/BUCK +++ b/third-party/rust/crates/colored/3.1.1/BUCK @@ -24,9 +24,8 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2021", rustc_flags = ["@$(location :colored-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], - }), + os_deps = { + "windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/cpufeatures/0.2.17/BUCK b/third-party/rust/crates/cpufeatures/0.2.17/BUCK index cd11ca5d..d7b867f0 100644 --- a/third-party/rust/crates/cpufeatures/0.2.17/BUCK +++ b/third-party/rust/crates/cpufeatures/0.2.17/BUCK @@ -24,9 +24,8 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2018", rustc_flags = ["@$(location :cpufeatures-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - }), + os_deps = { + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/errno/0.3.14/BUCK b/third-party/rust/crates/errno/0.3.14/BUCK index e1677072..8a8dba91 100644 --- a/third-party/rust/crates/errno/0.3.14/BUCK +++ b/third-party/rust/crates/errno/0.3.14/BUCK @@ -25,11 +25,10 @@ rust_library( edition = "2018", features = ["std"], rustc_flags = ["@$(location :errno-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + "windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/etcetera/0.8.0/BUCK b/third-party/rust/crates/etcetera/0.8.0/BUCK index 2e8999a4..0dc99e82 100644 --- a/third-party/rust/crates/etcetera/0.8.0/BUCK +++ b/third-party/rust/crates/etcetera/0.8.0/BUCK @@ -24,12 +24,12 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2018", rustc_flags = ["@$(location :etcetera-manifest[env_flags])"], + os_deps = { + "windows": ["//third-party/rust/crates/windows-sys/0.48.0:windows-sys"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/cfg-if/1.0.4:cfg-if", "//third-party/rust/crates/home/0.5.12:home", - ] + select({ - "DEFAULT": [], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.48.0:windows-sys"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/event-listener/5.4.1/BUCK b/third-party/rust/crates/event-listener/5.4.1/BUCK index 5941a308..9f555a2b 100644 --- a/third-party/rust/crates/event-listener/5.4.1/BUCK +++ b/third-party/rust/crates/event-listener/5.4.1/BUCK @@ -29,14 +29,14 @@ rust_library( "std", ], rustc_flags = ["@$(location :event-listener-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/parking/2.2.1:parking"], + "macos": ["//third-party/rust/crates/parking/2.2.1:parking"], + "windows": ["//third-party/rust/crates/parking/2.2.1:parking"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/concurrent-queue/2.5.0:concurrent-queue", "//third-party/rust/crates/pin-project-lite/0.2.16:pin-project-lite", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/parking/2.2.1:parking"], - "config//os:macos": ["//third-party/rust/crates/parking/2.2.1:parking"], - "config//os:windows": ["//third-party/rust/crates/parking/2.2.1:parking"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/getrandom/0.2.16/BUCK b/third-party/rust/crates/getrandom/0.2.16/BUCK index fc855c3f..51b0d168 100644 --- a/third-party/rust/crates/getrandom/0.2.16/BUCK +++ b/third-party/rust/crates/getrandom/0.2.16/BUCK @@ -25,10 +25,10 @@ rust_library( edition = "2018", features = ["std"], rustc_flags = ["@$(location :getrandom-manifest[env_flags])"], - deps = ["//third-party/rust/crates/cfg-if/1.0.4:cfg-if"] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + }, visibility = ["PUBLIC"], + deps = ["//third-party/rust/crates/cfg-if/1.0.4:cfg-if"], ) diff --git a/third-party/rust/crates/getrandom/0.3.4/BUCK b/third-party/rust/crates/getrandom/0.3.4/BUCK index a9945436..2ade49a3 100644 --- a/third-party/rust/crates/getrandom/0.3.4/BUCK +++ b/third-party/rust/crates/getrandom/0.3.4/BUCK @@ -31,15 +31,15 @@ rust_library( "@$(location :getrandom-build-script-run[rustc_flags])", "@$(location :getrandom-manifest[env_flags])", ], + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/cfg-if/1.0.4:cfg-if", "//third-party/rust/crates/r-efi/5.3.0:r-efi", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - }), - visibility = ["PUBLIC"], + ], ) rust_binary( diff --git a/third-party/rust/crates/home/0.5.12/BUCK b/third-party/rust/crates/home/0.5.12/BUCK index 221adaae..173a36f6 100644 --- a/third-party/rust/crates/home/0.5.12/BUCK +++ b/third-party/rust/crates/home/0.5.12/BUCK @@ -24,9 +24,8 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2024", rustc_flags = ["@$(location :home-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], - }), + os_deps = { + "windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/iana-time-zone/0.1.64/BUCK b/third-party/rust/crates/iana-time-zone/0.1.64/BUCK index d77789ac..a77f7465 100644 --- a/third-party/rust/crates/iana-time-zone/0.1.64/BUCK +++ b/third-party/rust/crates/iana-time-zone/0.1.64/BUCK @@ -25,10 +25,9 @@ rust_library( edition = "2021", features = ["fallback"], rustc_flags = ["@$(location :iana-time-zone-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:macos": ["//third-party/rust/crates/core-foundation-sys/0.8.7:core-foundation-sys"], - "config//os:windows": ["//third-party/rust/crates/windows-core/0.62.2:windows-core"], - }), + os_deps = { + "macos": ["//third-party/rust/crates/core-foundation-sys/0.8.7:core-foundation-sys"], + "windows": ["//third-party/rust/crates/windows-core/0.62.2:windows-core"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/jobserver/0.1.34/BUCK b/third-party/rust/crates/jobserver/0.1.34/BUCK index 840f0534..1d21e9b1 100644 --- a/third-party/rust/crates/jobserver/0.1.34/BUCK +++ b/third-party/rust/crates/jobserver/0.1.34/BUCK @@ -24,11 +24,10 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2021", rustc_flags = ["@$(location :jobserver-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:windows": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + "windows": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/libloading/0.8.9/BUCK b/third-party/rust/crates/libloading/0.8.9/BUCK index 49d72888..520338b9 100644 --- a/third-party/rust/crates/libloading/0.8.9/BUCK +++ b/third-party/rust/crates/libloading/0.8.9/BUCK @@ -24,11 +24,10 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2015", rustc_flags = ["@$(location :libloading-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/cfg-if/1.0.4:cfg-if"], - "config//os:macos": ["//third-party/rust/crates/cfg-if/1.0.4:cfg-if"], - "config//os:windows": ["//third-party/rust/crates/windows-link/0.2.1:windows-link"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/cfg-if/1.0.4:cfg-if"], + "macos": ["//third-party/rust/crates/cfg-if/1.0.4:cfg-if"], + "windows": ["//third-party/rust/crates/windows-link/0.2.1:windows-link"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/mio/1.1.1/BUCK b/third-party/rust/crates/mio/1.1.1/BUCK index 416f4a27..10f4cf77 100644 --- a/third-party/rust/crates/mio/1.1.1/BUCK +++ b/third-party/rust/crates/mio/1.1.1/BUCK @@ -29,11 +29,10 @@ rust_library( "os-poll", ], rustc_flags = ["@$(location :mio-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + "windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/nu-ansi-term/0.50.3/BUCK b/third-party/rust/crates/nu-ansi-term/0.50.3/BUCK index 6d8a104a..f68d79ea 100644 --- a/third-party/rust/crates/nu-ansi-term/0.50.3/BUCK +++ b/third-party/rust/crates/nu-ansi-term/0.50.3/BUCK @@ -28,9 +28,10 @@ rust_library( "std", ], rustc_flags = ["@$(location :nu-ansi-term-manifest[env_flags])"], + os_named_deps = { + "windows": { + "windows": "//third-party/rust/crates/windows-sys/0.61.2:windows-sys", + }, + }, visibility = ["PUBLIC"], - deps = select({ - "DEFAULT": [], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], - }), ) diff --git a/third-party/rust/crates/num_cpus/1.17.0/BUCK b/third-party/rust/crates/num_cpus/1.17.0/BUCK index c22b51a9..9b9f72f6 100644 --- a/third-party/rust/crates/num_cpus/1.17.0/BUCK +++ b/third-party/rust/crates/num_cpus/1.17.0/BUCK @@ -24,10 +24,9 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2015", rustc_flags = ["@$(location :num_cpus-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/parking_lot_core/0.9.12/BUCK b/third-party/rust/crates/parking_lot_core/0.9.12/BUCK index e77ef2f5..3e0ce4b0 100644 --- a/third-party/rust/crates/parking_lot_core/0.9.12/BUCK +++ b/third-party/rust/crates/parking_lot_core/0.9.12/BUCK @@ -30,16 +30,16 @@ rust_library( "@$(location :parking_lot_core-build-script-run[rustc_flags])", "@$(location :parking_lot_core-manifest[env_flags])", ], + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + "windows": ["//third-party/rust/crates/windows-link/0.2.1:windows-link"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/cfg-if/1.0.4:cfg-if", "//third-party/rust/crates/smallvec/1.15.1:smallvec", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:windows": ["//third-party/rust/crates/windows-link/0.2.1:windows-link"], - }), - visibility = ["PUBLIC"], + ], ) rust_binary( diff --git a/third-party/rust/crates/rand/0.8.5/BUCK b/third-party/rust/crates/rand/0.8.5/BUCK index 7eb7fe9e..1af0bbca 100644 --- a/third-party/rust/crates/rand/0.8.5/BUCK +++ b/third-party/rust/crates/rand/0.8.5/BUCK @@ -33,13 +33,13 @@ rust_library( "std_rng", ], rustc_flags = ["@$(location :rand-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/rand_chacha/0.3.1:rand_chacha", "//third-party/rust/crates/rand_core/0.6.4:rand_core", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/rustix/1.1.3/BUCK b/third-party/rust/crates/rustix/1.1.3/BUCK index f5f1b725..7e52077f 100644 --- a/third-party/rust/crates/rustix/1.1.3/BUCK +++ b/third-party/rust/crates/rustix/1.1.3/BUCK @@ -36,25 +36,23 @@ rust_library( "@$(location :rustix-build-script-run[rustc_flags])", "@$(location :rustix-manifest[env_flags])", ], + os_named_deps = { + "libc_errno": { + "linux": "//third-party/rust/crates/errno/0.3.14:errno", + "macos": "//third-party/rust/crates/errno/0.3.14:errno", + "windows": "//third-party/rust/crates/errno/0.3.14:errno", + }, + }, + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + "windows": ["//third-party/rust/crates/windows-sys/0.61.2:windows-sys"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/bitflags/2.10.0:bitflags", "//third-party/rust/crates/linux-raw-sys/0.11.0:linux-raw-sys", - ] + select({ - "DEFAULT": [], - "config//os:linux": [ - "//third-party/rust/crates/libc/0.2.180:libc", - "//third-party/rust/crates/errno/0.3.14:errno", - ], - "config//os:macos": [ - "//third-party/rust/crates/libc/0.2.180:libc", - "//third-party/rust/crates/errno/0.3.14:errno", - ], - "config//os:windows": [ - "//third-party/rust/crates/windows-sys/0.61.2:windows-sys", - "//third-party/rust/crates/errno/0.3.14:errno", - ], - }), - visibility = ["PUBLIC"], + ], ) rust_binary( diff --git a/third-party/rust/crates/sha1/0.10.6/BUCK b/third-party/rust/crates/sha1/0.10.6/BUCK index 47735468..a60f7fce 100644 --- a/third-party/rust/crates/sha1/0.10.6/BUCK +++ b/third-party/rust/crates/sha1/0.10.6/BUCK @@ -28,14 +28,14 @@ rust_library( "std", ], rustc_flags = ["@$(location :sha1-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], + "macos": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], + "windows": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/cfg-if/1.0.4:cfg-if", "//third-party/rust/crates/digest/0.10.7:digest", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], - "config//os:macos": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], - "config//os:windows": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/sha2/0.10.9/BUCK b/third-party/rust/crates/sha2/0.10.9/BUCK index 0f9d2a1c..abe68a49 100644 --- a/third-party/rust/crates/sha2/0.10.9/BUCK +++ b/third-party/rust/crates/sha2/0.10.9/BUCK @@ -28,14 +28,14 @@ rust_library( "std", ], rustc_flags = ["@$(location :sha2-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], + "macos": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], + "windows": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/cfg-if/1.0.4:cfg-if", "//third-party/rust/crates/digest/0.10.7:digest", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], - "config//os:macos": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], - "config//os:windows": ["//third-party/rust/crates/cpufeatures/0.2.17:cpufeatures"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/socket2/0.6.1/BUCK b/third-party/rust/crates/socket2/0.6.1/BUCK index 916bae49..39a60a71 100644 --- a/third-party/rust/crates/socket2/0.6.1/BUCK +++ b/third-party/rust/crates/socket2/0.6.1/BUCK @@ -25,11 +25,10 @@ rust_library( edition = "2021", features = ["all"], rustc_flags = ["@$(location :socket2-manifest[env_flags])"], - deps = [] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:macos": ["//third-party/rust/crates/libc/0.2.180:libc"], - "config//os:windows": ["//third-party/rust/crates/windows-sys/0.60.2:windows-sys"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/libc/0.2.180:libc"], + "macos": ["//third-party/rust/crates/libc/0.2.180:libc"], + "windows": ["//third-party/rust/crates/windows-sys/0.60.2:windows-sys"], + }, visibility = ["PUBLIC"], ) diff --git a/third-party/rust/crates/sqlx-postgres/0.8.6/BUCK b/third-party/rust/crates/sqlx-postgres/0.8.6/BUCK index 1e97e423..9c5f312c 100644 --- a/third-party/rust/crates/sqlx-postgres/0.8.6/BUCK +++ b/third-party/rust/crates/sqlx-postgres/0.8.6/BUCK @@ -37,6 +37,10 @@ rust_library( named_deps = { "md5": "//third-party/rust/crates/md-5/0.10.6:md-5", }, + os_deps = { + "windows": ["//third-party/rust/crates/etcetera/0.8.0:etcetera"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/atoi/2.0.0:atoi", "//third-party/rust/crates/base64/0.22.1:base64", @@ -71,9 +75,5 @@ rust_library( "//third-party/rust/crates/tracing/0.1.44:tracing", "//third-party/rust/crates/uuid/1.19.0:uuid", "//third-party/rust/crates/whoami/1.6.1:whoami", - ] + select({ - "DEFAULT": [], - "config//os:windows": ["//third-party/rust/crates/etcetera/0.8.0:etcetera"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/tempfile/3.24.0/BUCK b/third-party/rust/crates/tempfile/3.24.0/BUCK index 62467899..8df43a0b 100644 --- a/third-party/rust/crates/tempfile/3.24.0/BUCK +++ b/third-party/rust/crates/tempfile/3.24.0/BUCK @@ -28,23 +28,23 @@ rust_library( "getrandom", ], rustc_flags = ["@$(location :tempfile-manifest[env_flags])"], - deps = [ - "//third-party/rust/crates/fastrand/2.3.0:fastrand", - "//third-party/rust/crates/once_cell/1.21.3:once_cell", - ] + select({ - "DEFAULT": [], - "config//os:linux": [ + os_deps = { + "linux": [ "//third-party/rust/crates/getrandom/0.3.4:getrandom", "//third-party/rust/crates/rustix/1.1.3:rustix", ], - "config//os:macos": [ + "macos": [ "//third-party/rust/crates/getrandom/0.3.4:getrandom", "//third-party/rust/crates/rustix/1.1.3:rustix", ], - "config//os:windows": [ + "windows": [ "//third-party/rust/crates/getrandom/0.3.4:getrandom", "//third-party/rust/crates/windows-sys/0.61.2:windows-sys", ], - }), + }, visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/fastrand/2.3.0:fastrand", + "//third-party/rust/crates/once_cell/1.21.3:once_cell", + ], ) diff --git a/third-party/rust/crates/thiserror-impl/2.0.17/BUCK b/third-party/rust/crates/thiserror-impl/2.0.17/BUCK deleted file mode 100644 index 2f7bbe1d..00000000 --- a/third-party/rust/crates/thiserror-impl/2.0.17/BUCK +++ /dev/null @@ -1,34 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "thiserror-impl-vendor", - urls = ["https://static.crates.io/crates/thiserror-impl/thiserror-impl-2.0.17.crate"], - sha256 = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913", - type = "tar.gz", - strip_prefix = "thiserror-impl-2.0.17", - out = "vendor", -) - -cargo_manifest( - name = "thiserror-impl-manifest", - vendor = ":thiserror-impl-vendor", -) - -rust_library( - name = "thiserror-impl", - srcs = [":thiserror-impl-vendor"], - crate = "thiserror_impl", - crate_root = "vendor/src/lib.rs", - edition = "2021", - rustc_flags = ["@$(location :thiserror-impl-manifest[env_flags])"], - proc_macro = True, - visibility = ["PUBLIC"], - deps = [ - "//third-party/rust/crates/proc-macro2/1.0.103:proc-macro2", - "//third-party/rust/crates/quote/1.0.42:quote", - "//third-party/rust/crates/syn/2.0.111:syn", - ], -) diff --git a/third-party/rust/crates/thiserror/2.0.17/BUCK b/third-party/rust/crates/thiserror/2.0.17/BUCK deleted file mode 100644 index cba33b22..00000000 --- a/third-party/rust/crates/thiserror/2.0.17/BUCK +++ /dev/null @@ -1,67 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "thiserror-vendor", - urls = ["https://static.crates.io/crates/thiserror/thiserror-2.0.17.crate"], - sha256 = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8", - type = "tar.gz", - strip_prefix = "thiserror-2.0.17", - out = "vendor", -) - -cargo_manifest( - name = "thiserror-manifest", - vendor = ":thiserror-vendor", -) - -rust_library( - name = "thiserror", - srcs = [":thiserror-vendor"], - crate = "thiserror", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :thiserror-build-script-run[out_dir])", - }, - features = [ - "default", - "std", - ], - rustc_flags = [ - "@$(location :thiserror-build-script-run[rustc_flags])", - "@$(location :thiserror-manifest[env_flags])", - ], - visibility = ["PUBLIC"], - deps = ["//third-party/rust/crates/thiserror-impl/2.0.17:thiserror-impl"], -) - -rust_binary( - name = "thiserror-build-script-build", - srcs = [":thiserror-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - features = [ - "default", - "std", - ], - rustc_flags = ["@$(location :thiserror-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "thiserror-build-script-run", - package_name = "thiserror", - buildscript_rule = ":thiserror-build-script-build", - env_srcs = [":thiserror-manifest[env_dict]"], - features = [ - "default", - "std", - ], - version = "2.0.17", - manifest_dir = ":thiserror-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/tokio/1.49.0/BUCK b/third-party/rust/crates/tokio/1.49.0/BUCK index d250c398..6e51c2bd 100644 --- a/third-party/rust/crates/tokio/1.49.0/BUCK +++ b/third-party/rust/crates/tokio/1.49.0/BUCK @@ -47,27 +47,27 @@ rust_library( "windows-sys", ], rustc_flags = ["@$(location :tokio-manifest[env_flags])"], - deps = [ - "//third-party/rust/crates/bytes/1.11.0:bytes", - "//third-party/rust/crates/libc/0.2.180:libc", - "//third-party/rust/crates/mio/1.1.1:mio", - "//third-party/rust/crates/parking_lot/0.12.5:parking_lot", - "//third-party/rust/crates/pin-project-lite/0.2.16:pin-project-lite", - "//third-party/rust/crates/tokio-macros/2.6.0:tokio-macros", - ] + select({ - "DEFAULT": [], - "config//os:linux": [ + os_deps = { + "linux": [ "//third-party/rust/crates/signal-hook-registry/1.4.7:signal-hook-registry", "//third-party/rust/crates/socket2/0.6.1:socket2", ], - "config//os:macos": [ + "macos": [ "//third-party/rust/crates/signal-hook-registry/1.4.7:signal-hook-registry", "//third-party/rust/crates/socket2/0.6.1:socket2", ], - "config//os:windows": [ + "windows": [ "//third-party/rust/crates/socket2/0.6.1:socket2", "//third-party/rust/crates/windows-sys/0.61.2:windows-sys", ], - }), + }, visibility = ["PUBLIC"], + deps = [ + "//third-party/rust/crates/bytes/1.11.0:bytes", + "//third-party/rust/crates/libc/0.2.180:libc", + "//third-party/rust/crates/mio/1.1.1:mio", + "//third-party/rust/crates/parking_lot/0.12.5:parking_lot", + "//third-party/rust/crates/pin-project-lite/0.2.16:pin-project-lite", + "//third-party/rust/crates/tokio-macros/2.6.0:tokio-macros", + ], ) diff --git a/third-party/rust/crates/uuid/1.19.0/BUCK b/third-party/rust/crates/uuid/1.19.0/BUCK index a978edb0..132f8c48 100644 --- a/third-party/rust/crates/uuid/1.19.0/BUCK +++ b/third-party/rust/crates/uuid/1.19.0/BUCK @@ -31,11 +31,11 @@ rust_library( "v4", ], rustc_flags = ["@$(location :uuid-manifest[env_flags])"], - deps = ["//third-party/rust/crates/serde_core/1.0.228:serde_core"] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], - "config//os:macos": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], - "config//os:windows": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], - }), + os_deps = { + "linux": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], + "macos": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], + "windows": ["//third-party/rust/crates/getrandom/0.3.4:getrandom"], + }, visibility = ["PUBLIC"], + deps = ["//third-party/rust/crates/serde_core/1.0.228:serde_core"], ) diff --git a/third-party/rust/crates/windows-sys/0.59.0/BUCK b/third-party/rust/crates/windows-sys/0.59.0/BUCK deleted file mode 100644 index 438d8ede..00000000 --- a/third-party/rust/crates/windows-sys/0.59.0/BUCK +++ /dev/null @@ -1,36 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows-sys-vendor", - urls = ["https://static.crates.io/crates/windows-sys/windows-sys-0.59.0.crate"], - sha256 = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b", - type = "tar.gz", - strip_prefix = "windows-sys-0.59.0", - out = "vendor", -) - -cargo_manifest( - name = "windows-sys-manifest", - vendor = ":windows-sys-vendor", -) - -rust_library( - name = "windows-sys", - srcs = [":windows-sys-vendor"], - crate = "windows_sys", - crate_root = "vendor/src/lib.rs", - edition = "2021", - features = [ - "Win32", - "Win32_Foundation", - "Win32_System", - "Win32_System_Console", - "default", - ], - rustc_flags = ["@$(location :windows-sys-manifest[env_flags])"], - visibility = ["PUBLIC"], - deps = ["//third-party/rust/crates/windows-targets/0.52.6:windows-targets"], -) diff --git a/third-party/rust/crates/windows-targets/0.48.5/BUCK b/third-party/rust/crates/windows-targets/0.48.5/BUCK index 7a86579a..56d681d4 100644 --- a/third-party/rust/crates/windows-targets/0.48.5/BUCK +++ b/third-party/rust/crates/windows-targets/0.48.5/BUCK @@ -24,14 +24,14 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2018", rustc_flags = ["@$(location :windows-targets-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/windows_x86_64_gnu/0.48.5:windows_x86_64_gnu"], + "windows": ["//third-party/rust/crates/windows_x86_64_msvc/0.48.5:windows_x86_64_msvc"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/windows_aarch64_msvc/0.48.5:windows_aarch64_msvc", "//third-party/rust/crates/windows_i686_gnu/0.48.5:windows_i686_gnu", "//third-party/rust/crates/windows_i686_msvc/0.48.5:windows_i686_msvc", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/windows_x86_64_gnu/0.48.5:windows_x86_64_gnu"], - "config//os:windows": ["//third-party/rust/crates/windows_x86_64_msvc/0.48.5:windows_x86_64_msvc"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/windows-targets/0.52.6/BUCK b/third-party/rust/crates/windows-targets/0.52.6/BUCK deleted file mode 100644 index d9ef69e0..00000000 --- a/third-party/rust/crates/windows-targets/0.52.6/BUCK +++ /dev/null @@ -1,29 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows-targets-vendor", - urls = ["https://static.crates.io/crates/windows-targets/windows-targets-0.52.6.crate"], - sha256 = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973", - type = "tar.gz", - strip_prefix = "windows-targets-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows-targets-manifest", - vendor = ":windows-targets-vendor", -) - -rust_library( - name = "windows-targets", - srcs = [":windows-targets-vendor"], - crate = "windows_targets", - crate_root = "vendor/src/lib.rs", - edition = "2021", - rustc_flags = ["@$(location :windows-targets-manifest[env_flags])"], - visibility = ["PUBLIC"], - deps = ["//third-party/rust/crates/windows_x86_64_gnu/0.52.6:windows_x86_64_gnu"], -) diff --git a/third-party/rust/crates/windows-targets/0.53.5/BUCK b/third-party/rust/crates/windows-targets/0.53.5/BUCK index 66bd71b1..ba61a998 100644 --- a/third-party/rust/crates/windows-targets/0.53.5/BUCK +++ b/third-party/rust/crates/windows-targets/0.53.5/BUCK @@ -24,15 +24,15 @@ rust_library( crate_root = "vendor/src/lib.rs", edition = "2021", rustc_flags = ["@$(location :windows-targets-manifest[env_flags])"], + os_deps = { + "linux": ["//third-party/rust/crates/windows_x86_64_gnu/0.53.1:windows_x86_64_gnu"], + "windows": ["//third-party/rust/crates/windows_x86_64_msvc/0.53.1:windows_x86_64_msvc"], + }, + visibility = ["PUBLIC"], deps = [ "//third-party/rust/crates/windows-link/0.2.1:windows-link", "//third-party/rust/crates/windows_aarch64_msvc/0.53.1:windows_aarch64_msvc", "//third-party/rust/crates/windows_i686_gnu/0.53.1:windows_i686_gnu", "//third-party/rust/crates/windows_i686_msvc/0.53.1:windows_i686_msvc", - ] + select({ - "DEFAULT": [], - "config//os:linux": ["//third-party/rust/crates/windows_x86_64_gnu/0.53.1:windows_x86_64_gnu"], - "config//os:windows": ["//third-party/rust/crates/windows_x86_64_msvc/0.53.1:windows_x86_64_msvc"], - }), - visibility = ["PUBLIC"], + ], ) diff --git a/third-party/rust/crates/windows_aarch64_gnullvm/0.52.6/BUCK b/third-party/rust/crates/windows_aarch64_gnullvm/0.52.6/BUCK deleted file mode 100644 index 45e21692..00000000 --- a/third-party/rust/crates/windows_aarch64_gnullvm/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_aarch64_gnullvm-vendor", - urls = ["https://static.crates.io/crates/windows_aarch64_gnullvm/windows_aarch64_gnullvm-0.52.6.crate"], - sha256 = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3", - type = "tar.gz", - strip_prefix = "windows_aarch64_gnullvm-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_aarch64_gnullvm-manifest", - vendor = ":windows_aarch64_gnullvm-vendor", -) - -rust_library( - name = "windows_aarch64_gnullvm", - srcs = [":windows_aarch64_gnullvm-vendor"], - crate = "windows_aarch64_gnullvm", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_aarch64_gnullvm-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_aarch64_gnullvm-build-script-run[rustc_flags])", - "@$(location :windows_aarch64_gnullvm-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_aarch64_gnullvm-build-script-build", - srcs = [":windows_aarch64_gnullvm-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_aarch64_gnullvm-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_aarch64_gnullvm-build-script-run", - package_name = "windows_aarch64_gnullvm", - buildscript_rule = ":windows_aarch64_gnullvm-build-script-build", - env_srcs = [":windows_aarch64_gnullvm-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_aarch64_gnullvm-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_aarch64_msvc/0.52.6/BUCK b/third-party/rust/crates/windows_aarch64_msvc/0.52.6/BUCK deleted file mode 100644 index 66392f07..00000000 --- a/third-party/rust/crates/windows_aarch64_msvc/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_aarch64_msvc-vendor", - urls = ["https://static.crates.io/crates/windows_aarch64_msvc/windows_aarch64_msvc-0.52.6.crate"], - sha256 = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469", - type = "tar.gz", - strip_prefix = "windows_aarch64_msvc-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_aarch64_msvc-manifest", - vendor = ":windows_aarch64_msvc-vendor", -) - -rust_library( - name = "windows_aarch64_msvc", - srcs = [":windows_aarch64_msvc-vendor"], - crate = "windows_aarch64_msvc", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_aarch64_msvc-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_aarch64_msvc-build-script-run[rustc_flags])", - "@$(location :windows_aarch64_msvc-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_aarch64_msvc-build-script-build", - srcs = [":windows_aarch64_msvc-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_aarch64_msvc-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_aarch64_msvc-build-script-run", - package_name = "windows_aarch64_msvc", - buildscript_rule = ":windows_aarch64_msvc-build-script-build", - env_srcs = [":windows_aarch64_msvc-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_aarch64_msvc-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_i686_gnu/0.52.6/BUCK b/third-party/rust/crates/windows_i686_gnu/0.52.6/BUCK deleted file mode 100644 index f51a5d72..00000000 --- a/third-party/rust/crates/windows_i686_gnu/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_i686_gnu-vendor", - urls = ["https://static.crates.io/crates/windows_i686_gnu/windows_i686_gnu-0.52.6.crate"], - sha256 = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b", - type = "tar.gz", - strip_prefix = "windows_i686_gnu-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_i686_gnu-manifest", - vendor = ":windows_i686_gnu-vendor", -) - -rust_library( - name = "windows_i686_gnu", - srcs = [":windows_i686_gnu-vendor"], - crate = "windows_i686_gnu", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_i686_gnu-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_i686_gnu-build-script-run[rustc_flags])", - "@$(location :windows_i686_gnu-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_i686_gnu-build-script-build", - srcs = [":windows_i686_gnu-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_i686_gnu-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_i686_gnu-build-script-run", - package_name = "windows_i686_gnu", - buildscript_rule = ":windows_i686_gnu-build-script-build", - env_srcs = [":windows_i686_gnu-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_i686_gnu-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_i686_gnullvm/0.52.6/BUCK b/third-party/rust/crates/windows_i686_gnullvm/0.52.6/BUCK deleted file mode 100644 index 3841cce8..00000000 --- a/third-party/rust/crates/windows_i686_gnullvm/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_i686_gnullvm-vendor", - urls = ["https://static.crates.io/crates/windows_i686_gnullvm/windows_i686_gnullvm-0.52.6.crate"], - sha256 = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66", - type = "tar.gz", - strip_prefix = "windows_i686_gnullvm-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_i686_gnullvm-manifest", - vendor = ":windows_i686_gnullvm-vendor", -) - -rust_library( - name = "windows_i686_gnullvm", - srcs = [":windows_i686_gnullvm-vendor"], - crate = "windows_i686_gnullvm", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_i686_gnullvm-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_i686_gnullvm-build-script-run[rustc_flags])", - "@$(location :windows_i686_gnullvm-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_i686_gnullvm-build-script-build", - srcs = [":windows_i686_gnullvm-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_i686_gnullvm-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_i686_gnullvm-build-script-run", - package_name = "windows_i686_gnullvm", - buildscript_rule = ":windows_i686_gnullvm-build-script-build", - env_srcs = [":windows_i686_gnullvm-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_i686_gnullvm-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_i686_msvc/0.52.6/BUCK b/third-party/rust/crates/windows_i686_msvc/0.52.6/BUCK deleted file mode 100644 index f5d176ed..00000000 --- a/third-party/rust/crates/windows_i686_msvc/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_i686_msvc-vendor", - urls = ["https://static.crates.io/crates/windows_i686_msvc/windows_i686_msvc-0.52.6.crate"], - sha256 = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66", - type = "tar.gz", - strip_prefix = "windows_i686_msvc-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_i686_msvc-manifest", - vendor = ":windows_i686_msvc-vendor", -) - -rust_library( - name = "windows_i686_msvc", - srcs = [":windows_i686_msvc-vendor"], - crate = "windows_i686_msvc", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_i686_msvc-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_i686_msvc-build-script-run[rustc_flags])", - "@$(location :windows_i686_msvc-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_i686_msvc-build-script-build", - srcs = [":windows_i686_msvc-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_i686_msvc-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_i686_msvc-build-script-run", - package_name = "windows_i686_msvc", - buildscript_rule = ":windows_i686_msvc-build-script-build", - env_srcs = [":windows_i686_msvc-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_i686_msvc-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_x86_64_gnu/0.52.6/BUCK b/third-party/rust/crates/windows_x86_64_gnu/0.52.6/BUCK deleted file mode 100644 index ba592deb..00000000 --- a/third-party/rust/crates/windows_x86_64_gnu/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_x86_64_gnu-vendor", - urls = ["https://static.crates.io/crates/windows_x86_64_gnu/windows_x86_64_gnu-0.52.6.crate"], - sha256 = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78", - type = "tar.gz", - strip_prefix = "windows_x86_64_gnu-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_x86_64_gnu-manifest", - vendor = ":windows_x86_64_gnu-vendor", -) - -rust_library( - name = "windows_x86_64_gnu", - srcs = [":windows_x86_64_gnu-vendor"], - crate = "windows_x86_64_gnu", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_x86_64_gnu-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_x86_64_gnu-build-script-run[rustc_flags])", - "@$(location :windows_x86_64_gnu-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_x86_64_gnu-build-script-build", - srcs = [":windows_x86_64_gnu-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_x86_64_gnu-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_x86_64_gnu-build-script-run", - package_name = "windows_x86_64_gnu", - buildscript_rule = ":windows_x86_64_gnu-build-script-build", - env_srcs = [":windows_x86_64_gnu-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_x86_64_gnu-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_x86_64_gnullvm/0.52.6/BUCK b/third-party/rust/crates/windows_x86_64_gnullvm/0.52.6/BUCK deleted file mode 100644 index 2bc875c6..00000000 --- a/third-party/rust/crates/windows_x86_64_gnullvm/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_x86_64_gnullvm-vendor", - urls = ["https://static.crates.io/crates/windows_x86_64_gnullvm/windows_x86_64_gnullvm-0.52.6.crate"], - sha256 = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d", - type = "tar.gz", - strip_prefix = "windows_x86_64_gnullvm-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_x86_64_gnullvm-manifest", - vendor = ":windows_x86_64_gnullvm-vendor", -) - -rust_library( - name = "windows_x86_64_gnullvm", - srcs = [":windows_x86_64_gnullvm-vendor"], - crate = "windows_x86_64_gnullvm", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_x86_64_gnullvm-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_x86_64_gnullvm-build-script-run[rustc_flags])", - "@$(location :windows_x86_64_gnullvm-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_x86_64_gnullvm-build-script-build", - srcs = [":windows_x86_64_gnullvm-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_x86_64_gnullvm-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_x86_64_gnullvm-build-script-run", - package_name = "windows_x86_64_gnullvm", - buildscript_rule = ":windows_x86_64_gnullvm-build-script-build", - env_srcs = [":windows_x86_64_gnullvm-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_x86_64_gnullvm-vendor", - visibility = ["PUBLIC"], -) diff --git a/third-party/rust/crates/windows_x86_64_msvc/0.52.6/BUCK b/third-party/rust/crates/windows_x86_64_msvc/0.52.6/BUCK deleted file mode 100644 index 56e9f24e..00000000 --- a/third-party/rust/crates/windows_x86_64_msvc/0.52.6/BUCK +++ /dev/null @@ -1,54 +0,0 @@ -# @generated by `cargo buckal` - -load("@buckal//:cargo_manifest.bzl", "cargo_manifest") -load("@buckal//:wrapper.bzl", "buildscript_run", "rust_binary", "rust_library") - -http_archive( - name = "windows_x86_64_msvc-vendor", - urls = ["https://static.crates.io/crates/windows_x86_64_msvc/windows_x86_64_msvc-0.52.6.crate"], - sha256 = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec", - type = "tar.gz", - strip_prefix = "windows_x86_64_msvc-0.52.6", - out = "vendor", -) - -cargo_manifest( - name = "windows_x86_64_msvc-manifest", - vendor = ":windows_x86_64_msvc-vendor", -) - -rust_library( - name = "windows_x86_64_msvc", - srcs = [":windows_x86_64_msvc-vendor"], - crate = "windows_x86_64_msvc", - crate_root = "vendor/src/lib.rs", - edition = "2021", - env = { - "OUT_DIR": "$(location :windows_x86_64_msvc-build-script-run[out_dir])", - }, - rustc_flags = [ - "@$(location :windows_x86_64_msvc-build-script-run[rustc_flags])", - "@$(location :windows_x86_64_msvc-manifest[env_flags])", - ], - visibility = ["PUBLIC"], -) - -rust_binary( - name = "windows_x86_64_msvc-build-script-build", - srcs = [":windows_x86_64_msvc-vendor"], - crate = "build_script_build", - crate_root = "vendor/build.rs", - edition = "2021", - rustc_flags = ["@$(location :windows_x86_64_msvc-manifest[env_flags])"], - visibility = [], -) - -buildscript_run( - name = "windows_x86_64_msvc-build-script-run", - package_name = "windows_x86_64_msvc", - buildscript_rule = ":windows_x86_64_msvc-build-script-build", - env_srcs = [":windows_x86_64_msvc-manifest[env_dict]"], - version = "0.52.6", - manifest_dir = ":windows_x86_64_msvc-vendor", - visibility = ["PUBLIC"], -) diff --git a/toolchains/BUCK b/toolchains/BUCK index b9e8c2f2..f31a45e3 100644 --- a/toolchains/BUCK +++ b/toolchains/BUCK @@ -1,43 +1,21 @@ +# @generated by `cargo buckal` + +load("@//cxx:demo_cxx.bzl", "system_demo_cxx_toolchain") load("@prelude//tests:test_toolchain.bzl", "noop_test_toolchain") -load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain") load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain") -load("@prelude//toolchains:go.bzl", "system_go_bootstrap_toolchain", "system_go_toolchain") -load("@prelude//toolchains:haskell.bzl", "system_haskell_toolchain") -load("@prelude//toolchains:ocaml.bzl", "system_ocaml_toolchain") -load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain", "system_python_toolchain") -load("@prelude//toolchains:remote_test_execution.bzl", "remote_test_execution_toolchain") -load("@prelude//toolchains:rust.bzl", "system_rust_toolchain") - -oncall("open_source") - -system_cxx_toolchain( - name = "cxx", - cxx_flags = ["-std=c++20"], - visibility = ["PUBLIC"], -) - -system_genrule_toolchain( - name = "genrule", - visibility = ["PUBLIC"], -) - -system_go_toolchain( - name = "go", - visibility = ["PUBLIC"], -) - -system_go_bootstrap_toolchain( - name = "go_bootstrap", - visibility = ["PUBLIC"], +load( + "@prelude//toolchains:python.bzl", + "system_python_bootstrap_toolchain", + "system_python_toolchain", ) +load("@prelude//toolchains:remote_test_execution.bzl", "remote_test_execution_toolchain") +load("@//rust:demo_rust.bzl", "system_demo_rust_toolchain") -system_haskell_toolchain( - name = "haskell", - visibility = ["PUBLIC"], -) +system_demo_cxx_toolchain() +system_demo_rust_toolchain() -system_ocaml_toolchain( - name = "ocaml", +system_python_bootstrap_toolchain( + name = "python_bootstrap", visibility = ["PUBLIC"], ) @@ -46,14 +24,13 @@ system_python_toolchain( visibility = ["PUBLIC"], ) -system_python_bootstrap_toolchain( - name = "python_bootstrap", +system_genrule_toolchain( + name = "genrule", visibility = ["PUBLIC"], ) -system_rust_toolchain( - name = "rust", - default_edition = "2024", +noop_test_toolchain( + name = "test", visibility = ["PUBLIC"], ) @@ -61,8 +38,3 @@ remote_test_execution_toolchain( name = "remote_test_execution", visibility = ["PUBLIC"], ) - -noop_test_toolchain( - name = "test", - visibility = ["PUBLIC"], -) \ No newline at end of file diff --git a/toolchains/cxx/demo_cxx.bzl b/toolchains/cxx/demo_cxx.bzl new file mode 100644 index 00000000..09fb75c2 --- /dev/null +++ b/toolchains/cxx/demo_cxx.bzl @@ -0,0 +1,40 @@ +# @generated by `cargo buckal` + +load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain") + +def system_demo_cxx_toolchain(): + # We override the demo toolchains so we can avoid forcing `-fuse-ld=lld`. + # The bundled demo cxx toolchain uses clang++ and adds `-fuse-ld=lld` on Linux, + # but some environments don't have lld installed. + system_cxx_toolchain( + name = "cxx", + compiler = select({ + "prelude//os/constraints:linux": "gcc", + "prelude//os/constraints:macos": "clang", + "prelude//os/constraints:windows": "cl.exe", + "DEFAULT": "cc", + }), + # Keep `g++` as the C++ compiler on Linux so the prelude doesn't inject + # `-fuse-ld=lld` (lld isn't guaranteed to exist). Other OSes use their + # native compilers. + cxx_compiler = select({ + "prelude//os/constraints:linux": "g++", + "prelude//os/constraints:macos": "clang++", + "prelude//os/constraints:windows": "cl.exe", + "DEFAULT": "c++", + }), + linker = select({ + "prelude//os/constraints:linux": "g++", + "prelude//os/constraints:macos": "clang++", + "prelude//os/constraints:windows": "link.exe", + "DEFAULT": "c++", + }), + # Buck prelude's system C++ toolchain injects `-fuse-ld=lld` into the + # linker wrapper. Some environments don't ship `ld.lld`, + # so append `-fuse-ld=bfd` to override it for Linux targets. + link_flags = select({ + "prelude//os/constraints:linux": ["-fuse-ld=bfd"], + "DEFAULT": [], + }), + visibility = ["PUBLIC"], + ) diff --git a/toolchains/cxx/tools/g++-x86_64-gnu-sysroot.bat b/toolchains/cxx/tools/g++-x86_64-gnu-sysroot.bat new file mode 100644 index 00000000..c8c2cf8a --- /dev/null +++ b/toolchains/cxx/tools/g++-x86_64-gnu-sysroot.bat @@ -0,0 +1,54 @@ +:: @generated by `cargo buckal` +@echo off +setlocal EnableExtensions EnableDelayedExpansion + +rem Add Rust's GNU sysroot "self-contained" libs to the search path. +rem This provides libgcc_eh.a (and friends) even when the system MinGW is incomplete. + +set "NEED_SELF_CONTAINED=" +for %%L in (libpthread.a libgcc_eh.a) do ( + set "FOUND=" + for /f "delims=" %%I in ('g++ -print-file-name=%%L 2^>nul') do set "FOUND=%%I" + if not defined FOUND set "FOUND=%%L" + if /I "!FOUND!"=="%%L" ( + set "NEED_SELF_CONTAINED=1" + ) +) + +if not defined NEED_SELF_CONTAINED ( + g++ %* + set "STATUS=!ERRORLEVEL!" + exit /b %STATUS% +) + +set "RUSTC_FROM_ENV=" +if defined RUSTC ( + set "RUSTC_FROM_ENV=1" + set "RUSTC_CMD=%RUSTC%" +) else ( + set "RUSTC_CMD=rustc" +) + +for /f "delims=" %%I in ('"%RUSTC_CMD%" --print sysroot') do set "SYSROOT=%%I" + +set "TRIED_STABLE=" +if not defined SYSROOT if not defined RUSTC_FROM_ENV ( + for /f "delims=" %%I in ('rustc +stable-x86_64-pc-windows-gnu --print sysroot') do set "SYSROOT=%%I" + set "TRIED_STABLE=1" +) + +set "SELF_CONTAINED=%SYSROOT%\lib\rustlib\x86_64-pc-windows-gnu\lib\self-contained" +if not exist "%SELF_CONTAINED%" if not defined RUSTC_FROM_ENV if not defined TRIED_STABLE ( + for /f "delims=" %%I in ('rustc +stable-x86_64-pc-windows-gnu --print sysroot') do set "SYSROOT=%%I" + set "TRIED_STABLE=1" + set "SELF_CONTAINED=%SYSROOT%\lib\rustlib\x86_64-pc-windows-gnu\lib\self-contained" +) + +if not exist "%SELF_CONTAINED%" ( + echo g++-x86_64-gnu-sysroot.bat: self-contained dir not found: "%SELF_CONTAINED%" 1>&2 + exit /b 1 +) + +g++ -L"%SELF_CONTAINED%" %* +set "STATUS=!ERRORLEVEL!" +exit /b %STATUS% diff --git a/toolchains/cxx/tools/lld-link-aarch64.bat b/toolchains/cxx/tools/lld-link-aarch64.bat new file mode 100644 index 00000000..74f8e2f3 --- /dev/null +++ b/toolchains/cxx/tools/lld-link-aarch64.bat @@ -0,0 +1,4 @@ +:: @generated by `cargo buckal` +@echo off +setlocal +python.exe "%~dp0lld_link.py" --machine ARM64 %* diff --git a/toolchains/cxx/tools/lld-link-i686.bat b/toolchains/cxx/tools/lld-link-i686.bat new file mode 100644 index 00000000..ff32270b --- /dev/null +++ b/toolchains/cxx/tools/lld-link-i686.bat @@ -0,0 +1,4 @@ +:: @generated by `cargo buckal` +@echo off +setlocal +python.exe "%~dp0lld_link.py" --machine X86 %* diff --git a/toolchains/cxx/tools/lld_link.py b/toolchains/cxx/tools/lld_link.py new file mode 100644 index 00000000..2c3523c8 --- /dev/null +++ b/toolchains/cxx/tools/lld_link.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +# @generated by `cargo buckal` +# Used as the generic Windows fallback linker wrapper; architecture-specific +# launchers like lld-link-x86_64.bat forward to this script with --machine set. +from __future__ import annotations + +import subprocess +import sys +from pathlib import Path + + +def _check_output(cmd: list[str]) -> str: + try: + return subprocess.check_output(cmd, text=True, stderr=subprocess.STDOUT) + except FileNotFoundError as exc: + raise SystemExit(f"lld_link.py: failed to execute {cmd[0]!r}: {exc}") from exc + except subprocess.CalledProcessError as exc: + out = (exc.output or "").strip() + msg = f"lld_link.py: command failed: {' '.join(cmd)}" + if out: + msg += f"\n{out}" + raise SystemExit(msg) from exc + + +def _rust_sysroot() -> Path: + sysroot = _check_output(["rustc", "--print", "sysroot"]).strip() + if not sysroot: + raise SystemExit("lld_link.py: rustc --print sysroot returned empty output") + return Path(sysroot) + + +def _rust_host_triple() -> str: + out = _check_output(["rustc", "-vV"]) + for line in out.splitlines(): + if line.startswith("host:"): + return line.split(":", 1)[1].strip() + raise SystemExit("lld_link.py: failed to determine Rust host triple via rustc -vV") + + +def _find_lld_link(sysroot: Path, host_triple: str) -> Path: + candidates = [ + sysroot / "lib" / "rustlib" / host_triple / "bin" / "gcc-ld" / "lld-link.exe", + sysroot / "bin" / "rust-lld.exe", + ] + for candidate in candidates: + if candidate.exists(): + return candidate + formatted = "\n - ".join(str(path) for path in candidates) + raise SystemExit( + "lld_link.py: lld-link executable not found under " + f"{sysroot!s}\n - {formatted}" + ) + + +def _has_machine_flag(args: list[str]) -> bool: + for arg in args: + lowered = arg.lower() + if lowered.startswith("/machine:") or lowered.startswith("-machine:"): + return True + return False + + +def _parse_machine(args: list[str]) -> tuple[str, list[str]]: + machine = "" + remaining: list[str] = [] + i = 0 + while i < len(args): + arg = args[i] + if arg == "--machine": + if i + 1 >= len(args): + raise SystemExit("lld_link.py: --machine requires a value") + if machine: + raise SystemExit("lld_link.py: --machine specified multiple times") + machine = args[i + 1].strip().upper() + if not machine: + raise SystemExit("lld_link.py: --machine requires a non-empty value") + i += 2 + continue + if arg.startswith("--machine="): + if machine: + raise SystemExit("lld_link.py: --machine specified multiple times") + machine = arg.split("=", 1)[1].strip().upper() + if not machine: + raise SystemExit("lld_link.py: --machine requires a non-empty value") + i += 1 + continue + remaining.append(arg) + i += 1 + return machine, remaining + + +def main() -> int: + argv = sys.argv[1:] + machine, argv = _parse_machine(argv) + + sysroot = _rust_sysroot() + host_triple = _rust_host_triple() + lld_link = _find_lld_link(sysroot, host_triple) + + cmd = [str(lld_link)] + if machine and not _has_machine_flag(argv): + cmd.append(f"/machine:{machine}") + cmd.extend(argv) + + try: + return subprocess.call(cmd) + except OSError as exc: + raise SystemExit(f"lld_link.py: failed to execute {lld_link!s}: {exc}") from exc + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/toolchains/rust/demo_rust.bzl b/toolchains/rust/demo_rust.bzl new file mode 100644 index 00000000..00292d94 --- /dev/null +++ b/toolchains/rust/demo_rust.bzl @@ -0,0 +1,18 @@ +# @generated by `cargo buckal` + +load("@prelude//toolchains:rust.bzl", "system_rust_toolchain") + +def system_demo_rust_toolchain(): + # Buck prelude only maps a small set of CPU constraints to Rust triples by + # default. We provide an explicit mapping so `--target-platforms` works. + system_rust_toolchain( + name = "rust", + rustc_target_triple = select({ + "prelude//os/constraints:linux": "x86_64-unknown-linux-gnu", + "prelude//os/constraints:macos": "aarch64-apple-darwin", + "prelude//os/constraints:windows": "x86_64-pc-windows-msvc", + "DEFAULT": "x86_64-unknown-linux-gnu", + }), + default_edition = "2021", + visibility = ["PUBLIC"], + )