Skip to content

Commit 153034e

Browse files
committed
Fix COPR mock build: strip percent-signs from spec-file comments
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.
1 parent bd1b3db commit 153034e

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

packaging/qn-bin.spec

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
#
33
# This spec is built on COPR's mock chroots. The SRPM embeds both Linux
44
# gnu tarballs (x86_64 + aarch64) cargo-dist published for this release;
5-
# %prep selects the right one for the chroot's arch and %install lays
6-
# the binary + docs into the buildroot. No Rust toolchain involved on
7-
# the COPR side — the binary inside the resulting RPM is bit-identical
8-
# to what ships in crates.io, Homebrew, .deb, AUR, and the GHCR image.
5+
# the prep section selects the right one for the chroot's arch and the
6+
# install section lays the binary + docs into the buildroot. No Rust
7+
# toolchain involved on the COPR side — the binary inside the resulting
8+
# RPM is bit-identical to what ships in crates.io, Homebrew, .deb, AUR,
9+
# and the GHCR image.
10+
#
11+
# Comments here intentionally avoid the percent-sign character entirely
12+
# — RPM expands macros inside comments at parse time, which corrupts
13+
# the parser state and causes downstream "Name field must be present"
14+
# errors that look unrelated.
915
#
1016
# Built by .github/workflows/publish-copr.yml on each release. That
1117
# workflow pre-downloads both arch tarballs into ~/rpmbuild/SOURCES/
@@ -19,8 +25,8 @@ Summary: Command-line interface for the Quicknode SDK
1925
License: MIT
2026
URL: https://github.com/quicknode/cli
2127

22-
# Both arch tarballs ship in the SRPM. %prep picks one based on the
23-
# chroot's arch.
28+
# Both arch tarballs ship in the SRPM. The prep section picks one based
29+
# on the chroot's arch.
2430
Source0: https://github.com/quicknode/cli/releases/download/v%{version}/quicknode-cli-x86_64-unknown-linux-gnu.tar.xz
2531
Source1: https://github.com/quicknode/cli/releases/download/v%{version}/quicknode-cli-aarch64-unknown-linux-gnu.tar.xz
2632

0 commit comments

Comments
 (0)