config.toml.example 21 KB
Newer Older
1 2
# Sample TOML configuration file for building Rust.
#
Alex Burka's avatar
Alex Burka committed
3 4
# To configure rustbuild, copy this file to the directory from which you will be
# running the build, and name it config.toml.
5
#
6 7 8 9 10 11 12 13 14 15 16 17 18 19
# All options are commented out by default in this file, and they're commented
# out with their default values. The build system by default looks for
# `config.toml` in the current directory of a build for build configuration, but
# a custom configuration file can also be specified with `--config` to the build
# system.

# =============================================================================
# Tweaking how LLVM is compiled
# =============================================================================
[llvm]

# Indicates whether the LLVM build is a Release or Debug build
#optimize = true

20 21 22 23 24 25
# Indicates whether LLVM should be built with ThinLTO. Note that this will
# only succeed if you use clang, lld, llvm-ar, and llvm-ranlib in your C/C++
# toolchain (see the `cc`, `cxx`, `linker`, `ar`, and `ranlib` options below).
# More info at: https://clang.llvm.org/docs/ThinLTO.html#clang-bootstrap
#thin-lto = false

26 27 28
# Indicates whether an LLVM Release build should include debug info
#release-debuginfo = false

29 30 31 32 33
# Indicates whether the LLVM assertions are enabled or not
#assertions = false

# Indicates whether ccache is used when building LLVM
#ccache = false
34 35
# or alternatively ...
#ccache = "/path/to/ccache"
36 37 38 39

# If an external LLVM root is specified, we automatically check the version by
# default to make sure it's within the range that we're expecting, but setting
# this flag will indicate that this version check should not be done.
40
#version-check = true
41 42 43 44 45 46 47 48 49 50

# Link libstdc++ statically into the librustc_llvm instead of relying on a
# dynamic version to be available.
#static-libstdcpp = false

# Tell the LLVM build system to use Ninja instead of the platform default for
# the generated build system. This can sometimes be faster than make, for
# example.
#ninja = false

51 52 53 54 55 56 57 58 59
# LLVM targets to build support for.
# Note: this is NOT related to Rust compilation targets. However, as Rust is
# dependent on LLVM for code generation, turning targets off here WILL lead to
# the resulting rustc being unable to compile for the disabled architectures.
# Also worth pointing out is that, in case support for new targets are added to
# LLVM, enabling them here doesn't mean Rust is automatically gaining said
# support. You'll need to write a target specification at least, and most
# likely, teach rustc about the C ABI of the target. Get in touch with the
# 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 63 64
# LLVM experimental targets to build support for. These targets are specified in
# the same format as above, but since these targets are experimental, they are
# 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
David Craven's avatar
David Craven committed
66
# `WebAssembly` and `RISCV` targets are enabled when compiling LLVM from scratch.
David Craven's avatar
David Craven committed
67
#experimental-targets = "WebAssembly;RISCV"
68

69 70 71 72 73 74 75 76
# Cap the number of parallel linker invocations when compiling LLVM.
# This can be useful when building LLVM with debug info, which significantly
# increases the size of binaries and consequently the memory required by
# each linker process.
# If absent or 0, linker invocations are treated like any other job and
# controlled by rustbuild's -j parameter.
#link-jobs = 0

77 78 79 80
# When invoking `llvm-config` this configures whether the `--shared` argument is
# passed to prefer linking to shared libraries.
#link-shared = false

81 82 83 84
# When building llvm, this configures what is being appended to the version.
# If absent, we let the version as-is.
#version-suffix = "-rust"

85 86 87 88
# On MSVC you can compile LLVM with clang-cl, but the test suite doesn't pass
# with clang-cl, so this is special in that it only compiles LLVM with clang-cl
#clang-cl = '/path/to/clang-cl.exe'

89 90 91 92 93
# Pass extra compiler and linker flags to the LLVM CMake build.
#cflags = "-fextra-flag"
#cxxflags = "-fextra-flag"
#ldflags = "-Wl,extra-flag"

