1
0
mirror of https://github.com/coreos/fedora-coreos-config.git synced 2026-02-05 09:45:30 +01:00

ci/buildroot: make builddep work on !x86_64

Source RPMs are arch-specific because the buildreqs that get converted
into RPM requires are rendered from the spec file, which may have arch
conditionals. So we can't take an SRPM created on an x86_64 machine and
use it on !x86_64. This is what `dnf builddep foo` does under the hood.

Work around this by rebuilding the SRPMs.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1402784#c6

(Another option mentioned there is to point straight at the spec file
in dist-git, but some packages (at least systemd) have spec files that
source other files and spec parsing would fail if we didn't clone the
whole repo, which gets heavyweight.)
This commit is contained in:
Jonathan Lebon
2023-10-10 12:17:42 -04:00
parent 842197e0b2
commit d972c54e3e

View File

@@ -19,7 +19,14 @@ echo "${deps}" | xargs dnf -y install
echo "Installing build dependencies of primary packages"
brs=$(grep -v '^#' "${dn}"/buildroot-buildreqs.txt)
echo "${brs}" | xargs dnf -y builddep
(cd "${tmpd}" && mkdir rpmbuild
echo "${brs}" | xargs dnf download --source
# rebuild the SRPM for this arch; see
# https://bugzilla.redhat.com/show_bug.cgi?id=1402784#c6
find . -name '*.src.rpm' -print0 | xargs -0n 1 rpmbuild -rs --nodeps \
-D "%_topdir $PWD/rpmbuild" -D "%_tmppath %{_topdir}/tmp"
dnf builddep -y rpmbuild/SRPMS/*.src.rpm)
rm -rf "${tmpd:?}"/*
echo "Installing build dependencies from canonical spec files"
specs=$(grep -v '^#' "${dn}"/buildroot-specs.txt)