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