1# Sample TOML configuration file for building Rust.2#3# To configure bootstrap, run `./configure` or `./x.py setup`.4# See https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#create-a-bootstraptoml for more information.5#6# All options are commented out by default in this file, and they're commented7# out with their default values. The build system by default looks for8# `bootstrap.toml` in the current directory of a build for build configuration, but9# a custom configuration file can also be specified with `--config` to the build10# system.11#12# Note that the following are equivalent, for more details see <https://toml.io/en/v1.0.0>.13#14# build.verbose = 115#16# [build]17# verbose = 1181920# =============================================================================21# Global Settings22# =============================================================================2324# Use different pre-set defaults than the global defaults.25#26# See `src/bootstrap/defaults` for more information.27# Note that this has no default value (x.py uses the defaults in `bootstrap.example.toml`).28#profile = <none>2930# Inherits configuration values from different configuration files (a.k.a. config extensions).31# Supports absolute paths, and uses the current directory (where the bootstrap was invoked)32# as the base if the given path is not absolute.33#34# The overriding logic follows a right-to-left order. For example, in `include = ["a.toml", "b.toml"]`,35# extension `b.toml` overrides `a.toml`. Also, parent extensions always overrides the inner ones.36#include = []3738# Keeps track of major changes made to this configuration.39#40# This value also represents ID of the PR that caused major changes. Meaning,41# you can visit github.com/rust-lang/rust/pull/{change-id} to check for more details.42#43# A 'major change' includes any of the following44# - A new option45# - A change in the default values46#47# If the change-id does not match the version currently in use, x.py will48# display the changes made to the bootstrap.49# To suppress these warnings, you can set change-id = "ignore".50#change-id = <latest change id in src/bootstrap/src/utils/change_tracker.rs>5152# =============================================================================53# Tweaking how LLVM is compiled54# =============================================================================5556# Whether to use Rust CI built LLVM instead of locally building it.57#58# Unless you're developing for a target where Rust CI doesn't build a compiler59# toolchain or changing LLVM locally, you probably want to leave this enabled.60#61# Set this to `true` to download if CI llvm available otherwise it builds62# from `src/llvm-project`. If you set it to `true`, it's safe and time-saving to run63# `git submodule deinit src/llvm-project` to avoid git updating the llvm-project submodule64# when building compiler locally.65#66#67# Set this to `"if-unchanged"` to download only if the llvm-project has not68# been modified. You can also use this if you are unsure whether you're on a69# tier 1 target. All tier 1 targets are currently supported.7071# Currently, we only support this when building LLVM for the build triple.72#73# Note that many of the LLVM options are not currently supported for74# downloading. Currently only the "assertions" option can be toggled.75#llvm.download-ci-llvm = true7677# Indicates whether the LLVM build is a Release or Debug build78#llvm.optimize = true7980# Indicates whether LLVM should be built with ThinLTO. Note that this will81# only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++82# toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below).83# More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap84#llvm.thin-lto = false8586# Indicates whether an LLVM Release build should include debug info87#llvm.release-debuginfo = false8889# Indicates whether the LLVM assertions are enabled or not90# NOTE: When assertions are disabled, bugs in the integration between rustc and LLVM can lead to91# unsoundness (segfaults, etc.) in the rustc process itself, not just in the generated code.92#llvm.assertions = false9394# Indicates whether the LLVM testsuite is enabled in the build or not. Does95# not execute the tests as part of the build as part of x.py build et al,96# just makes it possible to do `ninja check-llvm` in the staged LLVM build97# directory when doing LLVM development as part of Rust development.98#llvm.tests = false99100# Indicates whether the LLVM plugin is enabled or not101#llvm.plugins = false102103# Whether to build Enzyme as AutoDiff backend.104#llvm.enzyme = false105106# Whether to build LLVM with support for it's gpu offload runtime.107#llvm.offload = false108109# Absolute path to the directory containing ClangConfig.cmake110#llvm.offload-clang-dir = ""111112# When true, link libstdc++ statically into the rustc_llvm.113# This is useful if you don't want to use the dynamic version of that114# library provided by LLVM.115#llvm.static-libstdcpp = false116117# Enable LLVM to use zstd for compression.118#llvm.libzstd = false119120# Whether to use Ninja to build LLVM. This runs much faster than make.121#llvm.ninja = true122123# LLVM targets to build support for.124# Note: this is NOT related to Rust compilation targets. However, as Rust is125# dependent on LLVM for code generation, turning targets off here WILL lead to126# the resulting rustc being unable to compile for the disabled architectures.127#128# To add support for new targets, see https://rustc-dev-guide.rust-lang.org/building/new-target.html.129#llvm.targets = "AArch64;AMDGPU;ARM;BPF;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86"130131# LLVM experimental targets to build support for. These targets are specified in132# the same format as above, but since these targets are experimental, they are133# not built by default and the experimental Rust compilation targets that depend134# on them will not work unless the user opts in to building them.135#llvm.experimental-targets = "AVR;M68k;CSKY"136137# Cap the number of parallel linker invocations when compiling LLVM.138# This can be useful when building LLVM with debug info, which significantly139# increases the size of binaries and consequently the memory required by140# each linker process.141# If set to 0, linker invocations are treated like any other job and142# controlled by bootstrap's -j parameter.143#llvm.link-jobs = 0144145# Whether to build LLVM as a dynamically linked library (as opposed to statically linked).146# Under the hood, this passes `--shared` to llvm-config.147# NOTE: To avoid performing LTO multiple times, we suggest setting this to `true` when `thin-lto` is enabled.148#llvm.link-shared = llvm.thin-lto149150# When building llvm, this configures what is being appended to the version.151# To use LLVM version as is, provide an empty string.152#llvm.version-suffix = if rust.channel == "dev" { "-rust-dev" } else { "-rust-$version-$channel" }153154# On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass155# with clang-cl, so this is special in that it only compiles LLVM with clang-cl.156# Note that this takes a /path/to/clang-cl, not a boolean.157#llvm.clang-cl = cc158159# Pass extra compiler and linker flags to the LLVM CMake build.160#llvm.cflags = ""161#llvm.cxxflags = ""162#llvm.ldflags = ""163164# Use libc++ when building LLVM instead of libstdc++. This is the default on165# platforms already use libc++ as the default C++ library, but this option166# allows you to use libc++ even on platforms when it's not. You need to ensure167# that your host compiler ships with libc++.168#llvm.use-libcxx = false169170# The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.171#llvm.use-linker = <none> (path)172173# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`174#llvm.allow-old-toolchain = false175176# Whether to include the Polly optimizer.177#llvm.polly = false178179# Whether to build the clang compiler.180#llvm.clang = false181182# Whether to enable llvm compilation warnings.183#llvm.enable-warnings = false184185# Custom CMake defines to set when building LLVM.186#llvm.build-config = {}187188# =============================================================================189# Tweaking how GCC is compiled190# =============================================================================191# Download GCC from CI instead of building it locally.192# Note that this will attempt to download GCC even if there are local193# modifications to the `src/gcc` submodule.194# Currently, this is only supported for the `x86_64-unknown-linux-gnu` target.195#gcc.download-ci-gcc = false196197# Provide a directory of prebuilt libgccjit.so dylibs for given (host, target) compilation pairs.198# This is useful when you want to cross-compile `rustc` to another target since GCC is not a199# multi-target compiler.200# You have to use a directory structure that looks like this:201# `<libgccjit-libs-dir>/<host>/<target>/libgccjit.so`.202# For example:203#204# ```205# <libgccjit-libs-dir>206# ├── m68k-unknown-linux-gnu207# │ └── m68k-unknown-linux-gnu208# │ └── libgccjit.so209# └── x86_64-unknown-linux-gnu210# ├── m68k-unknown-linux-gnu211# │ └── libgccjit.so212# └── x86_64-unknown-linux-gnu213# └── libgccjit.so214# ```215# The directory above would allow you to cross-compile rustc from x64 to m68k216#217# Note that this option has priority over `gcc.download-ci-gcc`.218# If you set both, bootstrap will first try to load libgccjit.so from this directory.219# Only if it isn't found, it will try to download it from CI or build it locally.220#gcc.libgccjit-libs-dir = "/path/to/libgccjit-libs-dir"221222# =============================================================================223# General build configuration options224# =============================================================================225226# The default stage to use for the `check` subcommand227#build.check-stage = 0228229# The default stage to use for the `doc` subcommand230#build.doc-stage = 0231232# The default stage to use for the `build` subcommand233#build.build-stage = 1234235# The default stage to use for the `test` subcommand236#build.test-stage = 1237238# The default stage to use for the `dist` subcommand239#build.dist-stage = 2240241# The default stage to use for the `install` subcommand242#build.install-stage = 2243244# The default stage to use for the `bench` subcommand245#build.bench-stage = 2246247# A descriptive string to be appended to version output (e.g., `rustc --version`),248# which is also used in places like debuginfo `DW_AT_producer`. This may be useful for249# supplementary build information, like distro-specific package versions.250#251# IMPORTANT: Changing this value changes crate IDs and symbol name mangling, making252# compiled artifacts incompatible. PGO profiles cannot be reused across different253# descriptions, and incremental compilation caches are invalidated. Keep this value254# consistent when reusing build artifacts.255#256# The Rust compiler will differentiate between versions of itself, including257# based on this string, which means that if you wish to be compatible with258# upstream Rust you need to set this to "". However, note that if you set this to "" but259# are not actually compatible -- for example if you've backported patches that change260# behavior -- this may lead to miscompilations or other bugs.261#build.description = ""262263# Build triple for the pre-compiled snapshot compiler. If `rustc` is set, this must match its host264# triple (see `rustc --version --verbose`; cross-compiling the rust build system itself is NOT265# supported). If `rustc` is unset, this must be a platform with pre-compiled host tools266# (https://doc.rust-lang.org/nightly/rustc/platform-support.html). The current platform must be267# able to run binaries of this build triple.268#269# If `rustc` is present in path, this defaults to the host it was compiled for.270# Otherwise, `x.py` will try to infer it from the output of `uname`.271# If `uname` is not found in PATH, we assume this is `x86_64-pc-windows-msvc`.272# This may be changed in the future.273#build.build = "x86_64-unknown-linux-gnu" (as an example)274275# Which triples to produce a compiler toolchain for. Each of these triples will be bootstrapped from276# the build triple themselves. In other words, this is the list of triples for which to build a277# compiler that can RUN on that triple.278#279# Defaults to just the `build` triple.280#build.host = [build.build] (list of triples)281282# Which triples to build libraries (core/alloc/std/test/proc_macro) for. Each of these triples will283# be bootstrapped from the build triple themselves. In other words, this is the list of triples for284# which to build a library that can CROSS-COMPILE to that triple.285#286# Defaults to `host`. If you set this explicitly, you likely want to add all287# host triples to this list as well in order for those host toolchains to be288# able to compile programs for their native target.289#build.target = build.host (list of triples)290291# Use this directory to store build artifacts. Paths are relative to the current directory, not to292# the root of the repository.293#build.build-dir = "build"294295# Instead of downloading the src/stage0 version of Cargo specified, use296# this Cargo binary instead to build all Rust code297# If you set this, you likely want to set `rustc` as well.298#build.cargo = "/path/to/cargo"299300# Instead of downloading the src/stage0 version of the compiler301# specified, use this rustc binary instead as the stage0 snapshot compiler.302# If you set this, you likely want to set `cargo` as well.303#build.rustc = "/path/to/rustc"304305# Use this rustdoc binary as the stage0 snapshot rustdoc.306# If unspecified, then the binary "rustdoc" (with platform-specific extension, e.g. ".exe")307# in the same directory as "rustc" will be used.308#build.rustdoc = "/path/to/rustdoc"309310# Instead of downloading the src/stage0 version of rustfmt specified,311# use this rustfmt binary instead as the stage0 snapshot rustfmt.312#build.rustfmt = "/path/to/rustfmt"313314# Instead of downloading the src/stage0 version of cargo-clippy specified,315# use this cargo-clippy binary instead as the stage0 snapshot cargo-clippy.316#317# Note that this option should be used with the same toolchain as the `rustc` option above.318# Otherwise, clippy is likely to fail due to a toolchain conflict.319#build.cargo-clippy = "/path/to/cargo-clippy"320321# Whether to build documentation by default. If false, rustdoc and322# friends will still be compiled but they will not be used to generate any323# documentation.324#325# You can still build documentation when this is disabled by explicitly passing paths,326# e.g. `x doc library`.327#build.docs = true328329# Flag to specify whether CSS, JavaScript, and HTML are minified when330# docs are generated. JSON is always minified, because it's enormous,331# and generated in already-minified form from the beginning.332#build.docs-minification = true333334# Flag to specify whether private items should be included in the library docs.335#build.library-docs-private-items = false336337# Indicate whether to build compiler documentation by default.338# You can still build documentation when this is disabled by explicitly passing a path: `x doc compiler`.339#build.compiler-docs = false340341# Indicate whether git submodules are managed and updated automatically.342#build.submodules = true343344# The path to (or name of) the GDB executable to use. This is only used for345# executing the debuginfo test suite.346#build.gdb = "gdb"347348# The path to (or name of) the LLDB executable to use. This is only used for349# executing the debuginfo test suite.350#build.lldb = "lldb"351352# The node.js executable to use. Note that this is only used for the emscripten353# target when running tests, otherwise this can be omitted.354#build.nodejs = "node"355356# The yarn executable to use. Note that this is used for rustdoc-gui tests and357# tidy js extra-checks, otherwise this can be omitted.358#359# Under Windows this should be `yarn.cmd` or path to it (verified on nodejs v18.06), or360# error will be emitted.361#build.yarn = "yarn"362363# Python interpreter to use for various tasks throughout the build, notably364# rustdoc tests, and some dist bits and pieces.365#366# Defaults to the Python interpreter used to execute x.py.367#build.python = "python"368369# The path to (or name of) the resource compiler executable to use on Windows.370#build.windows-rc = "rc.exe"371372# The path to the REUSE executable to use. Note that REUSE is not required in373# most cases, as our tooling relies on a cached (and shrunk) copy of the374# REUSE output present in the git repository and in our source tarballs.375#376# REUSE is only needed if your changes caused the overall licensing of the377# repository to change, and the cached copy has to be regenerated.378#379# Defaults to the "reuse" command in the system path.380#build.reuse = "reuse"381382# Force Cargo to check that Cargo.lock describes the precise dependency383# set that all the Cargo.toml files create, instead of updating it.384#build.locked-deps = false385386# Indicate whether the vendored sources are used for Rust dependencies or not.387#388# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you389# want to use vendoring. See https://forge.rust-lang.org/infra/other-installation-methods.html#source-code.390#build.vendor = if "is a tarball source" && "vendor" dir exists && ".cargo/config.toml" file exists { true } else { false }391392# If you build the compiler more than twice (stage3+) or the standard library more than once393# (stage 2+), the third compiler and second library will get uplifted from stage2 and stage1,394# respectively. If you would like to disable this uplifting, and rather perform a full bootstrap,395# then you can set this option to true.396#397# This is only useful for verifying that rustc generates reproducible builds.398#build.full-bootstrap = false399400# Set the bootstrap/download cache path. It is useful when building rust401# repeatedly in a CI environment.402#build.bootstrap-cache-path = /path/to/shared/cache403404# Enable a build of the extended Rust tool set which is not only the compiler405# but also tools such as Cargo. This will also produce "combined installers"406# which are used to install Rust and Cargo together.407# The `tools` (check `bootstrap.example.toml` to see its default value) option specifies408# which tools should be built if `extended = true`.409#410# This is disabled by default.411#build.extended = false412413# Set of tools to be included in the installation.414#415# If `extended = false`, the only one of these built by default is rustdoc.416#417# If `extended = true`, they are all included.418#419# If any enabled tool fails to build, the installation fails.420#build.tools = [421# "cargo",422# "clippy",423# "rustdoc",424# "rustfmt",425# "rust-analyzer",426# "rust-analyzer-proc-macro-srv",427# "analysis",428# "src",429# "wasm-component-ld",430# "miri", "cargo-miri" # for dev/nightly channels431#]432433# Specify build configuration specific for some tool, such as enabled features.434# This option has no effect on which tools are enabled: refer to the `tools` option for that.435#436# For example, to build Miri with tracing support, use `tool.miri.features = ["tracing"]`437#438# The default value for the `features` array is `[]`. However, please note that other flags in439# `bootstrap.toml` might influence the features enabled for some tools. Also, enabling features440# in tools which are not part of the internal "extra-features" preset might not always work.441#build.tool.TOOL_NAME.features = [FEATURE1, FEATURE2]442443# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation444#build.verbose = 0445446# Build the sanitizer runtimes447#build.sanitizers = false448449# Build the profiler runtime (required when compiling with options that depend450# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`).451#build.profiler = false452453# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics.454# Choosing true requires the LLVM submodule to be managed by bootstrap (i.e. not external)455# so that `compiler-rt` sources are available.456#457# Setting this to a path removes the requirement for a C toolchain, but requires setting the458# path to an existing library containing the builtins library from LLVM's compiler-rt.459#460# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in461# order to run `x check`.462#build.optimized-compiler-builtins = if rust.channel == "dev" { false } else { true }463464# Indicates whether the native libraries linked into Cargo will be statically465# linked or not.466#build.cargo-native-static = false467468# Run the build with low priority, by setting the process group's "nice" value469# to +10 on Unix platforms, and by using a "low priority" job object on Windows.470#build.low-priority = false471472# Arguments passed to the `./configure` script, used during distcheck. You473# probably won't fill this in but rather it's filled in by the `./configure`474# script. Useful for debugging.475#build.configure-args = []476477# Indicates that a local rebuild is occurring instead of a full bootstrap,478# essentially skipping stage0 as the local compiler is recompiling itself again.479# Useful for modifying only the stage2 compiler without having to pass `--keep-stage 0` each time.480#build.local-rebuild = false481482# Print out how long each bootstrap step took (mostly intended for CI and483# tracking over time)484#build.print-step-timings = false485486# Print out resource usage data for each bootstrap step, as defined by the Unix487# struct rusage. (Note that this setting is completely unstable: the data it488# captures, what platforms it supports, the format of its associated output, and489# this setting's very existence, are all subject to change.)490#build.print-step-rusage = false491492# Always patch binaries for usage with Nix toolchains. If `true` then binaries493# will be patched unconditionally. If `false` or unset, binaries will be patched494# only if the current distribution is NixOS. This option is useful when using495# a Nix toolchain on non-NixOS distributions.496#build.patch-binaries-for-nix = false497498# Collect information and statistics about the current build, and write it to499# disk. Enabling this has no impact on the resulting build output. The500# schema of the file generated by the build metrics feature is unstable, and501# this is not intended to be used during local development.502#build.metrics = false503504# Specify the location of the Android NDK. Used when targeting Android.505#build.android-ndk = "/path/to/android-ndk-r26d"506507# Number of parallel jobs to be used for building and testing. If set to `0` or508# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag509# passed to cargo invocations.510#build.jobs = 0511512# What custom diff tool to use for displaying compiletest tests.513#build.compiletest-diff-tool = <none>514515# Whether to allow `compiletest` self-tests and `compiletest`-managed test516# suites to be run against the stage 0 rustc. This is only intended to be used517# when the stage 0 compiler is actually built from in-tree sources.518#build.compiletest-allow-stage0 = false519520# Default value for the `--extra-checks` flag of tidy.521#522# See `./x test tidy --help` for details.523#524# Note that if any value is manually given to bootstrap such as525# `./x test tidy --extra-checks=js`, this value is ignored.526# Use `--extra-checks=''` to temporarily disable all extra checks.527#528# Automatically enabled in the "tools" profile.529# Set to the empty string to force disable (recommended for hdd systems).530#build.tidy-extra-checks = ""531532# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).533# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use534# a specific version.535#build.ccache = false536537# List of paths to exclude from the build and test processes.538# For example, exclude = ["tests/ui", "src/tools/tidy"].539#build.exclude = []540541# =============================================================================542# General install configuration options543# =============================================================================544545# Where to install the generated toolchain. Must be an absolute path.546#install.prefix = "/usr/local"547548# Where to install system configuration files.549# If this is a relative path, it will get installed in `prefix` above550#install.sysconfdir = "/etc"551552# Where to install documentation in `prefix` above553#install.docdir = "share/doc/rust"554555# Where to install binaries in `prefix` above556#install.bindir = "bin"557558# Where to install libraries in `prefix` above559#install.libdir = "lib"560561# Where to install man pages in `prefix` above562#install.mandir = "share/man"563564# Where to install data in `prefix` above565#install.datadir = "share"566567# =============================================================================568# Options for compiling Rust code itself569# =============================================================================570571# Whether or not to optimize when compiling the compiler and standard library,572# and what level of optimization to use.573# WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping,574# building without optimizations takes much longer than optimizing. Further, some platforms575# fail to build without this optimization (c.f. #65352).576# The valid options are:577# true - Enable optimizations (same as 3).578# false - Disable optimizations.579# 0 - Disable optimizations.580# 1 - Basic optimizations.581# 2 - Some optimizations.582# 3 - All optimizations.583# "s" - Optimize for binary size.584# "z" - Optimize for binary size, but also turn off loop vectorization.585#rust.optimize = true586587# Indicates that the build should be configured for debugging Rust. A588# `debug`-enabled compiler and standard library will be somewhat589# slower (due to e.g. checking of debug assertions) but should remain590# usable.591#592# Note: If this value is set to `true`, it will affect a number of593# configuration options below as well, if they have been left594# unconfigured in this file.595#596# Note: changes to the `debug` setting do *not* affect `optimize`597# above. In theory, a "maximally debuggable" environment would598# set `optimize` to `false` above to assist the introspection599# facilities of debuggers like lldb and gdb. To recreate such an600# environment, explicitly set `optimize` to `false` and `debug`601# to `true`. In practice, everyone leaves `optimize` set to602# `true`, because an unoptimized rustc with debugging603# enabled becomes *unusably slow* (e.g. rust-lang/rust#24840604# reported a 25x slowdown) and bootstrapping the supposed605# "maximally debuggable" environment (notably libstd) takes606# hours to build.607#608#rust.debug = false609610# Whether to download the stage 1 and 2 compilers from CI. This is useful if you611# are working on tools, doc-comments, or library (you will be able to build the612# standard library without needing to build the compiler).613#614# Set this to "if-unchanged" if you are working on `src/tools`, `tests` or615# `library` (on CI, `library` changes triggers in-tree compiler build) to speed616# up the build process if you don't need to build a compiler from the latest617# commit from `master`.618#619# Set this to `true` to always download or `false` to always use the in-tree620# compiler.621#rust.download-rustc = false622623# Number of codegen units to use for each compiler invocation. A value of 0624# means "the number of cores on this machine", and 1+ is passed through to the625# compiler.626#627# Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units628#rust.codegen-units = if incremental { 256 } else { 16 }629630# Sets the number of codegen units to build the standard library with,631# regardless of what the codegen-unit setting for the rest of the compiler is.632# NOTE: building with anything other than 1 is known to occasionally have bugs.633#rust.codegen-units-std = codegen-units634635# Whether or not debug assertions are enabled for the compiler and standard library.636# These can help find bugs at the cost of a small runtime slowdown.637#638# Defaults to rust.debug value639#rust.debug-assertions = rust.debug (boolean)640641# Whether or not debug assertions are enabled for the standard library.642# Overrides the `debug-assertions` option, if defined.643#644# Defaults to rust.debug-assertions value645#rust.debug-assertions-std = rust.debug-assertions (boolean)646647# Whether or not debug assertions are enabled for the tools built by bootstrap.648# Overrides the `debug-assertions` option, if defined.649#650# Defaults to rust.debug-assertions value651#rust.debug-assertions-tools = rust.debug-assertions (boolean)652653# Whether or not to leave debug! and trace! calls in the rust binary.654#655# Defaults to rust.debug-assertions value656#657# If you see a message from `tracing` saying "some trace filter directives would enable traces that658# are disabled statically" because `max_level_info` is enabled, set this value to `true`.659#rust.debug-logging = rust.debug-assertions (boolean)660661# Whether or not to build rustc, tools and the libraries with randomized type layout662#rust.randomize-layout = false663664# Whether or not overflow checks are enabled for the compiler and standard665# library.666#667# Defaults to rust.debug value668#rust.overflow-checks = rust.debug (boolean)669670# Whether or not overflow checks are enabled for the standard library.671# Overrides the `overflow-checks` option, if defined.672#673# Defaults to rust.overflow-checks value674#rust.overflow-checks-std = rust.overflow-checks (boolean)675676# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.677# See https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo for available options.678#679# Can be overridden for specific subsets of Rust code (rustc, std or tools).680# Debuginfo for tests run with compiletest is not controlled by this option681# and needs to be enabled separately with `debuginfo-level-tests`.682#683# Note that debuginfo-level = 2 generates several gigabytes of debuginfo684# and will slow down the linking process significantly.685#rust.debuginfo-level = if rust.debug { 1 } else { 0 }686687# Debuginfo level for the compiler.688#rust.debuginfo-level-rustc = rust.debuginfo-level689690# Debuginfo level for the standard library.691#rust.debuginfo-level-std = rust.debuginfo-level692693# Debuginfo level for the tools.694#rust.debuginfo-level-tools = rust.debuginfo-level695696# Debuginfo level for the test suites run with compiletest.697# FIXME(#61117): Some tests fail when this option is enabled.698#rust.debuginfo-level-tests = 0699700# Should rustc and the standard library be built with split debuginfo? Default701# is platform dependent.702#703# This field is deprecated, use `target.<triple>.split-debuginfo` instead.704#705# The value specified here is only used when targeting the `build.build` triple,706# and is overridden by `target.<triple>.split-debuginfo` if specified.707#708#rust.split-debuginfo = see target.<triple>.split-debuginfo709710# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)711#rust.backtrace = true712713# Whether to always use incremental compilation when building rustc714#rust.incremental = false715716# The default linker that will be hard-coded into the generated717# compiler for targets that don't specify a default linker explicitly718# in their target specifications. Note that this is not the linker719# used to link said compiler. It can also be set per-target (via the720# `[target.<triple>]` block), which may be useful in a cross-compilation721# setting.722#723# See https://doc.rust-lang.org/rustc/codegen-options/index.html#linker for more information.724#rust.default-linker = <none> (path)725726# The "channel" for the Rust build to produce. The stable/beta channels only727# allow using stable features, whereas the nightly and dev channels allow using728# nightly features.729#730# You can set the channel to "auto-detect" to load the channel name from `src/ci/channel`.731#732# If using tarball sources, default value is "auto-detect", otherwise, it's "dev".733#rust.channel = if "is a tarball source" { "auto-detect" } else { "dev" }734735# The root location of the musl installation directory. The library directory736# will also need to contain libunwind.a for an unwinding implementation. Note737# that this option only makes sense for musl targets that produce statically738# linked binaries.739#740# Defaults to /usr on musl hosts. Has no default otherwise.741#rust.musl-root = <platform specific> (path)742743# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix744# platforms to ensure that the compiler is usable by default from the build745# directory (as it links to a number of dynamic libraries). This may not be746# desired in distributions, for example.747#rust.rpath = true748749# Additional flags to pass to `rustc`.750# Takes precedence over bootstrap's own flags but not over per target rustflags nor env. vars. like RUSTFLAGS.751# Applies to all stages and targets.752#753#rust.rustflags = []754755# Indicates whether symbols should be stripped using `-Cstrip=symbols`.756#rust.strip = false757758# Forces frame pointers to be used with `-Cforce-frame-pointers`.759# This can be helpful for profiling at a small performance cost.760#rust.frame-pointers = false761762# Indicates whether stack protectors should be used763# via the unstable option `-Zstack-protector`.764#765# Valid options are : `none`(default),`basic`,`strong`, or `all`.766# `strong` and `basic` options may be buggy and are not recommended, see rust-lang/rust#114903.767#rust.stack-protector = "none"768769# Prints each test name as it is executed, to help debug issues in the test harness itself.770#rust.verbose-tests = if is_verbose { true } else { false }771772# Flag indicating whether tests are compiled with optimizations (the -O flag).773#rust.optimize-tests = true774775# Flag indicating whether codegen tests will be run or not. If you get an error776# saying that the FileCheck executable is missing, you may want to disable this.777# Also see the target's llvm-filecheck option.778#rust.codegen-tests = true779780# Flag indicating whether git info will be retrieved from .git automatically.781# Having the git information can cause a lot of rebuilds during development.782#rust.omit-git-hash = if rust.channel == "dev" { true } else { false }783784# Whether to create a source tarball by default when running `x dist`.785#786# You can still build a source tarball when this is disabled by explicitly passing `x dist rustc-src`.787#rust.dist-src = true788789# After building or testing an optional component (e.g. the nomicon or reference), append the790# result (broken, compiling, testing) into this JSON file.791#rust.save-toolstates = <none> (path)792793# This array serves three distinct purposes:794# - Backends in this list will be automatically compiled and included in the sysroot of each795# rustc compiled by bootstrap.796# - The first backend in this list will be configured as the **default codegen backend** by each797# rustc compiled by bootstrap. In other words, if the first backend is e.g. cranelift, then when798# we build a stage 1 rustc, it will by default compile Rust programs using the Cranelift backend.799# This also means that stage 2 rustc would get built by the Cranelift backend.800# - Running `x dist` (without additional arguments, or with `--include-default-paths`) will produce801# a dist component/tarball for the Cranelift backend if it is included in this array.802#803# Note that the LLVM codegen backend is special and will always be built and distributed.804#805# Currently, the only standard options supported here are `"llvm"`, `"cranelift"` and `"gcc"`.806#rust.codegen-backends = ["llvm"]807808# Indicates whether LLD will be compiled and made available in the sysroot for rustc to execute,809#rust.lld = false, except for targets that opt into LLD (see `target.default-linker-linux-override`)810811# Indicates if we should override the linker used to link Rust crates during bootstrap to be LLD.812# If set to `true` or `"external"`, a global `lld` binary that has to be in $PATH813# will be used.814# If set to `"self-contained"`, rust-lld from the snapshot compiler will be used.815#816# On MSVC, LLD will not be used if we're cross linking.817#818# Explicitly setting the linker for a target will override this option when targeting MSVC.819#rust.bootstrap-override-lld = false820821# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the822# sysroot.823#rust.llvm-tools = true824825# Indicates whether the `self-contained` llvm-bitcode-linker, will be made available826# in the sysroot. It is required for running nvptx tests.827#rust.llvm-bitcode-linker = false828829# Whether to deny warnings in crates. Set to `false` to avoid830# error: warnings are denied by `build.warnings` configuration831#rust.deny-warnings = true832833# Print backtrace on internal compiler errors during bootstrap834#rust.backtrace-on-ice = false835836# Whether to verify generated LLVM IR837#rust.verify-llvm-ir = false838839# Compile the compiler with a non-default ThinLTO import limit. This import840# limit controls the maximum size of functions imported by ThinLTO. Decreasing841# will make code compile faster at the expense of lower runtime performance.842#rust.thin-lto-import-instr-limit = if incremental { 10 } else { LLVM default (currently 100) }843844# Map debuginfo paths to `/rust/$sha/...`.845# Useful for reproducible builds. Generally only set for releases846#rust.remap-debuginfo = false847848# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.849# This option is only tested on Linux and OSX. It can also be configured per-target in the850# [target.<tuple>] section.851#rust.jemalloc = false852853# Run tests in various test suites with the "nll compare mode" in addition to854# running the tests in normal mode. Largely only used on CI and during local855# development of NLL856#rust.test-compare-mode = false857858# Global default for llvm-libunwind for all targets. See the target-specific859# documentation for llvm-libunwind below. Note that the target-specific860# option will override this if set.861#rust.llvm-libunwind = 'no'862863# Enable Windows Control Flow Guard checks in the standard library.864# This only applies from stage 1 onwards, and only for Windows targets.865#rust.control-flow-guard = false866867# Enable Windows EHCont Guard checks in the standard library.868# This only applies from stage 1 onwards, and only for Windows targets.869#rust.ehcont-guard = false870871# Enable symbol-mangling-version v0. This can be helpful when profiling rustc,872# as generics will be preserved in symbols (rather than erased into opaque T).873# When no setting is given, the new scheme will be used when compiling the874# compiler and its tools and the legacy scheme will be used when compiling the875# standard library.876# If an explicit setting is given, it will be used for all parts of the codebase.877#rust.new-symbol-mangling = true|false (see comment)878879# Size limit in bytes for move/copy annotations (-Zannotate-moves). Only types880# at or above this size will be annotated. If not specified, uses the default881# limit (65 bytes).882#rust.annotate-moves-size-limit = 65883884# Select LTO mode that will be used for compiling rustc. By default, thin local LTO885# (LTO within a single crate) is used (like for any Rust crate). You can also select886# "thin" or "fat" to apply Thin/Fat LTO to the `rustc_driver` dylib, or "off" to disable887# LTO entirely.888#rust.lto = "thin-local"889890# Build compiler with the optimization enabled and -Zvalidate-mir, currently only for `std`891#rust.validate-mir-opts = 3892893# Configure `std` features used during bootstrap.894#895# Default features will be expanded in the following cases:896# - If `rust.llvm-libunwind` or `target.llvm-libunwind` is enabled:897# - "llvm-libunwind" will be added for in-tree LLVM builds.898# - "system-llvm-libunwind" will be added for system LLVM builds.899# - If `rust.backtrace` is enabled, "backtrace" will be added.900# - If `rust.profiler` or `target.profiler` is enabled, "profiler" will be added.901# - If building for a zkvm target, "compiler-builtins-mem" will be added.902#903# Since libstd also builds libcore and liballoc as dependencies and all their features are mirrored904# as libstd features, this option can also be used to configure features such as optimize_for_size.905#rust.std-features = ["panic_unwind"]906907# Trigger a `DebugBreak` after an internal compiler error during bootstrap on Windows908#rust.break-on-ice = true909910# Set the number of threads for the compiler frontend used during compilation of Rust code (passed to `-Zthreads`).911# The valid options are:912# 0 - Set the number of threads according to the detected number of threads of the host system913# 1 - Use a single thread for compilation of Rust code (the default)914# N - Number of threads used for compilation of Rust code915#916#rust.parallel-frontend-threads = 1917918# =============================================================================919# Distribution options920#921# These options are related to distribution, mostly for the Rust project itself.922# You probably won't need to concern yourself with any of these options923# =============================================================================924925# This is the folder of artifacts that the build system will sign. All files in926# this directory will be signed with the default gpg key using the system `gpg`927# binary. The `asc` and `sha256` files will all be output into the standard dist928# output folder (currently `build/dist`)929#930# This folder should be populated ahead of time before the build system is931# invoked.932#dist.sign-folder = <none> (path)933934# The remote address that all artifacts will eventually be uploaded to. The935# build system generates manifests which will point to these urls, and for the936# manifests to be correct they'll have to have the right URLs encoded.937#938# Note that this address should not contain a trailing slash as file names will939# be appended to it.940#dist.upload-addr = <none> (URL)941942# Whether to build a plain source tarball to upload943# We disable that on Windows not to override the one already uploaded on S3944# as the one built on Windows will contain backslashes in paths causing problems945# on linux946#dist.src-tarball = true947948# List of compression formats to use when generating dist tarballs. The list of949# formats is provided to rust-installer, which must support all of them.950#951# This list must be non-empty.952#dist.compression-formats = ["gz", "xz"]953954# How much time should be spent compressing the tarballs. The better the955# compression profile, the longer compression will take.956#957# Available options: fast, balanced, best958#dist.compression-profile = "fast"959960# Copy the linker, DLLs, and various libraries from MinGW into the Rust toolchain.961# Only applies when the host or target is pc-windows-gnu.962#dist.include-mingw-linker = true963964# Whether to vendor dependencies for the dist tarball.965#dist.vendor = if "is a tarball source" || "is a git repository" { true } else { false }966967968# =============================================================================969# Options for specific targets970#971# Each of the following options is scoped to the specific target triple in972# question and is used for determining how to compile each target.973# =============================================================================974[target.x86_64-unknown-linux-gnu]975976# C compiler to be used to compile C code. Note that the977# default value is platform specific, and if not specified it may also depend on978# what platform is crossing to what platform.979# See `src/bootstrap/src/utils/cc_detect.rs` for details.980#cc = "cc" (path)981982# C++ compiler to be used to compile C++ code (e.g. LLVM and our LLVM shims).983# This is only used for host targets.984# See `src/bootstrap/src/utils/cc_detect.rs` for details.985#cxx = "c++" (path)986987# Archiver to be used to assemble static libraries compiled from C/C++ code.988# Note: an absolute path should be used, otherwise LLVM build will break.989#ar = "ar" (path)990991# Ranlib to be used to assemble static libraries compiled from C/C++ code.992# Note: an absolute path should be used, otherwise LLVM build will break.993#ranlib = "ranlib" (path)994995# Linker to be used to bootstrap Rust code. Note that the996# default value is platform specific, and if not specified it may also depend on997# what platform is crossing to what platform.998# Setting this will override the `bootstrap-override-lld` option for Rust code when targeting MSVC.999#linker = "cc" (path)10001001# Should rustc and the standard library be built with split debuginfo? Default1002# is platform dependent.1003#1004# Valid values are the same as those accepted by `-C split-debuginfo`1005# (`off`/`unpacked`/`packed`).1006#1007# On Linux, split debuginfo is disabled by default.1008#1009# On Apple platforms, unpacked split debuginfo is used by default. Unpacked1010# debuginfo does not run `dsymutil`, which packages debuginfo from disparate1011# object files into a single `.dSYM` file. `dsymutil` adds time to builds for1012# no clear benefit, and also makes it more difficult for debuggers to find1013# debug info. The compiler currently defaults to running `dsymutil` to preserve1014# its historical default, but when compiling the compiler itself, we skip it by1015# default since we know it's safe to do so in that case.1016#1017# On Windows MSVC platforms, packed debuginfo is the only supported option,1018# producing a `.pdb` file. On Windows GNU rustc doesn't support splitting debuginfo,1019# and enabling it causes issues.1020#split-debuginfo = if linux || windows-gnu { off } else if windows-msvc { packed } else if apple { unpacked }10211022# Path to the `llvm-config` binary of the installation of a custom LLVM to link1023# against. Note that if this is specified we don't compile LLVM at all for this1024# target.1025#llvm-config = <none> (path)10261027# Override detection of whether this is a Rust-patched LLVM. This would be used1028# in conjunction with either an llvm-config or build.submodules = false.1029#llvm-has-rust-patches = if llvm-config { false } else { true }10301031# Normally the build system can find LLVM's FileCheck utility, but if1032# not, you can specify an explicit file name for it.1033#llvm-filecheck = "/path/to/llvm-version/bin/FileCheck"10341035# Use LLVM libunwind as the implementation for Rust's unwinder.1036# Accepted values are 'in-tree' (formerly true), 'system' or 'no' (formerly false).1037# This option only applies for Linux and Fuchsia targets.1038# On Linux target, if crt-static is not enabled, 'no' means dynamic link to1039# `libgcc_s.so`, 'in-tree' means static link to the in-tree build of llvm libunwind1040# and 'system' means dynamic link to `libunwind.so`. If crt-static is enabled,1041# the behavior is depend on the libc. On musl target, 'no' and 'in-tree' both1042# means static link to the in-tree build of llvm libunwind, and 'system' means1043# static link to `libunwind.a` provided by system. Due to the limitation of glibc,1044# it must link to `libgcc_eh.a` to get a working output, and this option have no effect.1045#llvm-libunwind = 'no' if Linux, 'in-tree' if Fuchsia10461047# Build the sanitizer runtimes for this target.1048# This option will override the same option under [build] section.1049#sanitizers = build.sanitizers (bool)10501051# When true, build the profiler runtime for this target (required when compiling1052# with options that depend on this runtime, such as `-C profile-generate` or1053# `-C instrument-coverage`). This may also be given a path to an existing build1054# of the profiling runtime library from LLVM's compiler-rt.1055# This option will override the same option under [build] section.1056#profiler = build.profiler (bool)10571058# This option supports enable `rpath` in each target independently,1059# and will override the same option under [rust] section. It only works on Unix platforms1060#rpath = rust.rpath (bool)10611062# Additional flags to pass to `rustc`.1063# Takes precedence over bootstrap's own flags and `rust.rustflags` but not over env. vars. like RUSTFLAGS.1064# Applies to all stages.1065#1066#rustflags = rust.rustflags10671068# Force static or dynamic linkage of the standard library for this target. If1069# this target is a host for rustc, this will also affect the linkage of the1070# compiler itself. This is useful for building rustc on targets that normally1071# only use static libraries. If unset, the target's default linkage is used.1072#crt-static = <platform-specific> (bool)10731074# The root location of the musl installation directory. The library directory1075# will also need to contain libunwind.a for an unwinding implementation. Note1076# that this option only makes sense for musl targets that produce statically1077# linked binaries.1078#musl-root = build.musl-root (path)10791080# The full path to the musl libdir.1081#musl-libdir = musl-root/lib10821083# The root location of the `wasm32-wasip1` sysroot. Only used for WASI1084# related targets. Make sure to create a `[target.wasm32-wasip1]`1085# section and move this field there (or equivalent for the target being built).1086#wasi-root = <none> (path)10871088# Used in testing for configuring where the QEMU images are located, you1089# probably don't want to use this.1090#qemu-rootfs = <none> (path)10911092# Skip building the `std` library for this target. Enabled by default for1093# target triples containing `-none`, `nvptx`, `switch`, or `-uefi`.1094#no-std = <platform-specific> (bool)10951096# This is an array of the codegen backends that will be1097# compiled for this target, overriding the global rust.codegen-backends option.1098# See that option for more info.1099#codegen-backends = rust.codegen-backends (array)11001101# This is a "runner" to pass to `compiletest` when executing tests. Tests will1102# execute this tool where the binary-to-test is passed as an argument. Can1103# be useful for situations such as when WebAssembly is being tested and a1104# runtime needs to be configured. This value is similar to1105# Cargo's `CARGO_$target_RUNNER` configuration.1106#1107# This configuration is a space-separated list of arguments so `foo bar` would1108# execute the program `foo` with the first argument as `bar` and the second1109# argument as the test binary.1110#runner = <none> (string)11111112# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics1113# on this target. Choosing true requires the LLVM submodule to be managed by bootstrap1114# (i.e. not external) so that `compiler-rt` sources are available.1115#1116# Setting this to a path removes the requirement for a C toolchain, but requires setting the1117# path to an existing library containing the builtins library from LLVM's compiler-rt.1118#1119# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in1120# order to run `x check`.1121#optimized-compiler-builtins = build.optimized-compiler-builtins (bool or path)11221123# Link the compiler and LLVM against `jemalloc` instead of the default libc allocator.1124# This overrides the global `rust.jemalloc` option. See that option for more info.1125#jemalloc = rust.jemalloc (bool)11261127# The linker configuration that will *override* the default linker used for Linux1128# targets in the built compiler.1129#1130# The following values are supported:1131# - `off` => do not apply any override and use the default linker. This can be used to opt out of1132# linker overrides set by bootstrap for specific targets (see below).1133# - `self-contained-lld-cc` => override the default linker to be self-contained LLD (`rust-lld`)1134# that is invoked through `cc`.1135#1136# Currently, the following targets automatically opt into the self-contained LLD linker, unless you1137# pass `off`:1138# - x86_64-unknown-linux-gnu1139#default-linker-linux-override = "off" (for most targets)
Findings
✓ No findings reported for this file.