Package: binutils-dev Severity: normal Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: toolchain randomness buildpath hostname timestamps username X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
The log files included in /usr/share/doc/binutils/tests/ include many variable things (timestamps, timings, PIDs, temporary filenames, usernames, addresses) that vary between builds. I'm not sure what the rationale for including these test logs in the package is, but from a reproducible builds perspective, ideally these would simply not be included at all. When running the build with DEB_BUILD_OPTIONS=nocheck, the build logs are excluded, and results in a reproducible build. Perhaps you could create a build profile that doesn't include these logs, and use it in builds in which you want the logs? If the logs must be included in the packages, the attached patch attempts to sanitize the log file by removing everything that varies between builds; I'm not sure if this removes too much data to be useful, but it should make binutils reproducible at least in bullseye (unstable/experimental also varies build path in the reproducible builds test infrastructure, which triggers other issues). This approach does feel a bit prone to playing whack-a-mole, so long-term this may not be viable. Please consider removing or sanitizing the logs so that this part of the essential build toolchain can itself be built reproducibly! Thanks for maintaining binutils! live well, vagrant
From ec5b5081300f275991c4b7dad7401d7ac882a6aa Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian <vagr...@reproducible-builds.org> Date: Mon, 3 Feb 2020 20:44:51 +0000 Subject: [PATCH] Sanitize build logs to ensure reproducible builds by stripping out embedded timestamps, timings, PIDs, temporary filenames, usernames, function addresses, etc. --- debian/rules | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/debian/rules b/debian/rules index 1acbe57..0b202e3 100755 --- a/debian/rules +++ b/debian/rules @@ -1445,7 +1445,7 @@ binary.%: stamps/install.% install ifeq ($(with_check),yes) : # remove user and date from test-summary for reproducible builds - sed -i -e '/Test Run By/Id' test-summary-$* + sed -i -e '/Test run by/d' test-summary-$* $(install_file) test-summary-$* \ $(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/test-summary gzip -9nf $(D_CROSS)/$(PF)/share/doc/$(P_CROSS)/test-summary @@ -1668,7 +1668,7 @@ endif ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE)) ifeq ($(with_check),yes) : # remove user and date from test-summary for reproducible builds - sed -i -e '/Test Run By/Id' $(pwd)/test-summary + sed -i -e '/Test run by/d' $(pwd)/test-summary $(install_dir) $(d_nat)/$(PF)/share/doc/$(p_bin) $(install_file) test-summary \ $(d_nat)/$(PF)/share/doc/$(p_bin)/test-summary-$(DEB_HOST_ARCH) @@ -1680,8 +1680,27 @@ ifeq ($(with_check),yes) for i in $$(find builddir-single -name '*.sum'); do \ b=$$(basename $$i .sum); \ $(install_file) $$i $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.sum; \ + sed -i -e '/Test run by/d' $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.sum; \ xz -9v $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.sum; \ $(install_file) $${i%.sum}.log $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.log; \ + sed -i -e '/Test run by/d' \ + -e '/time stamp.*:/d' \ + -e 's,completed in.*seconds,completed,g' \ + -e 's,runtest completed.*,runtest completed,g' \ + -e 's,completed at.*,completed,g' \ + -e 's,/tmp/cc.......,/tmp/ccXX.,g' \ + -e 's,tmpdir/compiler[0-9]*,tmpdir/compilerXX,g' \ + -e 's,tmpdir/plt[0-9]*,tmpdir/pltXX,g' \ + -e 's,tmpdir/nopie[0-9]*,tmpdir/nopieXX,g' \ + -e 's,tmpdir/int128[0-9]*,tmpdir/int128XX,g' \ + -e 's,tmpdir/gnu2_tls[0-9]*,tmpdir/gnu2_tlsXX,g' \ + -e 's,tmpdir/gnu[0-9]*,tmpdir/gnuXX,g' \ + -e 's,tmpdir/static[0-9]*,tmpdir/staticXX,g' \ + -e 's,tmpdir/dl_avail_test[0-9]*,tmpdir/dl_avail_testXX,g' \ + -e 's,tmpdir/ifunc[0-9]*,tmpdir/ifuncXX,g' \ + -e 's,func@0.*,func@ADDRESS_REDACTED_FOR_REPRODUCIBILITY,g' \ + -e "s,$(CURDIR),BUILD_DIR/,g" \ + $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.log; \ xz -9v $(d_dev)/$(PF)/share/doc/$(p_bin)/tests/$$b.log; \ done endif -- 2.20.1
signature.asc
Description: PGP signature