1 # Sample TOML configuration file for building Rust.
3 # To configure rustbuild, copy this file to the directory from which you will be
4 # running the build, and name it config.toml.
6 # All options are commented out by default in this file, and they're commented
7 # out with their default values. The build system by default looks for
8 # `config.toml` in the current directory of a build for build configuration, but
9 # a custom configuration file can also be specified with `--config` to the build
12 # Keeps track of the last version of `x.py` used.
13 # If it does not match the version that is currently running,
14 # `x.py` will prompt you to update it and read the changelog.
15 # See `src/bootstrap/CHANGELOG.md` for more information.
18 # =============================================================================
20 # =============================================================================
22 # Use different pre-set defaults than the global defaults.
24 # See `src/bootstrap/defaults` for more information.
25 # Note that this has no default value (x.py uses the defaults in `config.toml.example`).
28 # =============================================================================
29 # Tweaking how LLVM is compiled
30 # =============================================================================
33 # Whether to use Rust CI built LLVM instead of locally building it.
35 # Unless you're developing for a target where Rust CI doesn't build a compiler
36 # toolchain or changing LLVM locally, you probably want to set this to true.
38 # This is false by default so that distributions don't unexpectedly download
39 # LLVM from the internet.
41 # All tier 1 targets are currently supported; set this to `"if-supported"` if
42 # you are not sure whether you're on a tier 1 target.
44 # We also currently only support this when building LLVM for the build triple.
46 # Note that many of the LLVM options are not currently supported for
47 # downloading. Currently only the "assertions" option can be toggled.
48 #download-ci-llvm = false
50 # Indicates whether LLVM rebuild should be skipped when running bootstrap. If
51 # this is `false` then the compiler's LLVM will be rebuilt whenever the built
52 # version doesn't have the correct hash. If it is `true` then LLVM will never
53 # be rebuilt. The default value is `false`.
56 # Indicates whether the LLVM build is a Release or Debug build
59 # Indicates whether LLVM should be built with ThinLTO. Note that this will
60 # only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++
61 # toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below).
62 # More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap
65 # Indicates whether an LLVM Release build should include debug info
66 #release-debuginfo = false
68 # Indicates whether the LLVM assertions are enabled or not
71 # Indicates whether ccache is used when building LLVM
73 # or alternatively ...
74 #ccache = "/path/to/ccache"
76 # If an external LLVM root is specified, we automatically check the version by
77 # default to make sure it's within the range that we're expecting, but setting
78 # this flag will indicate that this version check should not be done.
81 # Link libstdc++ statically into the rustc_llvm instead of relying on a
82 # dynamic version to be available.
83 #static-libstdcpp = false
85 # Whether to use Ninja to build LLVM. This runs much faster than make.
88 # LLVM targets to build support for.
89 # Note: this is NOT related to Rust compilation targets. However, as Rust is
90 # dependent on LLVM for code generation, turning targets off here WILL lead to
91 # the resulting rustc being unable to compile for the disabled architectures.
92 # Also worth pointing out is that, in case support for new targets are added to
93 # LLVM, enabling them here doesn't mean Rust is automatically gaining said
94 # support. You'll need to write a target specification at least, and most
95 # likely, teach rustc about the C ABI of the target. Get in touch with the
96 # Rust team and file an issue if you need assistance in porting!
97 #targets = "AArch64;ARM;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86"
99 # LLVM experimental targets to build support for. These targets are specified in
100 # the same format as above, but since these targets are experimental, they are
101 # not built by default and the experimental Rust compilation targets that depend
102 # on them will not work unless the user opts in to building them.
103 #experimental-targets = "AVR"
105 # Cap the number of parallel linker invocations when compiling LLVM.
106 # This can be useful when building LLVM with debug info, which significantly
107 # increases the size of binaries and consequently the memory required by
108 # each linker process.
109 # If absent or 0, linker invocations are treated like any other job and
110 # controlled by rustbuild's -j parameter.
113 # When invoking `llvm-config` this configures whether the `--shared` argument is
114 # passed to prefer linking to shared libraries.
117 # When building llvm, this configures what is being appended to the version.
118 # The default is "-rust-$version-$channel", except for dev channel where rustc
119 # version number is omitted. To use LLVM version as is, provide an empty string.
120 #version-suffix = "-rust-dev"
122 # On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
123 # with clang-cl, so this is special in that it only compiles LLVM with clang-cl
124 #clang-cl = '/path/to/clang-cl.exe'
126 # Pass extra compiler and linker flags to the LLVM CMake build.
127 #cflags = "-fextra-flag"
128 #cxxflags = "-fextra-flag"
129 #ldflags = "-Wl,extra-flag"
131 # Use libc++ when building LLVM instead of libstdc++. This is the default on
132 # platforms already use libc++ as the default C++ library, but this option
133 # allows you to use libc++ even on platforms when it's not. You need to ensure
134 # that your host compiler ships with libc++.
137 # The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.
140 # Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`
141 #allow-old-toolchain = false
143 # Whether to include the Polly optimizer.
146 # =============================================================================
147 # General build configuration options
148 # =============================================================================
150 # The default stage to use for the `doc` subcommand
153 # The default stage to use for the `build` subcommand
156 # The default stage to use for the `test` subcommand
159 # The default stage to use for the `dist` subcommand
162 # The default stage to use for the `install` subcommand
165 # The default stage to use for the `bench` subcommand
168 # Build triple for the original snapshot compiler. This must be a compiler that
169 # nightlies are already produced for. The current platform must be able to run
170 # binaries of this build triple and the nightly will be used to bootstrap the
173 # Defaults to host platform
174 #build = "x86_64-unknown-linux-gnu"
176 # Which triples to produce a compiler toolchain for. Each of these triples will
177 # be bootstrapped from the build triple themselves.
179 # Defaults to just the build triple
180 #host = ["x86_64-unknown-linux-gnu"]
182 # Which triples to build libraries (core/alloc/std/test/proc_macro) for. Each of
183 # these triples will be bootstrapped from the build triple themselves.
185 # Defaults to `host`. If you set this explicitly, you likely want to add all
186 # host triples to this list as well in order for those host toolchains to be
187 # able to compile programs for their native target.
188 #target = ["x86_64-unknown-linux-gnu"]
190 # Use this directory to store build artifacts.
191 # You can use "$ROOT" to indicate the root of the git repository.
194 # Instead of downloading the src/stage0.txt version of Cargo specified, use
195 # this Cargo binary instead to build all Rust code
196 #cargo = "/path/to/bin/cargo"
198 # Instead of downloading the src/stage0.txt version of the compiler
199 # specified, use this rustc binary instead as the stage0 snapshot compiler.
200 #rustc = "/path/to/bin/rustc"
202 # Instead of download the src/stage0.txt version of rustfmt specified,
203 # use this rustfmt binary instead as the stage0 snapshot rustfmt.
204 #rustfmt = "/path/to/bin/rustfmt"
206 # Flag to specify whether any documentation is built. If false, rustdoc and
207 # friends will still be compiled but they will not be used to generate any
211 # Flag to specify whether CSS, JavaScript, and HTML are minified when
212 # docs are generated. JSON is always minified, because it's enormous,
213 # and generated in already-minified form from the beginning.
214 #docs-minification = true
216 # Indicate whether the compiler should be documented in addition to the standard
217 # library and facade crates.
218 #compiler-docs = false
220 # Indicate whether git submodules are managed and updated automatically.
223 # Update git submodules only when the checked out commit in the submodules differs
224 # from what is committed in the main rustc repo.
225 #fast-submodules = true
227 # The path to (or name of) the GDB executable to use. This is only used for
228 # executing the debuginfo test suite.
231 # The node.js executable to use. Note that this is only used for the emscripten
232 # target when running tests, otherwise this can be omitted.
235 # Python interpreter to use for various tasks throughout the build, notably
236 # rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
238 # Defaults to the Python interpreter used to execute x.py
241 # Force Cargo to check that Cargo.lock describes the precise dependency
242 # set that all the Cargo.toml files create, instead of updating it.
245 # Indicate whether the vendored sources are used for Rust dependencies or not
248 # Typically the build system will build the Rust compiler twice. The second
249 # compiler, however, will simply use its own libraries to link against. If you
250 # would rather to perform a full bootstrap, compiling the compiler three times,
251 # then you can set this option to true. You shouldn't ever need to set this
253 #full-bootstrap = false
255 # Enable a build of the extended Rust tool set which is not only the compiler
256 # but also tools such as Cargo. This will also produce "combined installers"
257 # which are used to install Rust and Cargo together. This is disabled by
258 # default. The `tools` option (immediately below) specifies which tools should
259 # be built if `extended = true`.
262 # Installs chosen set of extended tools if `extended = true`. By default builds
263 # all extended tools except `rust-demangler`, unless the target is also being
264 # built with `profiler = true`. If chosen tool failed to build the installation
265 # fails. If `extended = false`, this option is ignored.
266 #tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"] # + "rust-demangler" if `profiler`
268 # Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
271 # Build the sanitizer runtimes
274 # Build the profiler runtime (required when compiling with options that depend
275 # on this runtime, such as `-C profile-generate` or `-Z instrument-coverage`).
278 # Indicates whether the native libraries linked into Cargo will be statically
280 #cargo-native-static = false
282 # Run the build with low priority, by setting the process group's "nice" value
283 # to +10 on Unix platforms, and by using a "low priority" job object on Windows.
284 #low-priority = false
286 # Arguments passed to the `./configure` script, used during distcheck. You
287 # probably won't fill this in but rather it's filled in by the `./configure`
291 # Indicates that a local rebuild is occurring instead of a full bootstrap,
292 # essentially skipping stage0 as the local compiler is recompiling itself again.
293 #local-rebuild = false
295 # Print out how long each rustbuild step took (mostly intended for CI and
296 # tracking over time)
297 #print-step-timings = false
299 # Print out resource usage data for each rustbuild step, as defined by the Unix
300 # struct rusage. (Note that this setting is completely unstable: the data it
301 # captures, what platforms it supports, the format of its associated output, and
302 # this setting's very existence, are all subject to change.)
303 #print-step-rusage = false
305 # =============================================================================
306 # General install configuration options
307 # =============================================================================
310 # Instead of installing to /usr/local, install to this path instead.
311 #prefix = "/usr/local"
313 # Where to install system configuration files
314 # If this is a relative path, it will get installed in `prefix` above
317 # Where to install documentation in `prefix` above
318 #docdir = "share/doc/rust"
320 # Where to install binaries in `prefix` above
323 # Where to install libraries in `prefix` above
326 # Where to install man pages in `prefix` above
327 #mandir = "share/man"
329 # Where to install data in `prefix` above (currently unused)
332 # Where to install additional info in `prefix` above (currently unused)
333 #infodir = "share/info"
335 # Where to install local state (currently unused)
336 # If this is a relative path, it will get installed in `prefix` above
337 #localstatedir = "/var/lib"
339 # =============================================================================
340 # Options for compiling Rust code itself
341 # =============================================================================
344 # Whether or not to optimize the compiler and standard library.
345 # WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping,
346 # building without optimizations takes much longer than optimizing. Further, some platforms
347 # fail to build without this optimization (c.f. #65352).
350 # Indicates that the build should be configured for debugging Rust. A
351 # `debug`-enabled compiler and standard library will be somewhat
352 # slower (due to e.g. checking of debug assertions) but should remain
355 # Note: If this value is set to `true`, it will affect a number of
356 # configuration options below as well, if they have been left
357 # unconfigured in this file.
359 # Note: changes to the `debug` setting do *not* affect `optimize`
360 # above. In theory, a "maximally debuggable" environment would
361 # set `optimize` to `false` above to assist the introspection
362 # facilities of debuggers like lldb and gdb. To recreate such an
363 # environment, explicitly set `optimize` to `false` and `debug`
364 # to `true`. In practice, everyone leaves `optimize` set to
365 # `true`, because an unoptimized rustc with debugging
366 # enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
367 # reported a 25x slowdown) and bootstrapping the supposed
368 # "maximally debuggable" environment (notably libstd) takes
373 # Whether to download the stage 1 and 2 compilers from CI.
374 # This is mostly useful for tools; if you have changes to `compiler/` they will be ignored.
376 # FIXME: currently, this also uses the downloaded compiler for stage0, but that causes unnecessary rebuilds.
377 #download-rustc = false
379 # Number of codegen units to use for each compiler invocation. A value of 0
380 # means "the number of cores on this machine", and 1+ is passed through to the
383 # Uses the rustc defaults: https://doc.rust-lang.org/rustc/codegen-options/index.html#codegen-units
384 #codegen-units = if incremental { 256 } else { 16 }
386 # Sets the number of codegen units to build the standard library with,
387 # regardless of what the codegen-unit setting for the rest of the compiler is.
388 #codegen-units-std = 1
390 # Whether or not debug assertions are enabled for the compiler and standard
391 # library. Debug assertions control the maximum log level used by rustc. When
392 # enabled calls to `trace!` and `debug!` macros are preserved in the compiled
393 # binary, otherwise they are omitted.
395 # Defaults to rust.debug value
396 #debug-assertions = rust.debug (boolean)
398 # Whether or not debug assertions are enabled for the standard library.
399 # Overrides the `debug-assertions` option, if defined.
401 # Defaults to rust.debug-assertions value
402 #debug-assertions-std = rust.debug-assertions (boolean)
404 # Whether or not to leave debug! and trace! calls in the rust binary.
405 # Overrides the `debug-assertions` option, if defined.
407 # Defaults to rust.debug-assertions value
409 # If you see a message from `tracing` saying
410 # `max_level_info` is enabled and means logging won't be shown,
411 # set this value to `true`.
412 #debug-logging = rust.debug-assertions (boolean)
414 # Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
415 # `0` - no debug info
416 # `1` - line tables only - sufficient to generate backtraces that include line
417 # information and inlined functions, set breakpoints at source code
418 # locations, and step through execution in a debugger.
419 # `2` - full debug info with variable and type information
420 # Can be overridden for specific subsets of Rust code (rustc, std or tools).
421 # Debuginfo for tests run with compiletest is not controlled by this option
422 # and needs to be enabled separately with `debuginfo-level-tests`.
424 # Note that debuginfo-level = 2 generates several gigabytes of debuginfo
425 # and will slow down the linking process significantly.
427 # Defaults to 1 if debug is true
430 # Debuginfo level for the compiler.
432 # Defaults to rust.debuginfo-level value
433 #debuginfo-level-rustc = 0
435 # Debuginfo level for the standard library.
437 # Defaults to rust.debuginfo-level value
438 #debuginfo-level-std = 0
440 # Debuginfo level for the tools.
442 # Defaults to rust.debuginfo-level value
443 #debuginfo-level-tools = 0
445 # Debuginfo level for the test suites run with compiletest.
446 # FIXME(#61117): Some tests fail when this option is enabled.
447 #debuginfo-level-tests = 0
449 # Whether to run `dsymutil` on Apple platforms to gather debug info into .dSYM
450 # bundles. `dsymutil` adds time to builds for no clear benefit, and also makes
451 # it more difficult for debuggers to find debug info. The compiler currently
452 # defaults to running `dsymutil` to preserve its historical default, but when
453 # compiling the compiler itself, we skip it by default since we know it's safe
454 # to do so in that case.
455 #run-dsymutil = false
457 # Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
460 # Whether to always use incremental compilation when building rustc
463 # Build a multi-threaded rustc
464 # FIXME(#75760): Some UI tests fail when this option is enabled.
465 #parallel-compiler = false
467 # The default linker that will be hard-coded into the generated compiler for
468 # targets that don't specify linker explicitly in their target specifications.
469 # Note that this is not the linker used to link said compiler.
470 #default-linker = "cc"
472 # The "channel" for the Rust build to produce. The stable/beta channels only
473 # allow using stable features, whereas the nightly and dev channels allow using
477 # A descriptive string to be appended to `rustc --version` output, which is
478 # also used in places like debuginfo `DW_AT_producer`. This may be useful for
479 # supplementary build information, like distro-specific package versions.
482 # The root location of the musl installation directory.
485 # By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
486 # platforms to ensure that the compiler is usable by default from the build
487 # directory (as it links to a number of dynamic libraries). This may not be
488 # desired in distributions, for example.
491 # Prints each test name as it is executed, to help debug issues in the test harness itself.
492 #verbose-tests = false
494 # Flag indicating whether tests are compiled with optimizations (the -O flag).
495 #optimize-tests = true
497 # Flag indicating whether codegen tests will be run or not. If you get an error
498 # saying that the FileCheck executable is missing, you may want to disable this.
499 # Also see the target's llvm-filecheck option.
500 #codegen-tests = true
502 # Flag indicating whether git info will be retrieved from .git automatically.
503 # Having the git information can cause a lot of rebuilds during development.
504 # Note: If this attribute is not explicitly set (e.g. if left commented out) it
505 # will default to true if channel = "dev", but will default to false otherwise.
508 # When creating source tarballs whether or not to create a source tarball.
511 # After building or testing extended tools (e.g. clippy and rustfmt), append the
512 # result (broken, compiling, testing) into this JSON file.
513 #save-toolstates = "/path/to/toolstates.json"
515 # This is an array of the codegen backends that will be compiled for the rustc
516 # that's being compiled. The default is to only build the LLVM codegen backend,
517 # and currently the only standard options supported are `"llvm"` and `"cranelift"`.
518 #codegen-backends = ["llvm"]
520 # Indicates whether LLD will be compiled and made available in the sysroot for
524 # Indicates whether LLD will be used to link Rust crates during bootstrap on
525 # supported platforms. The LLD from the bootstrap distribution will be used
526 # and not the LLD compiled during the bootstrap.
528 # LLD will not be used if we're cross linking.
530 # Explicitly setting the linker for a target will override this option when targeting MSVC.
533 # Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
537 # Whether to deny warnings in crates
538 #deny-warnings = true
540 # Print backtrace on internal compiler errors during bootstrap
541 #backtrace-on-ice = false
543 # Whether to verify generated LLVM IR
544 #verify-llvm-ir = false
546 # Compile the compiler with a non-default ThinLTO import limit. This import
547 # limit controls the maximum size of functions imported by ThinLTO. Decreasing
548 # will make code compile faster at the expense of lower runtime performance.
549 # If `incremental` is set to true above, the import limit will default to 10
550 # instead of LLVM's default of 100.
551 #thin-lto-import-instr-limit = 100
553 # Map debuginfo paths to `/rust/$sha/...`, generally only set for releases
554 #remap-debuginfo = false
556 # Link the compiler against `jemalloc`, where on Linux and OSX it should
557 # override the default allocator for rustc and LLVM.
560 # Run tests in various test suites with the "nll compare mode" in addition to
561 # running the tests in normal mode. Largely only used on CI and during local
563 #test-compare-mode = false
565 # Use LLVM libunwind as the implementation for Rust's unwinder.
566 # Accepted values are 'in-tree' (formerly true), 'system' or 'no' (formerly false).
567 #llvm-libunwind = 'no'
569 # Enable Windows Control Flow Guard checks in the standard library.
570 # This only applies from stage 1 onwards, and only for Windows targets.
571 #control-flow-guard = false
573 # Enable symbol-mangling-version v0. This can be helpful when profiling rustc,
574 # as generics will be preserved in symbols (rather than erased into opaque T).
575 #new-symbol-mangling = false
577 # =============================================================================
578 # Options for specific targets
580 # Each of the following options is scoped to the specific target triple in
581 # question and is used for determining how to compile each target.
582 # =============================================================================
583 [target.x86_64-unknown-linux-gnu]
585 # C compiler to be used to compiler C code. Note that the
586 # default value is platform specific, and if not specified it may also depend on
587 # what platform is crossing to what platform.
590 # C++ compiler to be used to compiler C++ code (e.g. LLVM and our LLVM shims).
591 # This is only used for host targets.
594 # Archiver to be used to assemble static libraries compiled from C/C++ code.
595 # Note: an absolute path should be used, otherwise LLVM build will break.
598 # Ranlib to be used to assemble static libraries compiled from C/C++ code.
599 # Note: an absolute path should be used, otherwise LLVM build will break.
602 # Linker to be used to link Rust code. Note that the
603 # default value is platform specific, and if not specified it may also depend on
604 # what platform is crossing to what platform.
605 # Setting this will override the `use-lld` option for Rust code when targeting MSVC.
608 # Path to the `llvm-config` binary of the installation of a custom LLVM to link
609 # against. Note that if this is specified we don't compile LLVM at all for this
611 #llvm-config = "../path/to/llvm/root/bin/llvm-config"
613 # Normally the build system can find LLVM's FileCheck utility, but if
614 # not, you can specify an explicit file name for it.
615 #llvm-filecheck = "/path/to/FileCheck"
617 # If this target is for Android, this option will be required to specify where
618 # the NDK for the target lives. This is used to find the C compiler to link and
620 #android-ndk = "/path/to/ndk"
622 # Build the sanitizer runtimes for this target.
623 # This option will override the same option under [build] section.
626 # Build the profiler runtime for this target(required when compiling with options that depend
627 # on this runtime, such as `-C profile-generate` or `-Z instrument-coverage`).
628 # This option will override the same option under [build] section.
631 # Force static or dynamic linkage of the standard library for this target. If
632 # this target is a host for rustc, this will also affect the linkage of the
633 # compiler itself. This is useful for building rustc on targets that normally
634 # only use static libraries. If unset, the target's default linkage is used.
637 # The root location of the musl installation directory. The library directory
638 # will also need to contain libunwind.a for an unwinding implementation. Note
639 # that this option only makes sense for musl targets that produce statically
643 # The full path to the musl libdir.
644 #musl-libdir = musl-root/lib
646 # The root location of the `wasm32-wasi` sysroot. Only used for the
647 # `wasm32-wasi` target. If you are building wasm32-wasi target, make sure to
648 # create a `[target.wasm32-wasi]` section and move this field there.
651 # Used in testing for configuring where the QEMU images are located, you
652 # probably don't want to use this.
655 # =============================================================================
656 # Distribution options
658 # These options are related to distribution, mostly for the Rust project itself.
659 # You probably won't need to concern yourself with any of these options
660 # =============================================================================
663 # This is the folder of artifacts that the build system will sign. All files in
664 # this directory will be signed with the default gpg key using the system `gpg`
665 # binary. The `asc` and `sha256` files will all be output into the standard dist
666 # output folder (currently `build/dist`)
668 # This folder should be populated ahead of time before the build system is
670 #sign-folder = "path/to/folder/to/sign"
672 # This is a file which contains the password of the default gpg key. This will
673 # be passed to `gpg` down the road when signing all files in `sign-folder`
674 # above. This should be stored in plaintext.
675 #gpg-password-file = "path/to/gpg/password"
677 # The remote address that all artifacts will eventually be uploaded to. The
678 # build system generates manifests which will point to these urls, and for the
679 # manifests to be correct they'll have to have the right URLs encoded.
681 # Note that this address should not contain a trailing slash as file names will
683 #upload-addr = "https://example.com/folder"
685 # Whether to build a plain source tarball to upload
686 # We disable that on Windows not to override the one already uploaded on S3
687 # as the one built on Windows will contain backslashes in paths causing problems
692 # Whether to allow failures when building tools
693 #missing-tools = false
695 # List of compression formats to use when generating dist tarballs. The list of
696 # formats is provided to rust-installer, which must support all of them.
697 #compression-formats = ["gz", "xz"]