94 95 96 97 98 99
# Use libc++ when building LLVM instead of libstdc++. This is the default on
# platforms already use libc++ as the default C++ library, but this option
# allows you to use libc++ even on platforms when it's not. You need to ensure
# that your host compiler ships with libc++.
#use-libcxx = true

100 101 102
# The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake.
#use-linker = "lld"

103 104
# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES`
#allow-old-toolchain = false
105

106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127
# =============================================================================
# General build configuration options
# =============================================================================
[build]

# Build triple for the original snapshot compiler. This must be a compiler that
# nightlies are already produced for. The current platform must be able to run
# binaries of this build triple and the nightly will be used to bootstrap the
# first compiler.
#build = "x86_64-unknown-linux-gnu"    # defaults to your host platform

# In addition to the build triple, other triples to produce full compiler
# toolchains for. Each of these triples will be bootstrapped from the build
# triple and then will continue to bootstrap themselves. This platform must
# currently be able to run all of the triples provided here.
#host = ["x86_64-unknown-linux-gnu"]   # defaults to just the build triple

# In addition to all host triples, other triples to produce the standard library
# for. Each host triple will be used to produce a copy of the standard library
# for each target triple.
#target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple

128
# Instead of downloading the src/stage0.txt version of Cargo specified, use
129 130 131
# this Cargo binary instead to build all Rust code
#cargo = "/path/to/bin/cargo"

132
# Instead of downloading the src/stage0.txt version of the compiler
133 134 135 136 137 138 139 140 141 142 143 144
# specified, use this rustc binary instead as the stage0 snapshot compiler.
#rustc = "/path/to/bin/rustc"

# Flag to specify whether any documentation is built. If false, rustdoc and
# friends will still be compiled but they will not be used to generate any
# documentation.
#docs = true

# Indicate whether the compiler should be documented in addition to the standard
# library and facade crates.
#compiler-docs = false

145 146 147
# Indicate whether submodules are managed and updated automatically.
#submodules = true

148 149 150 151
# Update submodules only when the checked out commit in the submodules differs
# from what is committed in the main rustc repo.
#fast-submodules = true

152 153
# The path to (or name of) the GDB executable to use. This is only used for
# executing the debuginfo test suite.
154 155
#gdb = "gdb"

156 157 158 159 160 161 162
# The node.js executable to use. Note that this is only used for the emscripten
# target when running tests, otherwise this can be omitted.
#nodejs = "node"

# Python interpreter to use for various tasks throughout the build, notably
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
# Note that Python 2 is currently required.
163 164 165
#
# Defaults to python2.7, then python2. If neither executable can be found, then
# it defaults to the Python interpreter used to execute x.py.
166 167
#python = "python2.7"

168 169 170 171
# Force Cargo to check that Cargo.lock describes the precise dependency
# set that all the Cargo.toml files create, instead of updating it.
#locked-deps = false

172 173 174
# Indicate whether the vendored sources are used for Rust dependencies or not
#vendor = false

175 176 177 178 179 180 181
# Typically the build system will build the rust compiler twice. The second
# compiler, however, will simply use its own libraries to link against. If you
# would rather to perform a full bootstrap, compiling the compiler three times,
# then you can set this option to true. You shouldn't ever need to set this
# option to true.
#full-bootstrap = false

182 183 184 185
# Enable a build of the extended rust tool set which is not only the compiler
# but also tools such as Cargo. This will also produce "combined installers"
# which are used to install Rust and Cargo together. This is disabled by
# default.
186 187
#extended = false

188 189
# Installs chosen set of extended tools if enables. By default builds all.
# If chosen tool failed to build the installation fails.
190
#tools = ["cargo", "rls", "clippy", "rustfmt", "analysis", "src"]
191

192 193 194
# Verbosity level: 0 == not verbose, 1 == verbose, 2 == very verbose
#verbose = 0

195 196 197
# Build the sanitizer runtimes
#sanitizers = false

198 199 200
# Build the profiler runtime
#profiler = false

201 202 203
# Indicates whether the native libraries linked into Cargo will be statically
# linked or not.
#cargo-native-static = false
204

205 206 207
# Run the build with low priority, by setting the process group's "nice" value
# to +10 on Unix platforms, and by using a "low priority" job object on Windows.
#low-priority = false
208

