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