Skip to content

Commit

Permalink
ci/buildroot: make builddep work on !x86_64
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
jlebon committed Oct 10, 2023
1 parent bb43e8a commit 2b4fe01
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ci/buildroot/install-buildroot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 2b4fe01

Please sign in to comment.