Skip to content

srpm: set rpmpack SourceRPM metadata flag#1081

Open
alexma233 wants to merge 1 commit into
goreleaser:mainfrom
alexma233:feat/srpm-source-rpm-metadata
Open

srpm: set rpmpack SourceRPM metadata flag#1081
alexma233 wants to merge 1 commit into
goreleaser:mainfrom
alexma233:feat/srpm-source-rpm-metadata

Conversation

@alexma233

Copy link
Copy Markdown

When building source RPMs, the SOURCERPM (RPMTAG_SOURCERPM, 1044) tag must not be present. RPM utilities treat its presence as indicating a binary (non-source) RPM. This causes build services like Fedora COPR to reject source RPMs generated by the srpm packager.

The upstream rpmpack (google/rpmpack#105) adds a SourceRPM field to RPMMetaData that controls whether SOURCERPM is written. This PR:

  • Sets meta.SourceRPM = true when the packager format is srpm
  • Uses a replace directive pointing to the rpmpack fork with the new field

Dependency

Depends on google/rpmpack#105 being merged and released.

The replace directive in go.mod should be removed and the rpmpack dependency bumped once a new release is available.

Verification

  • go test ./rpm/... — 73 tests pass, including TestSRPM
  • Generated SRPM no longer contains the SOURCERPM tag header

When building source RPMs (formatSRPM), set the new rpmpack
RPMMetaData.SourceRPM flag.  This instructs rpmpack to skip the
SOURCERPM (RPMTAG_SOURCERPM, 1044) tag, which must not be present
in source RPMs.

Depends on google/rpmpack#105.

Replace directive will be removed once a new rpmpack release is
available.
@pull-request-size pull-request-size Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label May 1, 2026
@caarlos0

caarlos0 commented May 1, 2026

Copy link
Copy Markdown
Member

Good catch! Thank you!

Let's see if rpmpack merges it soon 🙏🏻

@codecov

codecov Bot commented May 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.96%. Comparing base (cd95f9f) to head (4ac82d1).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1081      +/-   ##
==========================================
+ Coverage   73.94%   73.96%   +0.01%     
==========================================
  Files          22       22              
  Lines        2756     2758       +2     
==========================================
+ Hits         2038     2040       +2     
  Misses        494      494              
  Partials      224      224              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants