SCons: Don't activate fast_unsafe automatically on dev_build

We experienced first hand why it's called unsafe, and so we should leave it
as an explicit choice for contributors, informing themselves of the caveats.

See #111408.

(cherry picked from commit fa57282a1e)
This commit is contained in:
Rémi Verschelde 2025-10-08 15:47:07 +02:00
parent 07596299e6
commit 1c078fee01
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -210,7 +210,7 @@ opts.Add(
) )
) )
opts.Add(BoolVariable("tests", "Build the unit tests", False)) opts.Add(BoolVariable("tests", "Build the unit tests", False))
opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster rebuilds", False)) opts.Add(BoolVariable("fast_unsafe", "Enable unsafe options for faster incremental builds", False))
opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False)) opts.Add(BoolVariable("ninja", "Use the ninja backend for faster rebuilds", False))
opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True)) opts.Add(BoolVariable("ninja_auto_run", "Run ninja automatically after generating the ninja file", True))
opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja") opts.Add("ninja_file", "Path to the generated ninja file", "build.ninja")
@ -520,10 +520,10 @@ env.Decider("MD5-timestamp")
# SCons speed optimization controlled by the `fast_unsafe` option, which provide # SCons speed optimization controlled by the `fast_unsafe` option, which provide
# more than 10 s speed up for incremental rebuilds. # more than 10 s speed up for incremental rebuilds.
# Unsafe as they reduce the certainty of rebuilding all changed files, so it's # Unsafe as they reduce the certainty of rebuilding all changed files.
# enabled by default for `debug` builds, and can be overridden from command line. # If you use it and run into corrupted incremental builds, try to turn it off.
# Ref: https://github.com/SCons/scons/wiki/GoFastButton # Ref: https://github.com/SCons/scons/wiki/GoFastButton
if methods.get_cmdline_bool("fast_unsafe", env.dev_build): if env["fast_unsafe"]:
env.SetOption("implicit_cache", 1) env.SetOption("implicit_cache", 1)
env.SetOption("max_drift", 60) env.SetOption("max_drift", 60)