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