fix: Normalize build paths to ensure RPMs built here are reproducible (#610)

* fix: Normalize build paths to ensure RPMs built here are reproducible

* chore: Fix empty variable
This commit is contained in:
Kyle Gospodnetich 2026-10-20 10:16:41 -07:00 committed by GitHub
parent 7c9f9274d3
commit 6cda5f6fba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -92,6 +92,17 @@ fi
# Install RPMs
dnf install -y --allowerasing "${RPMS_TO_INSTALL[@]}"
# Normalize random akmods build roots before linking
original_build_pre="$(rpm --eval '%{macrobody:__spec_build_pre}')"
{
printf '%%__spec_build_pre '
printf '%s\n' "$original_build_pre" | sed 's/$/\\/'
cat <<'EOF'
export KCFLAGS="${KCFLAGS:+${KCFLAGS} }-ffile-prefix-map=%{_builddir}=/usr/src/akmods"
EOF
} > /etc/rpm/macros.akmods-reproducible
# Configure Dual Signing
if [[ "${DUAL_SIGN}" == 'true' ]]; then
if [[ ! -s "/tmp/certs/private_key_2.priv" ]]; then