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