| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 1 | # The compilers, as build artifacts rather than things found on the machine. |
| 2 | # |
| 3 | # scripts/*.dotslash pins the same tarballs for humans; these fetch them into |
| 4 | # buck's own tree so that every action's inputs include the compiler that ran |
| 5 | # it. Two things follow. An action's cache digest now covers the toolchain, so |
| 6 | # a compiler change can no longer collide with the old entries — the failure |
| 7 | # that produced E0514 "please recompile that crate" against a shared cache. |
| 8 | # And a remote worker can materialise the tools, which is what remote |
| 9 | # execution needs and what a host path can never give it. |
| 10 | # |
| 11 | # Keep the versions and digests here equal to the ones in scripts/. |
| 12 | RUST_VERSION = "1.98.0" |
| 13 | RUST_DATE = "2026-08-20" |
| 14 | ZIG_VERSION = "0.16.0" |
| 15 | |
| 16 | _RUST_DIST = { |
| 17 | "x86_64-unknown-linux-gnu": "aa30409afa67bd1ada244cefd82c7980e6a65bc113bb978e934b2413c75e3900", |
| 18 | "aarch64-unknown-linux-gnu": "5fbb4282403046d52a4672765c6761a809bf9f33e699b17e6eb7a93ab7770cc3", |
| 19 | } |
| 20 | |
| 21 | _ZIG_DIST = { |
| 22 | "x86_64-linux": "70e49664a74374b48b51e6f3fdfbf437f6395d42509050588bd49abe52ba3d00", |
| 23 | "aarch64-linux": "ea4b09bfb22ec6f6c6ceac57ab63efb6b46e17ab08d21f69f3a48b38e1534f17", |
| 24 | } |
| 25 | |
| 26 | def rust_dist(name, triple): |
| 27 | """The whole Rust dist tarball: rustc, rustdoc, cargo and the std components.""" |
| 28 | native.http_archive( |
| 29 | name = name, |
| 30 | urls = ["https://static.rust-lang.org/dist/{}/rust-{}-{}.tar.gz".format( |
| 31 | RUST_DATE, |
| 32 | RUST_VERSION, |
| 33 | triple, |
| 34 | )], |
| 35 | sha256 = _RUST_DIST[triple], |
| 36 | strip_prefix = "rust-{}-{}".format(RUST_VERSION, triple), |
| 37 | type = "tar.gz", |
| 38 | visibility = ["PUBLIC"], |
| 39 | ) |
| 40 | |
| 41 | def zig_dist(name, triple): |
| 42 | """zig, which is the C and C++ compiler, the linker and the archiver.""" |
| 43 | native.http_archive( |
| 44 | name = name, |
| 45 | urls = ["https://ziglang.org/download/{}/zig-{}-{}.tar.xz".format( |
| 46 | ZIG_VERSION, |
| 47 | triple, |
| 48 | ZIG_VERSION, |
| 49 | )], |
| 50 | sha256 = _ZIG_DIST[triple], |
| 51 | strip_prefix = "zig-{}-{}".format(triple, ZIG_VERSION), |
| 52 | type = "tar.xz", |
| 53 | visibility = ["PUBLIC"], |
| 54 | ) |