bootstrap.example.toml TOML 1,225 lines View on github.com → Search inside
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# Set this to "discover" to automatically discover GDB from the environment.347#build.gdb = "gdb"348349# The path to (or name of) the LLDB executable to use. This is only used for350# executing the debuginfo test suite.351# Set this to "discover" to automatically discover LLDB from the environment.352#build.lldb = "lldb"353354# The path to (or name of) the Intel SDE executable, used to run the355# intrinsic-test suite for x86 target features the host CPU may not support.356#build.sde = "sde64"357358# The node.js executable to use. Note that this is only used for the emscripten359# target when running tests, otherwise this can be omitted.360#build.nodejs = "node"361362# The yarn executable to use. Note that this is used for rustdoc-gui tests and363# tidy js extra-checks, otherwise this can be omitted.364#365# Under Windows this should be `yarn.cmd` or path to it (verified on nodejs v18.06), or366# error will be emitted.367#build.yarn = "yarn"368369# Python interpreter to use for various tasks throughout the build, notably370# rustdoc tests, and some dist bits and pieces.371#372# Defaults to the Python interpreter used to execute x.py.373#build.python = "python"374375# The path to (or name of) the resource compiler executable to use on Windows.376#build.windows-rc = "rc.exe"377378# The path to the REUSE executable to use. Note that REUSE is not required in379# most cases, as our tooling relies on a cached (and shrunk) copy of the380# REUSE output present in the git repository and in our source tarballs.381#382# REUSE is only needed if your changes caused the overall licensing of the383# repository to change, and the cached copy has to be regenerated.384#385# Defaults to the "reuse" command in the system path.386#build.reuse = "reuse"387388# Force Cargo to check that Cargo.lock describes the precise dependency389# set that all the Cargo.toml files create, instead of updating it.390#build.locked-deps = false391392# Indicate whether the vendored sources are used for Rust dependencies or not.393#394# Vendoring requires additional setup. We recommend using the pre-generated source tarballs if you395# want to use vendoring. See https://forge.rust-lang.org/infra/other-installation-methods.html#source-code.396#build.vendor = if "is a tarball source" && "vendor" dir exists && ".cargo/config.toml" file exists { true } else { false }397398# If you build the compiler more than twice (stage3+) or the standard library more than once399# (stage 2+), the third compiler and second library will get uplifted from stage2 and stage1,400# respectively. If you would like to disable this uplifting, and rather perform a full bootstrap,401# then you can set this option to true.402#403# This is only useful for verifying that rustc generates reproducible builds.404#build.full-bootstrap = false405406# Set the bootstrap/download cache path. It is useful when building rust407# repeatedly in a CI environment.408#build.bootstrap-cache-path = /path/to/shared/cache409410# Enable a build of the extended Rust tool set which is not only the compiler411# but also tools such as Cargo. This will also produce "combined installers"412# which are used to install Rust and Cargo together.413# The `tools` (check `bootstrap.example.toml` to see its default value) option specifies414# which tools should be built if `extended = true`.415#416# This is disabled by default.417#build.extended = false418419# Set of tools to be included in the installation.420#421# If `extended = false`, the only one of these built by default is rustdoc.422#423# If `extended = true`, they are all included.424#425# If any enabled tool fails to build, the installation fails.426#build.tools = [427#    "cargo",428#    "clippy",429#    "rustdoc",430#    "rustfmt",431#    "rust-analyzer",432#    "rust-analyzer-proc-macro-srv",433#    "analysis",434#    "src",435#    "wasm-component-ld",436#    "miri", "cargo-miri" # for dev/nightly channels437#]438439# Specify build configuration specific for some tool, such as enabled features.440# This option has no effect on which tools are enabled: refer to the `tools` option for that.441#442# For example, to build Miri with tracing support, use `tool.miri.features = ["tracing"]`443#444# The default value for the `features` array is `[]`. However, please note that other flags in445# `bootstrap.toml` might influence the features enabled for some tools. Also, enabling features446# in tools which are not part of the internal "extra-features" preset might not always work.447#build.tool.TOOL_NAME.features = [FEATURE1, FEATURE2]448449# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose, 3 == print environment variables on each rustc invocation450#build.verbose = 0451452# Build the sanitizer runtimes453#build.sanitizers = false454455# Build the profiler runtime (required when compiling with options that depend456# on this runtime, such as `-C profile-generate` or `-C instrument-coverage`).457#build.profiler = false458459# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics.460# Choosing true requires the LLVM submodule to be managed by bootstrap (i.e. not external)461# so that `compiler-rt` sources are available.462#463# Setting this to a path removes the requirement for a C toolchain, but requires setting the464# path to an existing library containing the builtins library from LLVM's compiler-rt.465#466# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in467# order to run `x check`.468#build.optimized-compiler-builtins = if rust.channel == "dev" { false } else { true }469470# Indicates whether the native libraries linked into Cargo will be statically471# linked or not.472#build.cargo-native-static = false473474# Run the build with low priority, by setting the process group's "nice" value475# to +10 on Unix platforms, and by using a "low priority" job object on Windows.476#build.low-priority = false477478# Arguments passed to the `./configure` script, used during distcheck. You479# probably won't fill this in but rather it's filled in by the `./configure`480# script. Useful for debugging.481#build.configure-args = []482483# Indicates that a local rebuild is occurring instead of a full bootstrap,484# essentially skipping stage0 as the local compiler is recompiling itself again.485# Useful for modifying only the stage2 compiler without having to pass `--keep-stage 0` each time.486#build.local-rebuild = false487488# Print out how long each bootstrap step took (mostly intended for CI and489# tracking over time)490#build.print-step-timings = false491492# Print out resource usage data for each bootstrap step, as defined by the Unix493# struct rusage. (Note that this setting is completely unstable: the data it494# captures, what platforms it supports, the format of its associated output, and495# this setting's very existence, are all subject to change.)496#build.print-step-rusage = false497498# Always patch binaries for usage with Nix toolchains. If `true` then binaries499# will be patched unconditionally. If `false` or unset, binaries will be patched500# only if the current distribution is NixOS. This option is useful when using501# a Nix toolchain on non-NixOS distributions.502#build.patch-binaries-for-nix = false503504# Collect information and statistics about the current build, and write it to505# disk. Enabling this has no impact on the resulting build output. The506# schema of the file generated by the build metrics feature is unstable, and507# this is not intended to be used during local development.508#build.metrics = false509510# Specify the location of the Android NDK. Used when targeting Android.511#build.android-ndk = "/path/to/android-ndk-r26d"512513# Number of parallel jobs to be used for building and testing. If set to `0` or514# omitted, it will be automatically determined. This is the `-j`/`--jobs` flag515# passed to cargo invocations.516#build.jobs = 0517518# What custom diff tool to use for displaying compiletest tests.519#build.compiletest-diff-tool = <none>520521# Whether to allow `compiletest` self-tests and `compiletest`-managed test522# suites to be run against the stage 0 rustc. This is only intended to be used523# when the stage 0 compiler is actually built from in-tree sources.524#build.compiletest-allow-stage0 = false525526# Default value for the `--extra-checks` flag of tidy.527#528# See `./x test tidy --help` for details.529#530# Note that if any value is manually given to bootstrap such as531# `./x test tidy --extra-checks=js`, this value is ignored.532# Use `--extra-checks=''` to temporarily disable all extra checks.533#534# Automatically enabled in the "tools" profile.535# Set to the empty string to force disable (recommended for hdd systems).536#build.tidy-extra-checks = ""537538# Indicates whether ccache is used when building certain artifacts (e.g. LLVM).539# Set to `true` to use the first `ccache` in PATH, or set an absolute path to use540# a specific version.541#build.ccache = false542543# List of paths to exclude from the build and test processes.544# For example, exclude = ["tests/ui", "src/tools/tidy"].545#build.exclude = []546547# Link the compiler and LLVM against the specified allocator instead of the default libc allocator.548# This option is only tested on Linux and OSX. It can also be configured per-target in the549# [target.<tuple>] section.550# Possible options: "system" (default), "jemalloc"551#build.allocator = "jemalloc"552553# =============================================================================554# General install configuration options555# =============================================================================556557# Where to install the generated toolchain. Must be an absolute path.558#install.prefix = "/usr/local"559560# Where to install system configuration files.561# If this is a relative path, it will get installed in `prefix` above562#install.sysconfdir = "/etc"563564# Where to install documentation in `prefix` above565#install.docdir = "share/doc/rust"566567# Where to install binaries in `prefix` above568#install.bindir = "bin"569570# Where to install libraries in `prefix` above571#install.libdir = "lib"572573# Where to install man pages in `prefix` above574#install.mandir = "share/man"575576# Where to install data in `prefix` above577#install.datadir = "share"578579# =============================================================================580# Options for compiling Rust code itself581# =============================================================================582583# Whether or not to optimize when compiling the compiler and standard library,584# and what level of optimization to use.585# WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping,586# building without optimizations takes much longer than optimizing. Further, some platforms587# fail to build without this optimization (c.f. #65352).588# The valid options are:589# true - Enable optimizations (same as 3).590# false - Disable optimizations.591# 0 - Disable optimizations.592# 1 - Basic optimizations.593# 2 - Some optimizations.594# 3 - All optimizations.595# "s" - Optimize for binary size.596# "z" - Optimize for binary size, but also turn off loop vectorization.597#rust.optimize = true598599# Indicates that the build should be configured for debugging Rust. A600# `debug`-enabled compiler and standard library will be somewhat601# slower (due to e.g. checking of debug assertions) but should remain602# usable.603#604# Note: If this value is set to `true`, it will affect a number of605#       configuration options below as well, if they have been left606#       unconfigured in this file.607#608# Note: changes to the `debug` setting do *not* affect `optimize`609#       above. In theory, a "maximally debuggable" environment would610#       set `optimize` to `false` above to assist the introspection611#       facilities of debuggers like lldb and gdb. To recreate such an612#       environment, explicitly set `optimize` to `false` and `debug`613#       to `true`. In practice, everyone leaves `optimize` set to614#       `true`, because an unoptimized rustc with debugging615#       enabled becomes *unusably slow* (e.g. rust-lang/rust#24840616#       reported a 25x slowdown) and bootstrapping the supposed617#       "maximally debuggable" environment (notably libstd) takes618#       hours to build.619#620#rust.debug = false621622# Whether to download the stage 1 and 2 compilers from CI. This is useful if you623# are working on tools, doc-comments, or library (you will be able to build the624# standard library without needing to build the compiler).625#626# Set this to "if-unchanged" if you are working on `src/tools`, `tests` or627# `library` (on CI, `library` changes triggers in-tree compiler build) to speed628# up the build process if you don't need to build a compiler from the latest629# commit from `master`.630#631# Set this to `true` to always download or `false` to always use the in-tree632# compiler.633#rust.download-rustc = false634635# Number of codegen units to use for each compiler invocation. A value of 0636# means "the number of cores on this machine", and 1+ is passed through to the637# compiler.638#639# Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units640#rust.codegen-units = if incremental { 256 } else { 16 }641642# Sets the number of codegen units to build the standard library with,643# regardless of what the codegen-unit setting for the rest of the compiler is.644# NOTE: building with anything other than 1 is known to occasionally have bugs.645#rust.codegen-units-std = codegen-units646647# Whether or not debug assertions are enabled for the compiler and standard library.648# These can help find bugs at the cost of a small runtime slowdown.649#650# Defaults to rust.debug value651#rust.debug-assertions = rust.debug (boolean)652653# Whether or not debug assertions are enabled for the standard library.654# Overrides the `debug-assertions` option, if defined.655#656# Defaults to rust.debug-assertions value657#rust.debug-assertions-std = rust.debug-assertions (boolean)658659# Whether or not debug assertions are enabled for the tools built by bootstrap.660# Overrides the `debug-assertions` option, if defined.661#662# Defaults to rust.debug-assertions value663#rust.debug-assertions-tools = rust.debug-assertions (boolean)664665# Whether or not to leave debug! and trace! calls in the rust binary.666#667# Defaults to rust.debug-assertions value668#669# If you see a message from `tracing` saying "some trace filter directives would enable traces that670# are disabled statically" because `max_level_info` is enabled, set this value to `true`.671#rust.debug-logging = rust.debug-assertions (boolean)672673# Whether or not to build rustc, tools and the libraries with randomized type layout674#rust.randomize-layout = false675676# Whether or not overflow checks are enabled for the compiler and standard677# library.678#679# Defaults to rust.debug value680#rust.overflow-checks = rust.debug (boolean)681682# Whether or not overflow checks are enabled for the standard library.683# Overrides the `overflow-checks` option, if defined.684#685# Defaults to rust.overflow-checks value686#rust.overflow-checks-std = rust.overflow-checks (boolean)687688# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.689# See https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo for available options.690#691# Can be overridden for specific subsets of Rust code (rustc, std or tools).692# Debuginfo for tests run with compiletest is not controlled by this option693# and needs to be enabled separately with `debuginfo-level-tests`.694#695# Note that debuginfo-level = 2 generates several gigabytes of debuginfo696# and will slow down the linking process significantly.697#rust.debuginfo-level = if rust.debug { 1 } else { 0 }698699# Debuginfo level for the compiler.700#rust.debuginfo-level-rustc = rust.debuginfo-level701702# Debuginfo level for the standard library.703#rust.debuginfo-level-std = rust.debuginfo-level704705# Debuginfo level for the tools.706#rust.debuginfo-level-tools = rust.debuginfo-level707708# Debuginfo level for the test suites run with compiletest.709# FIXME(#61117): Some tests fail when this option is enabled.710#rust.debuginfo-level-tests = 0711712# Compress debuginfo of Rust and C/C++ code.713# Currently, this only works on Linux.714# Valid options:715# - "off" or false: disable compression716# - true: compress debuginfo with the default compression method (currently zlib)717# - "zlib": compress debuginfo with zlib718#rust.compress-debuginfo = "off"719720# Should rustc and the standard library be built with split debuginfo? Default721# is platform dependent.722#723# This field is deprecated, use `target.<triple>.split-debuginfo` instead.724#725# The value specified here is only used when targeting the `build.build` triple,726# and is overridden by `target.<triple>.split-debuginfo` if specified.727#728#rust.split-debuginfo = see target.<triple>.split-debuginfo729730# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)731#rust.backtrace = true732733# Whether to always use incremental compilation when building rustc734#rust.incremental = false735736# The default linker that will be hard-coded into the generated737# compiler for targets that don't specify a default linker explicitly738# in their target specifications.  Note that this is not the linker739# used to link said compiler. It can also be set per-target (via the740# `[target.<triple>]` block), which may be useful in a cross-compilation741# setting.742#743# See https://doc.rust-lang.org/rustc/codegen-options/index.html#linker for more information.744#rust.default-linker = <none> (path)745746# The "channel" for the Rust build to produce. The stable/beta channels only747# allow using stable features, whereas the nightly and dev channels allow using748# nightly features.749#750# You can set the channel to "auto-detect" to load the channel name from `src/ci/channel`.751#752# If using tarball sources, default value is "auto-detect", otherwise, it's "dev".753#rust.channel = if "is a tarball source" { "auto-detect" } else { "dev" }754755# The root location of the musl installation directory. The library directory756# will also need to contain libunwind.a for an unwinding implementation. Note757# that this option only makes sense for musl targets that produce statically758# linked binaries.759#760# Defaults to /usr on musl hosts. Has no default otherwise.761#rust.musl-root = <platform specific> (path)762763# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix764# platforms to ensure that the compiler is usable by default from the build765# directory (as it links to a number of dynamic libraries). This may not be766# desired in distributions, for example.767#rust.rpath = true768769# Additional flags to pass to `rustc`.770# Takes precedence over bootstrap's own flags but not over per target rustflags nor env. vars. like RUSTFLAGS.771# Applies to all stages and targets.772#773#rust.rustflags = []774775# Indicates whether symbols should be stripped using `-Cstrip=symbols`.776#rust.strip = false777778# Forces frame pointers to be used with `-Cforce-frame-pointers`.779# This can be helpful for profiling at a small performance cost.780#rust.frame-pointers = false781782# Indicates whether stack protectors should be used783# via the unstable option `-Zstack-protector`.784#785# Valid options are : `none`(default),`basic`,`strong`, or `all`.786# `strong` and `basic` options may be buggy and are not recommended, see rust-lang/rust#114903.787#rust.stack-protector = "none"788789# Prints each test name as it is executed, to help debug issues in the test harness itself.790#rust.verbose-tests = if is_verbose { true } else { false }791792# Flag indicating whether tests are compiled with optimizations (the -O flag).793#rust.optimize-tests = true794795# Flag indicating whether codegen tests will be run or not. If you get an error796# saying that the FileCheck executable is missing, you may want to disable this.797# Also see the target's llvm-filecheck option.798#rust.codegen-tests = true799800# Flag indicating whether git info will be retrieved from .git automatically.801# Having the git information can cause a lot of rebuilds during development.802#rust.omit-git-hash = if rust.channel == "dev" { true } else { false }803804# Whether to create a source tarball by default when running `x dist`.805#806# You can still build a source tarball when this is disabled by explicitly passing `x dist rustc-src`.807#rust.dist-src = true808809# After building or testing an optional component (e.g. the nomicon or reference), append the810# result (broken, compiling, testing) into this JSON file.811#rust.save-toolstates = <none> (path)812813# This array serves three distinct purposes:814# - Backends in this list will be automatically compiled and included in the sysroot of each815# rustc compiled by bootstrap.816# - The first backend in this list will be configured as the **default codegen backend** by each817# rustc compiled by bootstrap. In other words, if the first backend is e.g. cranelift, then when818# we build a stage 1 rustc, it will by default compile Rust programs using the Cranelift backend.819# This also means that stage 2 rustc would get built by the Cranelift backend.820# - Running `x dist` (without additional arguments, or with `--include-default-paths`) will produce821# a dist component/tarball for the Cranelift backend if it is included in this array.822#823# Note that the LLVM codegen backend is special and will always be built and distributed.824#825# Currently, the only standard options supported here are `"llvm"`, `"cranelift"` and `"gcc"`.826#rust.codegen-backends = ["llvm"]827828# Indicates whether LLD will be compiled and made available in the sysroot for rustc to execute,829#rust.lld = false, except for targets that opt into LLD (see `target.default-linker-linux-override`)830831# Indicates if we should override the linker used to link Rust crates during bootstrap to be LLD.832# If set to `true` or `"external"`, a global `lld` binary that has to be in $PATH833# will be used.834# If set to `"self-contained"`, rust-lld from the snapshot compiler will be used.835#836# On MSVC, LLD will not be used if we're cross linking.837#838# Explicitly setting the linker for a target will override this option when targeting MSVC.839#rust.bootstrap-override-lld = false840841# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the842# sysroot.843#rust.llvm-tools = true844845# Indicates whether the `self-contained` llvm-bitcode-linker, will be made available846# in the sysroot. It is required for running nvptx tests.847#rust.llvm-bitcode-linker = false848849# Whether to deny warnings in crates. Set to `false` to avoid850# error: warnings are denied by `build.warnings` configuration851#rust.deny-warnings = true852853# Print backtrace on internal compiler errors during bootstrap854#rust.backtrace-on-ice = false855856# Whether to verify generated LLVM IR857#rust.verify-llvm-ir = false858859# Compile the compiler with a non-default ThinLTO import limit. This import860# limit controls the maximum size of functions imported by ThinLTO. Decreasing861# will make code compile faster at the expense of lower runtime performance.862#rust.thin-lto-import-instr-limit = if incremental { 10 } else { LLVM default (currently 100) }863864# Map debuginfo paths to `/rust/$sha/...`.865# Useful for reproducible builds. Generally only set for releases866#rust.remap-debuginfo = false867868# Deprecated alias for `build.allocator`. Setting this to `true` is869# equivalent to `build.allocator = "jemalloc"`. Both cannot be set in the same section870# (`rust` or `target.[target]`)871#rust.jemalloc = false872873# Run tests in various test suites with the "nll compare mode" in addition to874# running the tests in normal mode. Largely only used on CI and during local875# development of NLL876#rust.test-compare-mode = false877878# Global default for llvm-libunwind for all targets. See the target-specific879# documentation for llvm-libunwind below. Note that the target-specific880# option will override this if set.881#rust.llvm-libunwind = 'no'882883# Enable Windows Control Flow Guard checks in the standard library.884# This only applies from stage 1 onwards, and only for Windows targets.885#rust.control-flow-guard = false886887# Enable Windows EHCont Guard checks in the standard library.888# This only applies from stage 1 onwards, and only for Windows targets.889#rust.ehcont-guard = false890891# Enable symbol-mangling-version v0. This can be helpful when profiling rustc,892# as generics will be preserved in symbols (rather than erased into opaque T).893# When no setting is given, the new scheme will be used when compiling the894# compiler and its tools and the legacy scheme will be used when compiling the895# standard library.896# If an explicit setting is given, it will be used for all parts of the codebase.897#rust.new-symbol-mangling = true|false (see comment)898899# Size limit in bytes for move/copy annotations (-Zannotate-moves). Only types900# at or above this size will be annotated. If not specified, uses the default901# limit (65 bytes).902#rust.annotate-moves-size-limit = 65903904# Select LTO mode that will be used for compiling rustc. By default, thin local LTO905# (LTO within a single crate) is used (like for any Rust crate). You can also select906# "thin" or "fat" to apply Thin/Fat LTO to the `rustc_driver` dylib, or "off" to disable907# LTO entirely.908#rust.lto = "thin-local"909910# Build compiler with the optimization enabled and -Zvalidate-mir, currently only for `std`911#rust.validate-mir-opts = 3912913# Configure `std` features used during bootstrap.914#915# Default features will be expanded in the following cases:916#  - If `rust.llvm-libunwind` or `target.llvm-libunwind` is enabled:917#    - "llvm-libunwind" will be added for in-tree LLVM builds.918#    - "system-llvm-libunwind" will be added for system LLVM builds.919#  - If `rust.backtrace` is enabled, "backtrace" will be added.920#  - If `rust.profiler` or `target.profiler` is enabled, "profiler" will be added.921#  - If building for a zkvm target, "compiler-builtins-mem" will be added.922#923# Since libstd also builds libcore and liballoc as dependencies and all their features are mirrored924# as libstd features, this option can also be used to configure features such as optimize_for_size.925#rust.std-features = ["panic-unwind"]926927# Trigger a `DebugBreak` after an internal compiler error during bootstrap on Windows928#rust.break-on-ice = true929930# Set the number of threads for the compiler frontend used during compilation of Rust code (passed to `-Zthreads`).931# The valid options are:932# 0 - Set the number of threads according to the detected number of threads of the host system933# 1 - Use a single thread for compilation of Rust code (the default)934# N - Number of threads used for compilation of Rust code935#936#rust.parallel-frontend-threads = 1937938# Baseline commit SHA for comparing semver breakages in the Rust standard library.939# The in-tree stdlib API will be evaluated for semver breakages against this commit.940# Used for the `./x test std-semver-check` command.941# If unset, the first upstream parent commit will be used.942#943# The SHA must point to a merge commit merged into the mainline rust-lang/rust `main` branch,944# because bootstrap will attempt to download the JSON docs data for this commit from its CI.945#rust.stdlib-semver-baseline = "<commit-sha>"946947# Enables building a wasm proc macro compatible toolchain.948#949# This requires building an additional standard library for a different target and adding it950# to the sysroot before running tests, and so needs special handling in bootstrap. Currently951# off by default.952#953# This currently opts compiletest into running/building proc-macro tests via wasm.954#955# The implementation for this has not finished landing, so you probably don't956# want to enable this right now.957#rust.wasm-proc-macros = false958959# =============================================================================960# Distribution options961#962# These options are related to distribution, mostly for the Rust project itself.963# You probably won't need to concern yourself with any of these options964# =============================================================================965966# This is the folder of artifacts that the build system will sign. All files in967# this directory will be signed with the default gpg key using the system `gpg`968# binary. The `asc` and `sha256` files will all be output into the standard dist969# output folder (currently `build/dist`)970#971# This folder should be populated ahead of time before the build system is972# invoked.973#dist.sign-folder = <none> (path)974975# The remote address that all artifacts will eventually be uploaded to. The976# build system generates manifests which will point to these urls, and for the977# manifests to be correct they'll have to have the right URLs encoded.978#979# Note that this address should not contain a trailing slash as file names will980# be appended to it.981#dist.upload-addr = <none> (URL)982983# Whether to build a plain source tarball to upload984# We disable that on Windows not to override the one already uploaded on S3985# as the one built on Windows will contain backslashes in paths causing problems986# on linux987#dist.src-tarball = true988989# List of compression formats to use when generating dist tarballs. The list of990# formats is provided to rust-installer, which must support all of them.991#992# This list must be non-empty.993#dist.compression-formats = ["gz", "xz"]994995# How much time should be spent compressing the tarballs. The better the996# compression profile, the longer compression will take.997#998# Available options: fast, balanced, best999#dist.compression-profile = "fast"10001001# Copy the linker, DLLs, and various libraries from MinGW into the Rust toolchain.1002# Only applies when the host or target is pc-windows-gnu.1003#dist.include-mingw-linker = true10041005# Whether to vendor dependencies for the dist tarball.1006#dist.vendor = if "is a tarball source" || "is a git repository" { true } else { false }100710081009# =============================================================================1010# Profile-guided optimization options1011#1012# Configure the PGO profile to be used for compilation, or a path where the1013# profile will be written by an instrumented binary, for individual components1014# =============================================================================10151016# Use the following profile to PGO optimize the Rust compiler.1017#pgo.rustc.use = "/tmp/profiles/foo.profraw"1018# Instrument the Rust compiler, so that when executed, it will gather profiles1019# to this path.1020#pgo.rustc.generate = "/tmp/profiles/foo.profraw"1021# Use the following profile to PGO optimize rustdoc.1022#pgo.rustdoc.use = "/tmp/profiles/foo.profraw"1023# Instrument rustdoc, so that when executed, it will gather profiles1024# to this path.1025#pgo.rustdoc.generate = "/tmp/profiles/foo.profraw"1026# Use the following profile to PGO optimize cargo.1027#pgo.cargo.use = "/tmp/profiles/foo.profraw"1028# Instrument cargo, so that when executed, it will gather profiles1029# to this path.1030#pgo.cargo.generate = "/tmp/profiles/foo.profraw"1031# Use the following profile to PGO optimize clippy.1032#pgo.clippy.use = "/tmp/profiles/foo.profraw"1033# Instrument clippy, so that when executed, it will gather profiles1034# to this path.1035#pgo.clippy.generate = "/tmp/profiles/foo.profraw"1036# Use the following profile to PGO optimize LLVM.1037#pgo.llvm.use = "/tmp/profiles/foo.profraw"1038# Instrument LLVM, so that when executed, it will gather profiles1039# Note: for LLVM specifically, this should be a directory, not a file path.1040#pgo.llvm.generate = "/tmp/profiles"10411042# =============================================================================1043# Options for specific targets1044#1045# Each of the following options is scoped to the specific target triple in1046# question and is used for determining how to compile each target.1047# =============================================================================1048[target.x86_64-unknown-linux-gnu]10491050# C compiler to be used to compile C code. Note that the1051# default value is platform specific, and if not specified it may also depend on1052# what platform is crossing to what platform.1053# See `src/bootstrap/src/utils/cc_detect.rs` for details.1054#cc = "cc" (path)10551056# C++ compiler to be used to compile C++ code (e.g. LLVM and our LLVM shims).1057# This is only used for host targets.1058# See `src/bootstrap/src/utils/cc_detect.rs` for details.1059#cxx = "c++" (path)10601061# Archiver to be used to assemble static libraries compiled from C/C++ code.1062# Note: an absolute path should be used, otherwise LLVM build will break.1063#ar = "ar" (path)10641065# Ranlib to be used to assemble static libraries compiled from C/C++ code.1066# Note: an absolute path should be used, otherwise LLVM build will break.1067#ranlib = "ranlib" (path)10681069# Linker to be used to bootstrap Rust code. Note that the1070# default value is platform specific, and if not specified it may also depend on1071# what platform is crossing to what platform.1072# Setting this will override the `bootstrap-override-lld` option for Rust code when targeting MSVC.1073#linker = "cc" (path)10741075# Should rustc and the standard library be built with split debuginfo? Default1076# is platform dependent.1077#1078# Valid values are the same as those accepted by `-C split-debuginfo`1079# (`off`/`unpacked`/`packed`).1080#1081# On Linux, split debuginfo is disabled by default.1082#1083# On Apple platforms, unpacked split debuginfo is used by default. Unpacked1084# debuginfo does not run `dsymutil`, which packages debuginfo from disparate1085# object files into a single `.dSYM` file. `dsymutil` adds time to builds for1086# no clear benefit, and also makes it more difficult for debuggers to find1087# debug info. The compiler currently defaults to running `dsymutil` to preserve1088# its historical default, but when compiling the compiler itself, we skip it by1089# default since we know it's safe to do so in that case.1090#1091# On Windows MSVC platforms, packed debuginfo is the only supported option,1092# producing a `.pdb` file. On Windows GNU rustc doesn't support splitting debuginfo,1093# and enabling it causes issues.1094#split-debuginfo = if linux || windows-gnu { off } else if windows-msvc { packed } else if apple { unpacked }10951096# Compress debuginfo for Rust and C/C++ code of this target.1097# Currently, this only works on Linux.1098# Valid options:1099# - "off" or false: disable compression1100# - true: compress debuginfo with the default compression method (currently zlib)1101# - "zlib": compress debuginfo with zlib1102#compress-debuginfo = "off"11031104# Path to the `llvm-config` binary of the installation of a custom LLVM to link1105# against. Note that if this is specified we don't compile LLVM at all for this1106# target.1107#llvm-config = <none> (path)11081109# Override detection of whether this is a Rust-patched LLVM. This would be used1110# in conjunction with either an llvm-config or build.submodules = false.1111#llvm-has-rust-patches = if llvm-config { false } else { true }11121113# Normally the build system can find LLVM's FileCheck utility, but if1114# not, you can specify an explicit file name for it.1115#llvm-filecheck = "/path/to/llvm-version/bin/FileCheck"11161117# Use LLVM libunwind as the implementation for Rust's unwinder.1118# Accepted values are 'in-tree' (formerly true), 'system' or 'no' (formerly false).1119# This option only applies for Linux and Fuchsia targets.1120# On Linux target, if crt-static is not enabled, 'no' means dynamic link to1121# `libgcc_s.so`, 'in-tree' means static link to the in-tree build of llvm libunwind1122# and 'system' means dynamic link to `libunwind.so`. If crt-static is enabled,1123# the behavior is depend on the libc. On musl target, 'no' and 'in-tree' both1124# means static link to the in-tree build of llvm libunwind, and 'system' means1125# static link to `libunwind.a` provided by system. Due to the limitation of glibc,1126# it must link to `libgcc_eh.a` to get a working output, and this option have no effect.1127#llvm-libunwind = 'no' if Linux, 'in-tree' if Fuchsia11281129# Build the sanitizer runtimes for this target.1130# This option will override the same option under [build] section.1131#sanitizers = build.sanitizers (bool)11321133# When true, build the profiler runtime for this target (required when compiling1134# with options that depend on this runtime, such as `-C profile-generate` or1135# `-C instrument-coverage`). This may also be given a path to an existing build1136# of the profiling runtime library from LLVM's compiler-rt.1137# This option will override the same option under [build] section.1138#profiler = build.profiler (bool)11391140# This option supports enable `rpath` in each target independently,1141# and will override the same option under [rust] section. It only works on Unix platforms1142#rpath = rust.rpath (bool)11431144# Additional flags to pass to `rustc`.1145# Takes precedence over bootstrap's own flags and `rust.rustflags` but not over env. vars. like RUSTFLAGS.1146# Applies to all stages.1147#1148#rustflags = rust.rustflags11491150# Force static or dynamic linkage of the standard library for this target. If1151# this target is a host for rustc, this will also affect the linkage of the1152# compiler itself. This is useful for building rustc on targets that normally1153# only use static libraries. If unset, the target's default linkage is used.1154#crt-static = <platform-specific> (bool)11551156# The root location of the musl installation directory. The library directory1157# will also need to contain libunwind.a for an unwinding implementation. Note1158# that this option only makes sense for musl targets that produce statically1159# linked binaries.1160#musl-root = build.musl-root (path)11611162# The full path to the musl libdir.1163#musl-libdir = musl-root/lib11641165# The root location of the `wasm32-wasip1` sysroot. Only used for WASI1166# related targets. Make sure to create a `[target.wasm32-wasip1]`1167# section and move this field there (or equivalent for the target being built).1168#wasi-root = <none> (path)11691170# Used in testing for configuring where the QEMU images are located, you1171# probably don't want to use this.1172#qemu-rootfs = <none> (path)11731174# Skip building the `std` library for this target. Enabled by default for1175# target triples containing `-none`, `nvptx`, `switch`, or `-uefi`.1176#no-std = <platform-specific> (bool)11771178# This is an array of the codegen backends that will be1179# compiled for this target, overriding the global rust.codegen-backends option.1180# See that option for more info.1181#codegen-backends = rust.codegen-backends (array)11821183# This is a "runner" to pass to `compiletest` when executing tests. Tests will1184# execute this tool where the binary-to-test is passed as an argument. Can1185# be useful for situations such as when WebAssembly is being tested and a1186# runtime needs to be configured. This value is similar to1187# Cargo's `CARGO_$target_RUNNER` configuration.1188#1189# This configuration is a space-separated list of arguments so `foo bar` would1190# execute the program `foo` with the first argument as `bar` and the second1191# argument as the test binary.1192#runner = <none> (string)11931194# Use the optimized LLVM C intrinsics for `compiler_builtins`, rather than Rust intrinsics1195# on this target. Choosing true requires the LLVM submodule to be managed by bootstrap1196# (i.e. not external) so that `compiler-rt` sources are available.1197#1198# Setting this to a path removes the requirement for a C toolchain, but requires setting the1199# path to an existing library containing the builtins library from LLVM's compiler-rt.1200#1201# Setting this to `false` generates slower code, but removes the requirement for a C toolchain in1202# order to run `x check`.1203#optimized-compiler-builtins = build.optimized-compiler-builtins (bool or path)12041205# Link the compiler and LLVM against the specified allocator instead of the default libc allocator.1206# This overrides the global `build.allocator` option. See that option for more info.1207#allocator = build.allocator (string)12081209# Deprecated alias for `allocator`. See `rust.jemalloc` for more info.1210#jemalloc = rust.jemalloc (bool)12111212# The linker configuration that will *override* the default linker used for Linux1213# targets in the built compiler.1214#1215# The following values are supported:1216# - `off` => do not apply any override and use the default linker. This can be used to opt out of1217#   linker overrides set by bootstrap for specific targets (see below).1218# - `self-contained-lld-cc` => override the default linker to be self-contained LLD (`rust-lld`)1219#   that is invoked through `cc`.1220#1221# Currently, the following targets automatically opt into the self-contained LLD linker, unless you1222# pass `off`:1223# - x86_64-unknown-linux-gnu1224#default-linker-linux-override = "off" (for most targets)

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.