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