Skip to content

Commit 3078d38

Browse files
spastorinomark-i-m
authored andcommitted
Resync config.toml and suggest better settings
1 parent 2c49ec2 commit 3078d38

File tree

1 file changed

+45
-12
lines changed

1 file changed

+45
-12
lines changed

src/building/how-to-build-and-run.md

+45-12
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,56 @@ settings (and possibly others, such as `llvm.ccache`):
3030

3131
```toml
3232
[llvm]
33-
# Enables LLVM assertions, which will check that the LLVM bitcode generated
34-
# by the compiler is internally consistent. These are particularly helpful
35-
# if you edit `codegen`.
33+
# Indicates whether the LLVM assertions are enabled or not
3634
assertions = true
3735

3836
[rust]
39-
# This will make your build more parallel; it costs a bit of runtime
40-
# performance perhaps (less inlining) but it's worth it.
37+
# Indicates that the build should be configured for debugging Rust. A
38+
# `debug`-enabled compiler and standard library will be somewhat
39+
# slower (due to e.g. checking of debug assertions) but should remain
40+
# usable.
41+
#
42+
# Note: If this value is set to `true`, it will affect a number of
43+
# configuration options below as well, if they have been left
44+
# unconfigured in this file.
45+
#
46+
# Note: changes to the `debug` setting do *not* affect `optimize`
47+
# above. In theory, a "maximally debuggable" environment would
48+
# set `optimize` to `false` above to assist the introspection
49+
# facilities of debuggers like lldb and gdb. To recreate such an
50+
# environment, explicitly set `optimize` to `false` and `debug`
51+
# to `true`. In practice, everyone leaves `optimize` set to
52+
# `true`, because an unoptimized rustc with debugging
53+
# enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
54+
# reported a 25x slowdown) and bootstrapping the supposed
55+
# "maximally debuggable" environment (notably libstd) takes
56+
# hours to build.
57+
#
58+
debug = true
59+
60+
# Number of codegen units to use for each compiler invocation. A value of 0
61+
# means "the number of cores on this machine", and 1+ is passed through to the
62+
# compiler.
4163
codegen-units = 0
4264

43-
# This enables full debuginfo and debug assertions. The line debuginfo is also
44-
# enabled by `debuginfo-level = 1`. Full debuginfo is also enabled by
45-
# `debuginfo-level = 2`. Debug assertions can also be enabled with
46-
# `debug-assertions = true`. Note that `debug = true` will make your build
47-
# slower, so you may want to try individually enabling debuginfo and assertions
48-
# or enable only line debuginfo which is basically free.
49-
debug = true
65+
# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
66+
# `0` - no debug info
67+
# `1` - line tables only - sufficient to generate backtraces that include line
68+
# information and inlined functions, set breakpoints at source code
69+
# locations, and step through execution in a debugger.
70+
# `2` - full debug info with variable and type information
71+
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
72+
# Debuginfo for tests run with compiletest is not controlled by this option
73+
# and needs to be enabled separately with `debuginfo-level-tests`.
74+
#
75+
# Defaults to 2 if debug is true
76+
debuginfo-level = 1
77+
78+
# Whether to always use incremental compilation when building rustc
79+
incremental = true
80+
81+
# Emits extra output from tests so test failures are debuggable just from logfiles.
82+
verbose-tests = true
5083
```
5184

5285
If you have already built `rustc`, then you may have to execute `rm -rf build` for subsequent

0 commit comments

Comments
 (0)