Skip to content

fix(aur): tell users how to fix a duplicate architecture - #7141

Merged
caarlos0 merged 2 commits into
mainfrom
fix/aur-duplicate-arch-hint
Sep 15, 2026
Merged

caarlos0 merged 2 commits into
mainfrom
fix/aur-duplicate-arch-hint

Conversation

@caarlos0

@caarlos0 caarlos0 commented Sep 15, 2026 •

Copy link
Copy Markdown
Member

Tell users how to fix an AUR entry that gets two archives for the same architecture.

ErrMultipleArchivesSameArch (added in #7100) rejects configs that previously produced output. It is reachable with a plain archives: [{formats: [tar.gz, zip]}] plus an aurs entry without ids: both linux/amd64 archives pass the ByTypes(UploadableArchive, UploadableBinary) filter.

The old PKGBUILD emitted two source_x86_64= lines. That is valid bash — the last one wins — but the archive pipe builds formats concurrently, so which format shipped was not deterministic. Rejecting the config is still the right call; this only makes the fix discoverable.

ids alone is not enough, though. The archive pipe stamps every format of a single archives entry with the same ExtraID (archive.go:259), so artifact.ByIDs cannot separate them — a user who follows a bare "use ids" hint adds ids and hits the identical error. The message therefore names both causes:

one aur can handle only one archive of each architecture. Consider using ids in the aurs section; if a single archives entry produces multiple formats, split it into separate archives with distinct ids

TestRunPipeRejectsDuplicateArchitectures gains two rows — single id, multiple formats and single id, multiple formats, filtered by ids — the second of which records that ids does not disambiguate that case. The assertion also moves from the literal string to require.ErrorIs on the sentinel, matching brew and cask, so future wording changes no longer require a test change.

Follow-up to #7100. Part of a series of fixes found reviewing v2.18.1..main.

`ErrMultipleArchivesSameArch` rejects configs that used to produce output,
for instance `archives: [{formats: [tar.gz, zip]}]` with an `aurs` entry
that has no `ids`, but it did not say what to do about it. brew and cask
already point at `ids` in the same situation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 95ddccd8-7a86-4668-a31f-5a70cfee068e
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@pull-request-size pull-request-size Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 15, 2026
@codecov

codecov Bot commented Sep 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.56%. Comparing base (7ba40dc) to head (af2ccf9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7141   +/-   ##
=======================================
  Coverage   91.56%   91.56%           
=======================================
  Files         191      191           
  Lines       15903    15903           
=======================================
  Hits        14562    14562           
  Misses       1341     1341           

☔ View full report in Codecov by Harness.
📢 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.

@caarlos0 caarlos0 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: one blocking problem

(Posted as a comment: GitHub does not permit a change request on your own pull request.)

The one goal of this change is to make the fix discoverable. For the configuration that the description names as the cause (archives: [{formats: [tar.gz, zip]}] with no ids), the new advice does not work. See the comment on internal/pipe/aur/aur.go:37.

The change itself is correct and safe in all other respects:

  • The rejection is still the correct behavior. The old PKGBUILD emitted two source_x86_64= lines, and the artifact order is not deterministic, thus the shipped format was random.
  • Nothing else in the repository, the documentation, or the golden testdata asserts the old string.
  • golangci-lint reports 0 issues. The message does not start with a capital letter and does not end with punctuation, thus ST1005 is satisfied.

Missing coverage (no single line)

The scenario in the description — one archives entry, two formats, one shared artifact ID — has no test in the repository. TestRunPipeRejectsDuplicateArchitectures covers only artifacts with different IDs. A test for that scenario would have shown that the new advice is inert.

Verification gaps

  • The claim that the pre-#7100 PKGBUILD was valid bash is confirmed by a template trace (tmpl.go:65-67), not by a build of the old tree.
  • TestRunPipeMultipleConfigurations fails locally because of a safe.bareRepository=explicit git setting. That failure is environmental. With safe.bareRepository=all, go test ./internal/pipe/aur/... passes.

This review was produced by an automated reviewer (GitHub Copilot CLI).

Comment thread internal/pipe/aur/aur.go Resolved
Comment thread internal/pipe/aur/aur_test.go Resolved
`ids` alone cannot fix the config the previous message pointed at. The
archive pipe stamps every format of a single `archives` entry with the
same `ExtraID`, so `artifact.ByIDs` cannot separate two archives built
from `formats: [tar.gz, zip]`. A user following the hint would add
`ids` and hit the identical error.

Name both causes in the message, and cover the single-id/multi-format
case in the test, including the row that shows `ids` does not help.

Assert the sentinel instead of the literal text, matching brew and cask,
so a wording change no longer requires a test change.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f203943f-d716-454d-b790-1476f68f6221
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@pull-request-size pull-request-size Bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Sep 15, 2026
@caarlos0
caarlos0 enabled auto-merge September 15, 2026 16:47
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: af2ccf9
Status: ✅  Deploy successful!
Preview URL: https://9faaf551.goreleaser.pages.dev
Branch Preview URL: https://fix-aur-duplicate-arch-hint.goreleaser.pages.dev

View logs

@caarlos0
caarlos0 added this pull request to the merge queue Sep 15, 2026
Merged via the queue into main with commit b428c4c Sep 15, 2026
21 checks passed
@caarlos0
caarlos0 deleted the fix/aur-duplicate-arch-hint branch September 15, 2026 16:59
@github-actions github-actions Bot added this to the v2.18.0 milestone Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

⌂ 换网址