209 210 211 212 213
# Arguments passed to the `./configure` script, used during distcheck. You
# probably won't fill this in but rather it's filled in by the `./configure`
# script.
#configure-args = []

214
# Indicates that a local rebuild is occurring instead of a full bootstrap,
215 216 217
# essentially skipping stage0 as the local compiler is recompiling itself again.
#local-rebuild = false

218 219 220 221
# Print out how long each rustbuild step took (mostly intended for CI and
# tracking over time)
#print-step-timings = false

222 223 224 225 226 227
# =============================================================================
# General install configuration options
# =============================================================================
[install]

# Instead of installing to /usr/local, install to this path instead.
228 229
#prefix = "/usr/local"

230 231 232 233
# Where to install system configuration files
# If this is a relative path, it will get installed in `prefix` above
#sysconfdir = "/etc"

234 235 236 237 238 239
# Where to install documentation in `prefix` above
#docdir = "share/doc/rust"

# Where to install binaries in `prefix` above
#bindir = "bin"

240 241 242 243 244 245
# Where to install libraries in `prefix` above
#libdir = "lib"

# Where to install man pages in `prefix` above
#mandir = "share/man"

246 247 248 249 250 251 252 253 254 255
# Where to install data in `prefix` above (currently unused)
#datadir = "share"

# Where to install additional info in `prefix` above (currently unused)
#infodir = "share/info"

# Where to install local state (currently unused)
# If this is a relative path, it will get installed in `prefix` above
#localstatedir = "/var/lib"

256 257 258 259 260
# =============================================================================
# Options for compiling Rust code itself
# =============================================================================
[rust]

261 262
# Whether or not to optimize the compiler and standard library.
#
263 264
# Note: the slowness of the non optimized compiler compiling itself usually
#       outweighs the time gains in not doing optimizations, therefore a
265
#       full bootstrap takes much more time with `optimize` set to false.
266 267
#optimize = true

268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290
# Indicates that the build should be configured for debugging Rust. A
# `debug`-enabled compiler and standard library will be somewhat
# slower (due to e.g. checking of debug assertions) but should remain
# usable.
#
# Note: If this value is set to `true`, it will affect a number of
#       configuration options below as well, if they have been left
#       unconfigured in this file.
#
# Note: changes to the `debug` setting do *not* affect `optimize`
#       above. In theory, a "maximally debuggable" environment would
#       set `optimize` to `false` above to assist the introspection
#       facilities of debuggers like lldb and gdb. To recreate such an
#       environment, explicitly set `optimize` to `false` and `debug`
#       to `true`. In practice, everyone leaves `optimize` set to
#       `true`, because an unoptimized rustc with debugging
#       enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
#       reported a 25x slowdown) and bootstrapping the supposed
#       "maximally debuggable" environment (notably libstd) takes
#       hours to build.
#
#debug = false

291 292 293 294 295
# Number of codegen units to use for each compiler invocation. A value of 0
# means "the number of cores on this machine", and 1+ is passed through to the
# compiler.
#codegen-units = 1

296 297 298 299
# Sets the number of codegen units to build the standard library with,
# regardless of what the codegen-unit setting for the rest of the compiler is.
#codegen-units-std = 1

300
# Whether or not debug assertions are enabled for the compiler and standard
wangcong's avatar
wangcong committed
301
# library.
302 303 304 305 306
#debug-assertions = false

# Whether or not debuginfo is emitted
#debuginfo = false

307 308 309
# Whether or not line number debug information is emitted
#debuginfo-lines = false

310 311 312 313 314
# Whether or not to only build debuginfo for the standard library if enabled.
# If enabled, this will not compile the compiler with debuginfo, just the
# standard library.
#debuginfo-only-std = false

315
# Enable debuginfo for the extended tools: cargo, rls, rustfmt
316
# Adding debuginfo makes them several times larger.
317 318
#debuginfo-tools = false

319 320 321
# Whether or not `panic!`s generate backtraces (RUST_BACKTRACE)
#backtrace = true

