Skip to content

ci: use dnf builddep to install make-rpm build dependencies - #203

Merged
pcdubs merged 1 commit into
fedora-iot:mainfrom
miabbott:fix/make-rpm-systemd-macros
Aug 10, 2026
Merged

ci: use dnf builddep to install make-rpm build dependencies#203
pcdubs merged 1 commit into
fedora-iot:mainfrom
miabbott:fix/make-rpm-systemd-macros

Conversation

@miabbott

@miabbott miabbott commented Aug 7, 2026

Copy link
Copy Markdown
Member

Problem

The make-rpm job (in both .github/workflows/greenboot-ci.yaml and .github/workflows/comment-ci.yaml) has been failing consistently on recent PRs:

error: Failed build dependencies:
	systemd-rpm-macros is needed by greenboot-rs-0.16.3-0.el9.x86_64
make: *** [Makefile:127: rpm] Error 11

Confirmed failing identically on the last several merged/open PRs: #190, #191, #192, #178, #196.

Root cause

greenboot-rs.spec has an unconditional BuildRequires: systemd-rpm-macros. The make-rpm job runs in a bare quay.io/centos/centos:stream9 container and its "Build RPMs" step only installs git make rpm-build rust-toolset before running make rpmsystemd-rpm-macros is never installed, so rpmbuild fails dependency resolution before it builds anything.

Fix

Use dnf builddep -y greenboot-rs.spec (after installing dnf-plugins-core for the plugin) instead of hardcoding package names in the workflow. This reads BuildRequires straight from the spec — including the conditional rust-toolset/cargo-rpm-macros branch — so the job stays correct automatically if the spec's dependencies ever change, instead of needing a parallel hardcoded list kept in sync by hand.

Validation

Verified locally against the exact quay.io/centos/centos:stream9 image the job uses: dnf install -y git make rpm-build dnf-plugins-core && dnf builddep -y greenboot-rs.spec resolves rust-toolset and systemd-rpm-macros cleanly, and make rpm completes and produces all four expected RPMs (greenboot, greenboot-default-health-checks, greenboot-rs-debugsource, greenboot-debuginfo).

Also checked this doesn't regress the Fedora build path: dnf builddep alone only sees the spec's static BuildRequires, not the per-crate rust-*-devel packages that %generate_buildrequires/%cargo_generate_buildrequires enumerate dynamically during %prep on Fedora. That's fine here because this CI job only ever runs in the CentOS Stream 9 container above — the Fedora build path is handled entirely separately by the Makefile's own Fedora-conditional dnf install of GREENBOOT_RUST_DEPENDENCIES, which this change doesn't touch.

🤖 Assisted-by: OpenCode (Claude Sonnet 5)

greenboot-rs.spec has an unconditional BuildRequires: systemd-rpm-macros,
but the make-rpm job's dnf install step never installs it, only
git/make/rpm-build/rust-toolset. rpmbuild then fails dependency
resolution before it ever gets to building anything:

  error: Failed build dependencies:
      systemd-rpm-macros is needed by greenboot-rs-0.16.3-0.el9.x86_64

Rather than hardcode systemd-rpm-macros alongside rust-toolset (which
would just be one more package to keep in sync with the spec by hand),
use 'dnf builddep' against greenboot-rs.spec directly so the job always
installs whatever the spec's BuildRequires actually resolve to on this
container, including the rust-toolset/cargo-rpm-macros conditional
branch, with no separate list to maintain.

Verified against the exact quay.io/centos/centos:stream9 image the job
uses: 'dnf install -y git make rpm-build dnf-plugins-core' followed by
'dnf builddep -y greenboot-rs.spec' correctly resolves rust-toolset and
systemd-rpm-macros, and 'make rpm' completes and produces all four
expected RPMs.

Also checked this doesn't regress the Fedora build path: 'dnf builddep'
alone only sees the spec's static BuildRequires, not the per-crate
rust-*-devel packages that %generate_buildrequires/
%cargo_generate_buildrequires enumerate dynamically during %prep on
Fedora. That's fine here because this CI job only ever runs in the
CentOS Stream 9 container above; the Fedora path is handled entirely
separately by the Makefile's own Fedora-conditional dnf install of
GREENBOOT_RUST_DEPENDENCIES, which this change doesn't touch.

Assisted-by: OpenCode (Claude Sonnet 5)
@miabbott
miabbott force-pushed the fix/make-rpm-systemd-macros branch from 7f563fa to 05dadc3 Compare August 7, 2026 20:58
@miabbott miabbott changed the title ci: install systemd-rpm-macros in make-rpm job ci: use dnf builddep to install make-rpm build dependencies Aug 7, 2026

@pcdubs pcdubs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pcdubs
pcdubs merged commit 2eeac08 into fedora-iot:main Aug 10, 2026
18 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants