Skip to content

Commit 818d97d

Browse files
committed
Resync config.toml and suggest better settings
1 parent d3e682e commit 818d97d

File tree

1 file changed

+44
-15
lines changed

1 file changed

+44
-15
lines changed

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

+44-15
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,53 @@ Then you will want to open up the file and change the following
2929
settings (and possibly others, such as `llvm.ccache`):
3030

3131
```toml
32-
[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`.
36-
assertions = true
37-
3832
[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.
33+
# Indicates that the build should be configured for debugging Rust. A
34+
# `debug`-enabled compiler and standard library will be somewhat
35+
# slower (due to e.g. checking of debug assertions) but should remain
36+
# usable.
37+
#
38+
# Note: If this value is set to `true`, it will affect a number of
39+
# configuration options below as well, if they have been left
40+
# unconfigured in this file.
41+
#
42+
# Note: changes to the `debug` setting do *not* affect `optimize`
43+
# above. In theory, a "maximally debuggable" environment would
44+
# set `optimize` to `false` above to assist the introspection
45+
# facilities of debuggers like lldb and gdb. To recreate such an
46+
# environment, explicitly set `optimize` to `false` and `debug`
47+
# to `true`. In practice, everyone leaves `optimize` set to
48+
# `true`, because an unoptimized rustc with debugging
49+
# enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
50+
# reported a 25x slowdown) and bootstrapping the supposed
51+
# "maximally debuggable" environment (notably libstd) takes
52+
# hours to build.
53+
#
54+
debug = true
55+
56+
# Number of codegen units to use for each compiler invocation. A value of 0
57+
# means "the number of cores on this machine", and 1+ is passed through to the
58+
# compiler.
4159
codegen-units = 0
4260

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
61+
# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
62+
# `0` - no debug info
63+
# `1` - line tables only - sufficient to generate backtraces that include line
64+
# information and inlined functions, set breakpoints at source code
65+
# locations, and step through execution in a debugger.
66+
# `2` - full debug info with variable and type information
67+
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
68+
# Debuginfo for tests run with compiletest is not controlled by this option
69+
# and needs to be enabled separately with `debuginfo-level-tests`.
70+
#
71+
# Defaults to 2 if debug is true
72+
debuginfo-level = 1
73+
74+
# Whether to always use incremental compilation when building rustc
75+
incremental = true
76+
77+
# Emits extra output from tests so test failures are debuggable just from logfiles.
78+
verbose-tests = true
5079
```
5180

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

0 commit comments

Comments
 (0)