| 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 | # |
| Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago | 3 | # scripts/*.dotslash is where a tool's version and digest are written down, and |
| 4 | # it stays that way: generated.bzl beside this file is derived from those |
| 5 | # manifests by scripts/dotslash-to-buck, so there is one place to bump a |
| 6 | # version and no second copy of a digest to drift. |
| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 7 | # |
| Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago | 8 | # buck cannot use the shims themselves. DotSlash resolves a tool at run time, |
| 9 | # on the machine running it, against a cache in the user's home — so the tool |
| 10 | # is not an input to any action, is not in any action's cache digest, and is |
| 11 | # not something a remote worker can be handed. Fetching the identical archive |
| 12 | # by the identical digest is how buck gets those three properties without |
| 13 | # taking the pinning away from DotSlash. |
| 14 | load("//dist:generated.bzl", "DIST") |
| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 15 | |
| Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago | 16 | def _archive(name, tool, platform): |
| 17 | entry = DIST[tool][platform] |
| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 18 | native.http_archive( |
| 19 | name = name, |
| Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago | 20 | urls = [entry["url"]], |
| 21 | sha256 = entry["sha256"], |
| 22 | strip_prefix = entry["strip_prefix"], |
| 23 | type = entry["type"], |
| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 24 | visibility = ["PUBLIC"], |
| 25 | ) |
| 26 | |
| Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago | 27 | def rust_dist(name, platform): |
| 28 | """The Rust dist tarball: rustc, rustdoc and the std components.""" |
| 29 | _archive(name, "rust", platform) |
| 30 | |
| 31 | def zig_dist(name, platform): |
| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 32 | """zig, which is the C and C++ compiler, the linker and the archiver.""" |
| Fetch rustc the way buck can ship it, from what DotSlash already pins 8cf1b33 nandi 19d ago | 33 | _archive(name, "zig", platform) |