File reproducible-rust.patch of Package post-build-checks
commit 6db4dd0ae03489bed749c048b47123ddfde4c380
Author: Bernhard M. Wiedemann <bwiedemann@suse.de>
Date: Thu Aug 1 14:25:56 2024 +0200
Add codegen-units=1 for deterministic rust builds
the default is 16 and causes rust build results to vary.
See https://reproducible-builds.org/ for why this matters.
This patch was done while working on reproducible builds for openSUSE, sponsored by the NLnet NGI0 fund.
diff --git a/suse-buildsystem.sh b/suse-buildsystem.sh
index 0ca8d29..4073cda 100644
--- a/suse-buildsystem.sh
+++ b/suse-buildsystem.sh
@@ -7,6 +7,7 @@ export QT_HASH_SEED=0
export PERL_HASH_SEED=42
export PYTHONHASHSEED=0
export FORCE_SOURCE_DATE=1 # for texlive to use SOURCE_DATE_EPOCH
+export RUSTFLAGS="-C codegen-units=1"
if test ! -v SOURCE_DATE_EPOCH && test -f /.buildenv && test "Y" != "$(rpm --eval '%disable_obs_set_source_date_epoch')"; then
SOURCE_DATE_EPOCH="$(