[PATCH] buildman: Disable CONFIG_CMD_CONFIG for reproduceable build

When the ordering of CONFIG options changes, the gzipped CONFIG list can change in size and contents. This makes it hard to compare commits which only different in CONFIG ordering.
Disable this when -r is given, to make this easier. Update the documentation as well.
Signed-off-by: Simon Glass sjg@chromium.org ---
tools/buildman/buildman.rst | 3 ++- tools/buildman/control.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/tools/buildman/buildman.rst b/tools/buildman/buildman.rst index aae2477b5c3d..4cca97dbda8c 100644 --- a/tools/buildman/buildman.rst +++ b/tools/buildman/buildman.rst @@ -1021,7 +1021,8 @@ various files to be rebuilt even if no source changes are made, which in turn requires that the final U-Boot binary be re-linked. This unnecessary work can be avoided by turning off the timestamp feature. This can be achieved using the `-r` flag, which enables reproducible builds by setting -`SOURCE_DATE_EPOCH=0` when building. +`SOURCE_DATE_EPOCH=0` when building, as well as disabling `LOCALVERSION_AUTO` +and `CONFIG_CMD_CONFIG`.
Combining all of these options together yields the command-line shown below. This will provide the quickest possible feedback regarding the current content diff --git a/tools/buildman/control.py b/tools/buildman/control.py index f2ffb7f5b4aa..0ce4f2e2f3b5 100644 --- a/tools/buildman/control.py +++ b/tools/buildman/control.py @@ -575,6 +575,10 @@ def calc_adjust_cfg(adjust_cfg, reproducible_builds): print('Not dropping LOCALVERSION_AUTO for reproducible build') else: adjust_cfg['LOCALVERSION_AUTO'] = '~' + if 'CMD_CONFIG' in adjust_cfg: + print('Not dropping CMD_CONFIG for reproducible build') + else: + adjust_cfg['CMD_CONFIG'] = '~' return adjust_cfg

On Sun, Sep 10, 2023 at 06:13:35PM -0600, Simon Glass wrote:
When the ordering of CONFIG options changes, the gzipped CONFIG list can change in size and contents. This makes it hard to compare commits which only different in CONFIG ordering.
Disable this when -r is given, to make this easier. Update the documentation as well.
Signed-off-by: Simon Glass sjg@chromium.org
This isn't the right approach. First, thanks for figuring out the slight rodata change that happens when testing some Kconfig rework series. However, this first violates the principal of least surprise as you're turning off part of the build that was on before. Second, it's not the only zlib in the build, and it's often reproducible.
We should have a section somewhere in the docs about tips and tricks for doing Kconfig rework as there's other things too such as not having the baseline commit to compare with be a version tag since everything will grow slightly due to then having a githash appending to it.
participants (2)
-
Simon Glass
-
Tom Rini