322 323 324
# Whether to always use incremental compilation when building rustc
#incremental = false

John Kåre Alsaker's avatar
John Kåre Alsaker committed
325
# Build a multi-threaded rustc
326
#parallel-compiler = false
327

328 329 330
# The default linker that will be hard-coded into the generated compiler for
# targets that don't specify linker explicitly in their target specifications.
# Note that this is not the linker used to link said compiler.
331 332 333 334 335 336 337 338 339 340 341 342 343
#default-linker = "cc"

# The "channel" for the Rust build to produce. The stable/beta channels only
# allow using stable features, whereas the nightly and dev channels allow using
# nightly features
#channel = "dev"

# By default the `rustc` executable is built with `-Wl,-rpath` flags on Unix
# platforms to ensure that the compiler is usable by default from the build
# directory (as it links to a number of dynamic libraries). This may not be
# desired in distributions, for example.
#rpath = true

344 345 346
# Emits extraneous output from tests to ensure that failures of the test
# harness are debuggable just from logfiles.
#verbose-tests = false
347

348 349 350 351 352
# Flag indicating whether tests are compiled with optimizations (the -O flag) or
# with debuginfo (the -g flag)
#optimize-tests = true
#debuginfo-tests = true

353 354
# Flag indicating whether codegen tests will be run or not. If you get an error
# saying that the FileCheck executable is missing, you may want to disable this.
355
# Also see the target's llvm-filecheck option.
356 357
#codegen-tests = true

358
# Flag indicating whether git info will be retrieved from .git automatically.
359
# Having the git information can cause a lot of rebuilds during development.
360
# Note: If this attribute is not explicitly set (e.g. if left commented out) it
361 362
# will default to true if channel = "dev", but will default to false otherwise.
#ignore-git = true
363

364 365 366
# When creating source tarballs whether or not to create a source tarball.
#dist-src = false

367 368 369 370
# Whether to also run the Miri tests suite when running tests.
# As a side-effect also generates MIR for all libraries.
#test-miri = false

371 372 373 374
# After building or testing extended tools (e.g. clippy and rustfmt), append the
# result (broken, compiling, testing) into this JSON file.
#save-toolstates = "/path/to/toolstates.json"

375 376 377 378 379 380 381
# This is an array of the codegen backends that will be compiled for the rustc
# that's being compiled. The default is to only build the LLVM codegen backend,
# but you can also optionally enable the "emscripten" backend for asm.js or
# make this an empty array (but that probably won't get too far in the
# bootstrap)
#codegen-backends = ["llvm"]

382 383 384
# This is the name of the directory in which codegen backends will get installed
#codegen-backends-dir = "codegen-backends"

385 386
# Flag indicating whether `libstd` calls an imported function to handle basic IO
# when targeting WebAssembly. Enable this to debug tests for the `wasm32-unknown-unknown`
387 388 389
# target, as without this option the test output will not be captured.
#wasm-syscall = false

390 391 392 393
# Indicates whether LLD will be compiled and made available in the sysroot for
# rustc to execute.
#lld = false

394 395 396 397
# Indicates whether some LLVM tools, like llvm-objdump, will be made available in the
# sysroot.
#llvm-tools = false

Tom Tromey's avatar
Tom Tromey committed
398 399 400 401
# Indicates whether LLDB will be made available in the sysroot.
# This is only built if LLVM is also being built.
#lldb = false

402 403 404
# Whether to deny warnings in crates
#deny-warnings = true

John Kåre Alsaker's avatar
John Kåre Alsaker committed
405 406 407
# Print backtrace on internal compiler errors during bootstrap
#backtrace-on-ice = false

408 409 410
# Whether to verify generated LLVM IR
#verify-llvm-ir = false

411 412 413 414
# Map all debuginfo paths for libstd and crates to `/rust/$sha/$crate/...`,
# generally only set for releases
#remap-debuginfo = false

415 416 417 418
# Link the compiler against `jemalloc`, where on Linux and OSX it should
# override the default allocator for rustc and LLVM.
#jemalloc = false

419 420 421 422 423
# Run tests in various test suites with the "nll compare mode" in addition to
# running the tests in normal mode. Largely only used on CI and during local
# development of NLL
#test-compare-mode = false

