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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain")
load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain")
load("@prelude//toolchains:rust.bzl", "system_rust_toolchain")
# Tools come from the DotSlash files in scripts/, so the build depends on
# pinned upstream releases rather than whatever the host happens to have. The
# prelude's system toolchains resolve their tools through PATH, so buck2 must
# be invoked with scripts/ prepended — see the `buck` recipe in justfile.
#
# This is the same arrangement .cargo/config.toml used to describe: zig cc
# carries its own glibc sysroot, which is why this repo builds on a machine
# with no `cc` at all. Unlike vidya there is no Android row here — both shared
# objects this repo ships are desktop, and the APK takes its libvidya from
# vidya's own buck2 build.
system_cxx_toolchain(
name = "cxx",
compiler = "scripts/zcc",
compiler_type = "clang",
cxx_compiler = "scripts/zxx",
linker = "scripts/zcc",
visibility = ["PUBLIC"],
)
system_genrule_toolchain(
name = "genrule",
visibility = ["PUBLIC"],
)
system_python_bootstrap_toolchain(
name = "python_bootstrap",
visibility = ["PUBLIC"],
)
system_rust_toolchain(
name = "rust",
default_edition = "2021",
rustc_flags = ["-Clinker=scripts/zcc"],
rustc_target_triple = select({
"prelude//os:linux": select({
"prelude//cpu:arm64": "aarch64-unknown-linux-gnu",
"prelude//cpu:x86_64": "x86_64-unknown-linux-gnu",
}),
"prelude//os:macos": select({
"prelude//cpu:arm64": "aarch64-apple-darwin",
"prelude//cpu:x86_64": "x86_64-apple-darwin",
}),
}),
visibility = ["PUBLIC"],
)
|