Skip to content

Commit 40e20e2

Browse files
committed
Added text explaining the (new) relative roles of optimize+debug
and to briefly touch on the theory of debugging rustc versus the practice of such.
1 parent ac4945c commit 40e20e2

File tree

1 file changed

+26
-9
lines changed

1 file changed

+26
-9
lines changed

config.toml.example

+26-9
Original file line numberDiff line numberDiff line change
@@ -243,19 +243,36 @@
243243
# =============================================================================
244244
[rust]
245245

246-
# Indicates that the build should be optimized for debugging Rust. Note that
247-
# this is typically not what you want as it takes an incredibly large amount of
248-
# time to have a debug-mode rustc compile any code (notably libstd). If this
249-
# value is set to `true` it will affect a number of configuration options below
250-
# as well, if unconfigured.
251-
#debug = false
252-
253-
# Whether or not to optimize the compiler and standard library
246+
# Whether or not to optimize the compiler and standard library.
247+
#
254248
# Note: the slowness of the non optimized compiler compiling itself usually
255249
# outweighs the time gains in not doing optimizations, therefore a
256-
# full bootstrap takes much more time with optimize set to false.
250+
# full bootstrap takes much more time with `optimize` set to false.
257251
#optimize = true
258252

253+
# Indicates that the build should be configured for debugging Rust. A
254+
# `debug`-enabled compiler and standard library will be somewhat
255+
# slower (due to e.g. checking of debug assertions) but should remain
256+
# usable.
257+
#
258+
# Note: If this value is set to `true`, it will affect a number of
259+
# configuration options below as well, if they have been left
260+
# unconfigured in this file.
261+
#
262+
# Note: changes to the `debug` setting do *not* affect `optimize`
263+
# above. In theory, a "maximally debuggable" environment would
264+
# set `optimize` to `false` above to assist the introspection
265+
# facilities of debuggers like lldb and gdb. To recreate such an
266+
# environment, explicitly set `optimize` to `false` and `debug`
267+
# to `true`. In practice, everyone leaves `optimize` set to
268+
# `true`, because an unoptimized rustc with debugging
269+
# enabled becomes *unusably slow* (e.g. rust-lang/rust#24840
270+
# reported a 25x slowdown) and bootstrapping the supposed
271+
# "maximally debuggable" environment (notably libstd) takes
272+
# hours to build.
273+
#
274+
#debug = false
275+
259276
# Number of codegen units to use for each compiler invocation. A value of 0
260277
# means "the number of cores on this machine", and 1+ is passed through to the
261278
# compiler.

0 commit comments

Comments
 (0)