From aef334b8f26de89843042753b120eedf40d0566a Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jun 18 2024 13:20:34 +0000 Subject: [PATCH 1/2] BRP scripts: update advice The command to get a list of scripts was outdated, since a bunch of them are pulled in via %_os_install_post_python, and since https://fedoraproject.org/wiki/Changes/ReproduciblePackageBuilds, via %__os_install_post_build_reproducibility. --- diff --git a/guidelines/modules/ROOT/pages/index.adoc b/guidelines/modules/ROOT/pages/index.adoc index 2c41cf6..d5fe39a 100644 --- a/guidelines/modules/ROOT/pages/index.adoc +++ b/guidelines/modules/ROOT/pages/index.adoc @@ -3179,7 +3179,7 @@ All packages SHOULD always be subject to all the BRP scripts, but sometimes it is necessary for a package to opt-out of certain ones. It is possible to disable any BRP script simply by defining the corresponding variable to `+%{nil}+`. -For example, to disable the brp-python-bytecompile script: +For example, to disable the `+brp-python-bytecompile+` script: [source, rpm-spec] ---- @@ -3193,7 +3193,12 @@ in an accompanying comment. For a list of the BRP scripts run by default, invoke: - fgrep '%__brp_' /usr/lib/rpm/redhat/macros + sed -r -n '/^%.?__os_install_post/,/%.?nil/p' /usr/lib/rpm/redhat/macros + +For a list of all BRP scripts, +invoke: + + rpmbuild --eval '%dump' |& grep ': __brp_' == Packaging for EPEL From 1ad96626e43a7dce217ce354a07422825b288be1 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Jun 18 2024 13:20:34 +0000 Subject: [PATCH 2/2] BRP scripts: add short subsection about add-determinism https://fedoraproject.org/wiki/Changes/ReproduciblePackageBuilds Note that I added some more information to /usr/lib/rpm/macros.d/macros.build-reproducibility upstream, but it's not visible in Fedora package yet. See https://github.com/keszybz/add-determinism/blob/main/rpm/macros.build-reproducibility for the latest version. --- diff --git a/guidelines/modules/ROOT/pages/index.adoc b/guidelines/modules/ROOT/pages/index.adoc index d5fe39a..a7e52b0 100644 --- a/guidelines/modules/ROOT/pages/index.adoc +++ b/guidelines/modules/ROOT/pages/index.adoc @@ -3200,6 +3200,17 @@ invoke: rpmbuild --eval '%dump' |& grep ': __brp_' +=== Removal of common sources of build irreproducibility + +One of the BRP scripts that is invoked by default is +`+%__os_install_post_build_reproducibility+`. +Its purpose is to normalize installed files +by removing unwanted embedded metadata that is dependent on the build environment +and may cause different builds from the same sources to be irreproducible. + +See `/usr/lib/rpm/macros.d/macros.build-reproducibility` +for details about how it can be configured. + == Packaging for EPEL For the most part, these guidelines