]> git.lizzy.rs Git - rust.git/blob - config.toml.example
comments + add max_level_info so false works with debug_assertions on
[rust.git] / config.toml.example
1 # Sample TOML configuration file for building Rust.
2 #
3 # To configure rustbuild, copy this file to the directory from which you will be
4 # running the build, and name it config.toml.
5 #
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
10 # system.
11
12 # =============================================================================
13 # Tweaking how LLVM is compiled
14 # =============================================================================
15 [llvm]
16
17 # Indicates whether LLVM rebuild should be skipped when running bootstrap. If
18 # this is `false` then the compiler's LLVM will be rebuilt whenever the built
19 # version doesn't have the correct hash. If it is `true` then LLVM will never
20 # be rebuilt. The default value is `false`.
21 #skip-rebuild = false
22
23 # Indicates whether the LLVM build is a Release or Debug build
24 #optimize = true
25
26 # Indicates whether LLVM should be built with ThinLTO. Note that this will
27 # only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++
28 # toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below).
29 # More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap
30 #thin-lto = false
31
32 # Indicates whether an LLVM Release build should include debug info
33 #release-debuginfo = false
34
35 # Indicates whether the LLVM assertions are enabled or not
36 #assertions = false
37
38 # Indicates whether ccache is used when building LLVM
39 #ccache = false
40 # or alternatively ...
41 #ccache = "/path/to/ccache"
42
43 # If an external LLVM root is specified, we automatically check the version by
44 # default to make sure it's within the range that we're expecting, but setting
45 # this flag will indicate that this version check should not be done.
46 #version-check = true
47
48 # Link libstdc++ statically into the librustc_llvm instead of relying on a
49 # dynamic version to be available.
50 #static-libstdcpp = false
51
52 # Whether to use Ninja to build LLVM. This runs much faster than make.
53 #ninja = true
54
55 # LLVM targets to build support for.
56 # Note: this is NOT related to Rust compilation targets. However, as Rust is
57 # dependent on LLVM for code generation, turning targets off here WILL lead to
58 # the resulting rustc being unable to compile for the disabled architectures.
59 # Also worth pointing out is that, in case support for new targets are added to
60 # LLVM, enabling them here doesn't mean Rust is automatically gaining said
61 # support. You'll need to write a target specification at least, and most
62 # likely, teach rustc about the C ABI of the target. Get in touch with the
63 # Rust team and file an issue if you need assistance in porting!
64 #targets = "AArch64;ARM;Hexagon;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86"
65
66 # LLVM experimental targets to build support for. These targets are specified in
67 # the same format as above, but since these targets are experimental, they are
68 # not built by default and the experimental Rust compilation targets that depend
69 # on them will not work unless the user opts in to building them.
70 #experimental-targets = "AVR"
71
72 # Cap the number of parallel linker invocations when compiling LLVM.
73 # This can be useful when building LLVM with debug info, which significantly
74 # increases the size of binaries and consequently the memory required by
75 # each linker process.
76 # If absent or 0, linker invocations are treated like any other job and
77 # controlled by rustbuild's -j parameter.
78 #link-jobs = 0
79
80 # When invoking `llvm-config` this configures whether the `--shared` argument is
81 # passed to prefer linking to shared libraries.
82 #link-shared = false
83
84 # When building llvm, this configures what is being appended to the version.
85 # The default is "-rust-$version-$channel", except for dev channel where rustc
86 # version number is omitted. To use LLVM version as is, provide an empty string.
87 #version-suffix = "-rust-dev"
88
89 # On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
90 # with clang-cl, so this is special in that it only compiles LLVM with clang-cl
91 #clang-cl = '/path/to/clang-cl.exe'
92
93 # Pass extra compiler and linker flags to the LLVM CMake build.
94 #cflags = "-fextra-flag"
95 #cxxflags = "-fextra-flag"
96 #ldflags = "-Wl,extra-flag"
97
98 # Use libc++ when building LLVM instead of libstdc++. This is the default on
99 # platforms already use libc++ as the default C++ library, but this option
100 # allows you to use libc++ even on platforms when it's not. You need to ensure
101 # that your host compiler ships with libc++.
102 #use-libcxx = true
103
104 # The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.
105 #use-linker = "lld"
106
107 # Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`
108 #allow-old-toolchain = false
109
110 # =============================================================================
111 # General build configuration options
112 # =============================================================================
113 [build]
114
115 # Build triple for the original snapshot compiler. This must be a compiler that
116 # nightlies are already produced for. The current platform must be able to run
117 # binaries of this build triple and the nightly will be used to bootstrap the
118 # first compiler.
119 #
120 # Defaults to host platform
121 #build = "x86_64-unknown-linux-gnu"
122
123 # In addition to the build triple, other triples to produce full compiler
124 # toolchains for. Each of these triples will be bootstrapped from the build
125 # triple and then will continue to bootstrap themselves. This platform must
126 # currently be able to run all of the triples provided here.
127 #
128 # Defaults to just the build triple
129 #host = ["x86_64-unknown-linux-gnu"]
130
131 # In addition to all host triples, other triples to produce the standard library
132 # for. Each host triple will be used to produce a copy of the standard library
133 # for each target triple.
134 #
135 # Defaults to just the build triple
136 #target = ["x86_64-unknown-linux-gnu"]
137
138 # Use this directory to store build artifacts.
139 # You can use "$ROOT" to indicate the root of the git repository.
140 #build-dir = "build"
141
142 # Instead of downloading the src/stage0.txt version of Cargo specified, use
143 # this Cargo binary instead to build all Rust code
144 #cargo = "/path/to/bin/cargo"
145
146 # Instead of downloading the src/stage0.txt version of the compiler
147 # specified, use this rustc binary instead as the stage0 snapshot compiler.
148 #rustc = "/path/to/bin/rustc"
149
150 # Instead of download the src/stage0.txt version of rustfmt specified,
151 # use this rustfmt binary instead as the stage0 snapshot rustfmt.
152 #rustfmt = "/path/to/bin/rustfmt"
153
154 # Flag to specify whether any documentation is built. If false, rustdoc and
155 # friends will still be compiled but they will not be used to generate any
156 # documentation.
157 #docs = true
158
159 # Indicate whether the compiler should be documented in addition to the standard
160 # library and facade crates.
161 #compiler-docs = false
162
163 # Indicate whether git submodules are managed and updated automatically.
164 #submodules = true
165
166 # Update git submodules only when the checked out commit in the submodules differs
167 # from what is committed in the main rustc repo.
168 #fast-submodules = true
169
170 # The path to (or name of) the GDB executable to use. This is only used for
171 # executing the debuginfo test suite.
172 #gdb = "gdb"
173
174 # The node.js executable to use. Note that this is only used for the emscripten
175 # target when running tests, otherwise this can be omitted.
176 #nodejs = "node"
177
178 # Python interpreter to use for various tasks throughout the build, notably
179 # rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
180 #
181 # Defaults to the Python interpreter used to execute x.py
182 #python = "python"
183
184 # Force Cargo to check that Cargo.lock describes the precise dependency
185 # set that all the Cargo.toml files create, instead of updating it.
186 #locked-deps = false
187
188 # Indicate whether the vendored sources are used for Rust dependencies or not
189 #vendor = false
190
191 # Typically the build system will build the Rust compiler twice. The second
192 # compiler, however, will simply use its own libraries to link against. If you
193 # would rather to perform a full bootstrap, compiling the compiler three times,
194 # then you can set this option to true. You shouldn't ever need to set this
195 # option to true.
196 #full-bootstrap = false
197
198 # Enable a build of the extended Rust tool set which is not only the compiler
199 # but also tools such as Cargo. This will also produce "combined installers"
200 # which are used to install Rust and Cargo together. This is disabled by
201 # default. The `tools` option (immediately below) specifies which tools should
202 # be built if `extended = true`.
203 #extended = false
204
205 # Installs chosen set of extended tools if `extended = true`. By default builds all.
206 # If chosen tool failed to build the installation fails. If `extended = false`, this
207 # option is ignored.
208 #tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]
209
210 # Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
211 #verbose = 0
212
213 # Build the sanitizer runtimes
214 #sanitizers = false
215
216 # Build the profiler runtime (required when compiling with options that depend
217 # on this runtime, such as `-C profile-generate` or `-Z instrument-coverage`).
218 #profiler = false
219
220 # Indicates whether the native libraries linked into Cargo will be statically
221 # linked or not.
222 #cargo-native-static = false
223
224 # Run the build with low priority, by setting the process group's "nice" value
225 # to +10 on Unix platforms, and by using a "low priority" job object on Windows.
226 #low-priority = false
227
228 # Arguments passed to the `./configure` script, used during distcheck. You
229 # probably won't fill this in but rather it's filled in by the `./configure`
230 # script.
231 #configure-args = []
232
233 # Indicates that a local rebuild is occurring instead of a full bootstrap,
234 # essentially skipping stage0 as the local compiler is recompiling itself again.
235 #local-rebuild = false
236
237 # Print out how long each rustbuild step took (mostly intended for CI and
238 # tracking over time)
239 #print-step-timings = false
240
241 # =============================================================================
242 # General install configuration options
243 # =============================================================================
244 [install]
245
246 # Instead of installing to /usr/local, install to this path instead.
247 #prefix = "/usr/local"
248
249 # Where to install system configuration files
250 # If this is a relative path, it will get installed in `prefix` above
251 #sysconfdir = "/etc"
252
253 # Where to install documentation in `prefix` above
254 #docdir = "share/doc/rust"
255
256 # Where to install binaries in `prefix` above
257 #bindir = "bin"
258
259 # Where to install libraries in `prefix` above
260 #libdir = "lib"
261
262 # Where to install man pages in `prefix` above
263 #mandir = "share/man"
264
265 # Where to install data in `prefix` above (currently unused)
266 #datadir = "share"
267
268 # Where to install additional info in `prefix` above (currently unused)
269 #infodir = "share/info"
270
271 # Where to install local state (currently unused)
272 # If this is a relative path, it will get installed in `prefix` above
273 #localstatedir = "/var/lib"
274
275 # =============================================================================
276 # Options for compiling Rust code itself
277 # =============================================================================
278 [rust]
279
280 # Whether or not to optimize the compiler and standard library.
281 # WARNING: Building with optimize = false is NOT SUPPORTED. Due to bootstrapping,
282 # building without optimizations takes much longer than optimizing. Further, some platforms
283 # fail to build without this optimization (c.f. #65352).
284 #optimize = true
285
286 # Indicates that the build should be configured for debugging Rust. A
287 # `debug`-enabled compiler and standard library will be somewhat
288 # slower (due to e.g. checking of debug assertions) but should remain
289 # usable.
290 #
291 # Note: If this value is set to `true`, it will affect a number of
292 #       configuration options below as well, if they have been left
293 #       unconfigured in this file.
294 #
295 # Note: changes to the `debug` setting do *not* affect `optimize`
296 #       above. In theory, a "maximally debuggable" environment would
297 #       set `optimize` to `false` above to assist the introspection
298 #       facilities of debuggers like lldb and gdb. To recreate such an
299 #       environment, explicitly set `optimize` to `false` and `debug`
300 #       to `true`. In practice, everyone leaves `optimize` set to
301 #       `true`, because an unoptimized rustc with debugging
302 #       enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
303 #       reported a 25x slowdown) and bootstrapping the supposed
304 #       "maximally debuggable" environment (notably libstd) takes
305 #       hours to build.
306 #
307 #debug = false
308
309 # Number of codegen units to use for each compiler invocation. A value of 0
310 # means "the number of cores on this machine", and 1+ is passed through to the
311 # compiler.
312 #codegen-units = 1
313
314 # Sets the number of codegen units to build the standard library with,
315 # regardless of what the codegen-unit setting for the rest of the compiler is.
316 #codegen-units-std = 1
317
318 # Whether or not debug assertions are enabled for the compiler and standard
319 # library. Debug assertions control the maximum log level used by rustc. When
320 # enabled calls to `trace!` and `debug!` macros are preserved in the compiled
321 # binary, otherwise they are omitted.
322 #
323 # Defaults to rust.debug value
324 #debug-assertions = debug
325
326 # Whether or not debug assertions are enabled for the standard library.
327 # Overrides the `debug-assertions` option, if defined.
328 #
329 # Defaults to rust.debug-assertions value
330 #debug-assertions-std = debug-assertions
331
332 # Whether or not to leave debug! and trace! calls in the rust binary.
333 # Overrides the `debug-assertions` option, if defined.
334
335 # Defaults to rust.debug-assertions value
336 #debug-logging = debug-assertions
337
338 # Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
339 # `0` - no debug info
340 # `1` - line tables only - sufficient to generate backtraces that include line
341 #       information and inlined functions, set breakpoints at source code
342 #       locations, and step through execution in a debugger.
343 # `2` - full debug info with variable and type information
344 # Can be overridden for specific subsets of Rust code (rustc, std or tools).
345 # Debuginfo for tests run with compiletest is not controlled by this option
346 # and needs to be enabled separately with `debuginfo-level-tests`.
347 #
348 # Note that debuginfo-level = 2 generates several gigabytes of debuginfo
349 # and will slow down the linking process significantly.
350 #
351 # Defaults to 1 if debug is true
352 #debuginfo-level = 0
353
354 # Debuginfo level for the compiler.
355 #
356 # Defaults to rust.debuginfo-level value
357 #debuginfo-level-rustc = 0
358
359 # Debuginfo level for the standard library.
360 #
361 # Defaults to rust.debuginfo-level value
362 #debuginfo-level-std = 0
363
364 # Debuginfo level for the tools.
365 #
366 # Defaults to rust.debuginfo-level value
367 #debuginfo-level-tools = 0
368
369 # Debuginfo level for the test suites run with compiletest.
370 # FIXME(#61117): Some tests fail when this option is enabled.
371 #debuginfo-level-tests = 0
372
373 # Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
374 #backtrace = true
375
376 # Whether to always use incremental compilation when building rustc
377 #incremental = false
378
379 # Build a multi-threaded rustc
380 #parallel-compiler = false
381
382 # The default linker that will be hard-coded into the generated compiler for
383 # targets that don't specify linker explicitly in their target specifications.
384 # Note that this is not the linker used to link said compiler.
385 #default-linker = "cc"
386
387 # The "channel" for the Rust build to produce. The stable/beta channels only
388 # allow using stable features, whereas the nightly and dev channels allow using
389 # nightly features
390 #channel = "dev"
391
392 # The root location of the musl installation directory.
393 #musl-root = "..."
394
395 # By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
396 # platforms to ensure that the compiler is usable by default from the build
397 # directory (as it links to a number of dynamic libraries). This may not be
398 # desired in distributions, for example.
399 #rpath = true
400
401 # Emits extra output from tests so test failures are debuggable just from logfiles.
402 #verbose-tests = false
403
404 # Flag indicating whether tests are compiled with optimizations (the -O flag).
405 #optimize-tests = true
406
407 # Flag indicating whether codegen tests will be run or not. If you get an error
408 # saying that the FileCheck executable is missing, you may want to disable this.
409 # Also see the target's llvm-filecheck option.
410 #codegen-tests = true
411
412 # Flag indicating whether git info will be retrieved from .git automatically.
413 # Having the git information can cause a lot of rebuilds during development.
414 # Note: If this attribute is not explicitly set (e.g. if left commented out) it
415 # will default to true if channel = "dev", but will default to false otherwise.
416 #ignore-git = true
417
418 # When creating source tarballs whether or not to create a source tarball.
419 #dist-src = false
420
421 # After building or testing extended tools (e.g. clippy and rustfmt), append the
422 # result (broken, compiling, testing) into this JSON file.
423 #save-toolstates = "/path/to/toolstates.json"
424
425 # This is an array of the codegen backends that will be compiled for the rustc
426 # that's being compiled. The default is to only build the LLVM codegen backend,
427 # and currently the only standard option supported is `"llvm"`
428 #codegen-backends = ["llvm"]
429
430 # Indicates whether LLD will be compiled and made available in the sysroot for
431 # rustc to execute.
432 #lld = false
433
434 # Indicates whether LLD will be used to link Rust crates during bootstrap on
435 # supported platforms. The LLD from the bootstrap distribution will be used
436 # and not the LLD compiled during the bootstrap.
437 #
438 # LLD will not be used if we're cross linking or running tests.
439 #
440 # Explicitly setting the linker for a target will override this option when targeting MSVC.
441 #use-lld = false
442
443 # Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
444 # sysroot.
445 #llvm-tools = false
446
447 # Whether to deny warnings in crates
448 #deny-warnings = true
449
450 # Print backtrace on internal compiler errors during bootstrap
451 #backtrace-on-ice = false
452
453 # Whether to verify generated LLVM IR
454 #verify-llvm-ir = false
455
456 # Compile the compiler with a non-default ThinLTO import limit. This import
457 # limit controls the maximum size of functions imported by ThinLTO. Decreasing
458 # will make code compile faster at the expense of lower runtime performance.
459 # If `incremental` is set to true above, the import limit will default to 10
460 # instead of LLVM's default of 100.
461 #thin-lto-import-instr-limit = 100
462
463 # Map debuginfo paths to `/rust/$sha/...`, generally only set for releases
464 #remap-debuginfo = false
465
466 # Link the compiler against `jemalloc`, where on Linux and OSX it should
467 # override the default allocator for rustc and LLVM.
468 #jemalloc = false
469
470 # Run tests in various test suites with the "nll compare mode" in addition to
471 # running the tests in normal mode. Largely only used on CI and during local
472 # development of NLL
473 #test-compare-mode = false
474
475 # Use LLVM libunwind as the implementation for Rust's unwinder.
476 #llvm-libunwind = false
477
478 # Enable Windows Control Flow Guard checks in the standard library.
479 # This only applies from stage 1 onwards, and only for Windows targets.
480 #control-flow-guard = false
481
482 # Enable symbol-mangling-version v0. This can be helpful when profiling rustc,
483 # as generics will be preserved in symbols (rather than erased into opaque T).
484 #new-symbol-mangling = false
485
486 # =============================================================================
487 # Options for specific targets
488 #
489 # Each of the following options is scoped to the specific target triple in
490 # question and is used for determining how to compile each target.
491 # =============================================================================
492 [target.x86_64-unknown-linux-gnu]
493
494 # C compiler to be used to compiler C code. Note that the
495 # default value is platform specific, and if not specified it may also depend on
496 # what platform is crossing to what platform.
497 #cc = "cc"
498
499 # C++ compiler to be used to compiler C++ code (e.g. LLVM and our LLVM shims).
500 # This is only used for host targets.
501 #cxx = "c++"
502
503 # Archiver to be used to assemble static libraries compiled from C/C++ code.
504 # Note: an absolute path should be used, otherwise LLVM build will break.
505 #ar = "ar"
506
507 # Ranlib to be used to assemble static libraries compiled from C/C++ code.
508 # Note: an absolute path should be used, otherwise LLVM build will break.
509 #ranlib = "ranlib"
510
511 # Linker to be used to link Rust code. Note that the
512 # default value is platform specific, and if not specified it may also depend on
513 # what platform is crossing to what platform.
514 # Setting this will override the `use-lld` option for Rust code when targeting MSVC.
515 #linker = "cc"
516
517 # Path to the `llvm-config` binary of the installation of a custom LLVM to link
518 # against. Note that if this is specified we don't compile LLVM at all for this
519 # target.
520 #llvm-config = "../path/to/llvm/root/bin/llvm-config"
521
522 # Normally the build system can find LLVM's FileCheck utility, but if
523 # not, you can specify an explicit file name for it.
524 #llvm-filecheck = "/path/to/FileCheck"
525
526 # If this target is for Android, this option will be required to specify where
527 # the NDK for the target lives. This is used to find the C compiler to link and
528 # build native code.
529 #android-ndk = "/path/to/ndk"
530
531 # Force static or dynamic linkage of the standard library for this target. If
532 # this target is a host for rustc, this will also affect the linkage of the
533 # compiler itself. This is useful for building rustc on targets that normally
534 # only use static libraries. If unset, the target's default linkage is used.
535 #crt-static = false
536
537 # The root location of the musl installation directory. The library directory
538 # will also need to contain libunwind.a for an unwinding implementation. Note
539 # that this option only makes sense for musl targets that produce statically
540 # linked binaries
541 #musl-root = "..."
542
543 # The full path to the musl libdir.
544 #musl-libdir = musl-root/lib
545
546 # The root location of the `wasm32-wasi` sysroot.
547 #wasi-root = "..."
548
549 # Used in testing for configuring where the QEMU images are located, you
550 # probably don't want to use this.
551 #qemu-rootfs = "..."
552
553 # =============================================================================
554 # Distribution options
555 #
556 # These options are related to distribution, mostly for the Rust project itself.
557 # You probably won't need to concern yourself with any of these options
558 # =============================================================================
559 [dist]
560
561 # This is the folder of artifacts that the build system will sign. All files in
562 # this directory will be signed with the default gpg key using the system `gpg`
563 # binary. The `asc` and `sha256` files will all be output into the standard dist
564 # output folder (currently `build/dist`)
565 #
566 # This folder should be populated ahead of time before the build system is
567 # invoked.
568 #sign-folder = "path/to/folder/to/sign"
569
570 # This is a file which contains the password of the default gpg key. This will
571 # be passed to `gpg` down the road when signing all files in `sign-folder`
572 # above. This should be stored in plaintext.
573 #gpg-password-file = "path/to/gpg/password"
574
575 # The remote address that all artifacts will eventually be uploaded to. The
576 # build system generates manifests which will point to these urls, and for the
577 # manifests to be correct they'll have to have the right URLs encoded.
578 #
579 # Note that this address should not contain a trailing slash as file names will
580 # be appended to it.
581 #upload-addr = "https://example.com/folder"
582
583 # Whether to build a plain source tarball to upload
584 # We disable that on Windows not to override the one already uploaded on S3
585 # as the one built on Windows will contain backslashes in paths causing problems
586 # on linux
587 #src-tarball = true
588 #
589
590 # Whether to allow failures when building tools
591 #missing-tools = false