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