Skip to content

Fix COPR SRPM build: embed both arch tarballs#20

Merged
johnpmitsch merged 1 commit into
mainfrom
fix/copr-srpm-build-and-multi-arch-sources
Jun 11, 2026
Merged

Fix COPR SRPM build: embed both arch tarballs#20
johnpmitsch merged 1 commit into
mainfrom
fix/copr-srpm-build-and-multi-arch-sources

Conversation

@johnpmitsch

Copy link
Copy Markdown
Collaborator

Summary

v0.1.5's custom-publish-copr job failed at "Build SRPM" with:

error: Bad file: /home/runner/rpmbuild/SOURCES/quicknode-cli-x86_64-unknown-linux-gnu.tar.xz.sha256: No such file or directory

Two bugs fed into this:

  1. rpmbuild -bs needs Source files locally to assemble the SRPM. Declaring them as URLs doesn't make rpmbuild fetch them — that "URLs get fetched" model only applies once COPR's mock runs the SRPM (and even then, only with --enable-net=on).
  2. Even if (1) were fixed, the spec's %ifarch was templating a single Source URL based on the runner's arch (always x86_64). The SRPM would have embedded only the x86_64 tarball, and COPR's aarch64 mock builds would have failed for the inverse reason.

Fix

Single architecture-fat SRPM that embeds both linux-gnu tarballs (~8 MB total):

  • packaging/qn-bin.spec — drops %ifarch URL templating and the curl+sha256 dance in %prep. Declares both arch tarballs as Source0 (x86_64) + Source1 (aarch64). %prep uses %ifarch with %setup -T -b N to extract the right embedded source for the chroot's arch. rpm sha256-verifies embedded sources from the SRPM header at extract time, so the manual hash check is redundant.

  • .github/workflows/publish-copr.yml — adds a step that gh release downloads both arch tarballs into ~/rpmbuild/SOURCES/ before rpmbuild -bs. Also drops --enable-net=on from the copr-cli build call since the embedded sources mean mock doesn't need network.

Single SRPM, single copr-cli dispatch, all chroots build from the same source set. Binary stays bit-identical to what ships in crates.io, GHCR, .deb, AUR, Homebrew.

Status

v0.1.5 already shipped to crates.io, GHCR, .deb, and the GitHub Release — only COPR was missed. No retroactive fix needed; v0.1.6 (next release) will exercise this fix and backfill COPR.

Test plan

  • dist plan exits 0 (the workflow + spec changes are self-contained).
  • Pre-commit habit checks: no secret-name leaks, brand capitalization clean.
  • After merge, the next release exercises custom-publish-copr end-to-end and dnf copr enable quicknode/qn && dnf install qn works on Fedora 40 + Rocky 9.

v0.1.5's custom-publish-copr job failed at the "Build SRPM" step with:

  error: Bad file: /home/runner/rpmbuild/SOURCES/quicknode-cli-x86_64-
  unknown-linux-gnu.tar.xz.sha256: No such file or directory

Root cause: `rpmbuild -bs` needs Source files to exist locally in
~/rpmbuild/SOURCES/ to build the SRPM, even when the spec declares
them as URLs. The "URLs get fetched at build time" model only kicks
in when COPR's mock runs the SRPM, not when the SRPM is initially
assembled.

There was a second latent bug: the spec used %ifarch to template a
single Source URL based on the build host's arch. The runner is
x86_64, so the SRPM would have only embedded the x86_64 tarball, and
COPR's aarch64 mock builds would have failed for the opposite reason.

Both fixed by switching to a single architecture-fat SRPM:

  * packaging/qn-bin.spec — drops the %ifarch URL templating, drops
    the curl + sha256 dance in %prep. Declares both arch tarballs as
    Source0 (x86_64) + Source1 (aarch64). %prep uses %ifarch with
    %setup -T -b N to extract the right embedded source for the
    chroot's arch.

    rpm itself sha256-verifies embedded sources at extract time
    (sha256s live in the SRPM header), so we don't need to redo it
    in %prep.

  * .github/workflows/publish-copr.yml — adds a step that uses gh
    release download to pull both arch tarballs into SOURCES/ before
    invoking `rpmbuild -bs`. The SRPM ends up carrying both tarballs
    (~8 MB) and ships once to COPR.

    Drops --enable-net=on from `copr-cli build`: now that the SRPM
    embeds the sources, mock chroots don't need network. The COPR
    project's "enable net" setting still applies if we ever do need
    it; this flag was just a per-build override.

Single SRPM, single copr-cli dispatch, all chroots build from the
same source set. The binary in the resulting RPMs stays bit-identical
to what ships everywhere else.

v0.1.5 already shipped to crates.io, GHCR, .deb, and the GitHub
Release — only COPR was missed. v0.1.6 (next release) will exercise
this fix and backfill COPR.
@johnpmitsch johnpmitsch merged commit a2e2277 into main Jun 11, 2026
13 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.

2 participants