Fix COPR SRPM build: embed both arch tarballs#20
Merged
Conversation
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.
markwu35
approved these changes
Jun 11, 2026
This was referenced Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.1.5's
custom-publish-coprjob failed at "Build SRPM" with:Two bugs fed into this:
rpmbuild -bsneeds 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).%ifarchwas 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%ifarchURL templating and the curl+sha256 dance in%prep. Declares both arch tarballs asSource0(x86_64) +Source1(aarch64).%prepuses%ifarchwith%setup -T -b Nto 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 thatgh release downloads both arch tarballs into~/rpmbuild/SOURCES/beforerpmbuild -bs. Also drops--enable-net=onfrom thecopr-cli buildcall since the embedded sources mean mock doesn't need network.Single SRPM, single
copr-clidispatch, 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 planexits 0 (the workflow + spec changes are self-contained).custom-publish-coprend-to-end anddnf copr enable quicknode/qn && dnf install qnworks on Fedora 40 + Rocky 9.