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