Fix COPR spec + point release-prepare at sync-manual-channels#22
Merged
Conversation
v0.1.6's COPR build failed in mock (all 10 chroots) with: warning: Macro expanded in comment on line 5: %install lays error: Name field must be present in package: (main package) Root cause: RPM specs do NOT treat `#` as escaping `%`. The macro processor runs before the comment processor, so a `%macro` token inside a comment gets expanded just like one in a directive. Two comments in packaging/qn-bin.spec mentioned `%prep` and `%install` to describe what those sections do. When RPM hit the `%install` in line 5's comment it expanded it, corrupting the parser's preamble state, and by the time RPM reached `Name: qn` on line 15 it had lost context and emitted the misleading "Name field must be present" error. Fix: remove all `%`-prefixed macro mentions from comments and add a note (without a `%` symbol) reminding future editors that the character is unsafe in spec comments. Belt-and-suspenders: every comment line in the spec is now grep-clean of `%` entirely (`grep -nE '^#.*%' qn-bin.spec` → no matches), so any future edit that accidentally reintroduces `%foo` in a comment gets caught by a one-line lint. This fix is forward-only: v0.1.6 already shipped to crates.io, GHCR, .deb, and the GitHub Release. v0.1.7 will exercise the corrected COPR spec and backfill COPR for the recent versions.
After release-prepare's CI-wait succeeds, the maintainer's next move is to sync the three manual channels (Homebrew tap, Scoop bucket, AUR qn-bin). The tail message used to stop at "inspect the release" — this adds a pointer to release-sync-manual-channels with the version baked in for a clean copy-paste, plus a note that omitting the args auto-detects the version from the latest tag.
markwu35
approved these changes
Jun 11, 2026
4 tasks
johnpmitsch
added a commit
that referenced
this pull request
Jun 11, 2026
v0.1.7's COPR build dispatched cleanly to all 10 chroots (the "Name field" bug from PR #22 is fixed), and EPEL 10's two chroots *succeeded* — first time COPR has shipped a real qn build. But the other 8 chroots failed with two distinct issues: 1. Older RPMs (EPEL 9, Fedora 42-44) didn't honor the source build's `--define qn_version=...`. When mock re-parsed the SRPM during the binary-build phase, it saw a literal `%{qn_version}` in Version: and the SRPM filename glob, leading to: warning: line 22: Possible unexpanded macro in: Version: %{qn_ver... error: File not found by glob: /builddir/build/originals/qn-%{qn_version}-1.el9.src.rpm EPEL 10's RPM is newer and handles the source-build define correctly, hence the partial success. Fix: sed the version literally into the spec file in the workflow before `rpmbuild -bs`. The SRPM gets the real version baked in everywhere, every downstream parse sees the same literal. `@@QN_VERSION@@` is the placeholder. 2. Fedora's strict "unpackaged files found" check killed the build with: error: Installed (but unpackaged) file(s) found: /usr/lib/debug/usr/bin/qn-*.debug Fedora's RPM auto-generates debug symbols via find-debuginfo and expects them packaged. Our spec only claims /usr/bin/qn + docs in the files section. Fix: `%global debug_package %{nil}` near the top of the spec. Our binary is already stripped by cargo-dist upstream; there's nothing for debuginfo to extract, and even if there were, we wouldn't want to ship a -debuginfo subpackage for a single-binary tool. v0.1.7's EPEL 10 success means Phase 7 is partially shipped — anyone on Fedora-10-derived distros can `dnf copr enable quicknode/qn && dnf install qn` today. v0.1.8 (next release) should backfill Fedora 42-44 and EPEL 9.
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
Two small, related changes:
1. Fix COPR mock build. v0.1.6's
custom-publish-coprgot past the SRPM build (fixed in PR #20) and successfully dispatched to COPR — but COPR's mock builds failed across all 10 chroots with:RPM specs don't treat
#as escaping%. The macro processor runs before the comment processor, so a%macrotoken inside a comment gets expanded just like one in a directive. Two comments inpackaging/qn-bin.specmentioned%prepand%install. RPM expanded the%installin line 5's comment, corrupted the parser's preamble state, and by the time RPM reachedName: qnon line 15 it had lost context and emitted the misleading "Name field must be present" error.(Credit to Log Detective for surfacing the warning + error pair from the mock log.)
Fix: strip all
%-prefixed macro names from comments. Belt-and-suspenders: every comment line is now grep-clean of%entirely:2. Point
release-prepare's tail at the next step. Afterrelease-preparesucceeds, the maintainer's next move isrelease-sync-manual-channels. The tail message used to stop at "inspect the release" — now it points at the sync command with the version baked in for a clean copy-paste.Status
Forward-fix for COPR. v0.1.6 already shipped successfully to crates.io, GHCR, .deb, and the GitHub Release — only COPR was missed. v0.1.7 will exercise the corrected spec.
Test plan
dist planexits 0.grep -nE '^#.*%' packaging/qn-bin.specreturns no matches.release-prepare's tail message renders cleanly (verified by reading the recipe; the new lines use the same{{version}}substitution the existing lines use).custom-publish-copr's mock builds succeed across all 10 chroots.