BUCKannotatedBUCKsource31 lines · 1.7 KB · raw
1load("@prelude//toolchains:rust.bzl", "system_rust_toolchain")
2load("@prelude//toolchains:cxx.bzl", "system_cxx_toolchain")
3load("@prelude//toolchains:python.bzl", "system_python_bootstrap_toolchain")
4load("@prelude//toolchains:genrule.bzl", "system_genrule_toolchain")
5
6system_rust_toolchain(
7    name = "rust",
8    default_edition = "2024",
9    # The prelude's default is rustc's: opt-level 0. A cycle-accurate SNES core
10    # at opt-level 0 runs BELOW real time (measured 2026-09-20: 24-31 fps on
11    # A Link to the Past, against the console's 60), so an unoptimised build of
12    # this project is not a slower build of the same thing - the game cannot be
13    # played in it. Upstream says the same in its Cargo.toml ("most of the
14    # emulators are unusably slow without optimizations"). Debuginfo stays on:
15    # it costs nothing at run time and keeps backtraces readable.
16    rustc_flags = ["-Copt-level=3", "-Cdebuginfo=1"],
17    visibility = ["PUBLIC"],
18)
19system_cxx_toolchain(name = "cxx", visibility = ["PUBLIC"])
20system_python_bootstrap_toolchain(name = "python_bootstrap", visibility = ["PUBLIC"])
21system_genrule_toolchain(name = "genrule", visibility = ["PUBLIC"])
22
23# `rust_test` asks for both. Tests here are plain binaries run where they are
24# built, so neither has anything to configure. The prelude ships a no-op for
25# the first and not for the second; `local_test_execution.bzl` is the same one
26# mobo uses.
27load("@prelude//tests:test_toolchain.bzl", "noop_test_toolchain")
28load(":local_test_execution.bzl", "local_remote_test_execution_toolchain")
29
30noop_test_toolchain(name = "test", visibility = ["PUBLIC"])
31local_remote_test_execution_toolchain(name = "remote_test_execution", visibility = ["PUBLIC"])