424 425 426
# Use LLVM libunwind as the implementation for Rust's unwinder.
#llvm-libunwind = false

427 428 429 430 431 432 433 434
# =============================================================================
# Options for specific targets
#
# Each of the following options is scoped to the specific target triple in
# question and is used for determining how to compile each target.
# =============================================================================
[target.x86_64-unknown-linux-gnu]

435
# C compiler to be used to compiler C code. Note that the
436 437 438 439 440 441 442 443
# default value is platform specific, and if not specified it may also depend on
# what platform is crossing to what platform.
#cc = "cc"

# C++ compiler to be used to compiler C++ code (e.g. LLVM and our LLVM shims).
# This is only used for host targets.
#cxx = "c++"

444 445 446 447
# Archiver to be used to assemble static libraries compiled from C/C++ code.
# Note: an absolute path should be used, otherwise LLVM build will break.
#ar = "ar"

448 449 450 451
# Ranlib to be used to assemble static libraries compiled from C/C++ code.
# Note: an absolute path should be used, otherwise LLVM build will break.
#ranlib = "ranlib"

452 453 454 455 456
# Linker to be used to link Rust code. Note that the
# default value is platform specific, and if not specified it may also depend on
# what platform is crossing to what platform.
#linker = "cc"

457
# Path to the `llvm-config` binary of the installation of a custom LLVM to link
458
# against. Note that if this is specified we don't compile LLVM at all for this
459 460 461
# target.
#llvm-config = "../path/to/llvm/root/bin/llvm-config"

462 463 464 465
# Normally the build system can find LLVM's FileCheck utility, but if
# not, you can specify an explicit file name for it.
#llvm-filecheck = "/path/to/FileCheck"

466 467 468 469
# If this target is for Android, this option will be required to specify where
# the NDK for the target lives. This is used to find the C compiler to link and
# build native code.
#android-ndk = "/path/to/ndk"
470

471 472 473 474 475 476
# Force static or dynamic linkage of the standard library for this target. If
# this target is a host for rustc, this will also affect the linkage of the
# compiler itself. This is useful for building rustc on targets that normally
# only use static libraries. If unset, the target's default linkage is used.
#crt-static = false

477 478 479 480 481
# The root location of the MUSL installation directory. The library directory
# will also need to contain libunwind.a for an unwinding implementation. Note
# that this option only makes sense for MUSL targets that produce statically
# linked binaries
#musl-root = "..."
482

483 484 485
# The root location of the `wasm32-unknown-wasi` sysroot.
#wasi-root = "..."

486 487 488 489
# Used in testing for configuring where the QEMU images are located, you
# probably don't want to use this.
#qemu-rootfs = "..."

490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518
# =============================================================================
# Distribution options
#
# These options are related to distribution, mostly for the Rust project itself.
# You probably won't need to concern yourself with any of these options
# =============================================================================
[dist]

# This is the folder of artifacts that the build system will sign. All files in
# this directory will be signed with the default gpg key using the system `gpg`
# binary. The `asc` and `sha256` files will all be output into the standard dist
# output folder (currently `build/dist`)
#
# This folder should be populated ahead of time before the build system is
# invoked.
#sign-folder = "path/to/folder/to/sign"

# This is a file which contains the password of the default gpg key. This will
# be passed to `gpg` down the road when signing all files in `sign-folder`
# above. This should be stored in plaintext.
#gpg-password-file = "path/to/gpg/password"

# The remote address that all artifacts will eventually be uploaded to. The
# build system generates manifests which will point to these urls, and for the
# manifests to be correct they'll have to have the right URLs encoded.
#
# Note that this address should not contain a trailing slash as file names will
# be appended to it.
#upload-addr = "https://example.com/folder"
519 520 521 522 523 524

# Whether to build a plain source tarball to upload
# We disable that on Windows not to override the one already uploaded on S3
# as the one built on Windows will contain backslashes in paths causing problems
# on linux
#src-tarball = true
525 526 527 528
#

# Whether to allow failures when building tools
#missing-tools = false