Unconditionally use env.Decider("MD5-timestamp")

It seems that we are only enabling this option together with unsafe
build determinators. However it seems that MD5-timestamp by itself is
not unsafe.

MD5-Timestamp works by first checking the timestamp of a file, comparing
it to the scons database and if it does not match it will do an md5sum
to determine if the file needs rebuilding.

Without this option SCons will always create md5sums of every file. In
the case of a null build this is 50% of the time.
This commit is contained in:
HP van Braam 2024-12-09 17:56:51 +01:00
parent a372214a4a
commit 04fff3fe0d

View file

@ -501,14 +501,19 @@ else:
# Disable assert() for production targets (only used in thirdparty code). # Disable assert() for production targets (only used in thirdparty code).
env.Append(CPPDEFINES=["NDEBUG"]) env.Append(CPPDEFINES=["NDEBUG"])
# This is not part of fast_unsafe because the only downside it has compared to
# the default is that SCons won't mark files that were changed in the last second
# as different. This is unlikely to be a problem in any real situation as just booting
# up scons takes more than that time.
# Renamed to `content-timestamp` in SCons >= 4.2, keeping MD5 for compat.
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, so it's
# enabled by default for `debug` builds, and can be overridden from command line. # enabled by default for `debug` builds, and can be overridden from command line.
# 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 methods.get_cmdline_bool("fast_unsafe", env.dev_build):
# Renamed to `content-timestamp` in SCons >= 4.2, keeping MD5 for compat.
env.Decider("MD5-timestamp")
env.SetOption("implicit_cache", 1) env.SetOption("implicit_cache", 1)
env.SetOption("max_drift", 60) env.SetOption("max_drift", 60)