Skip to content

build: exclude the sbom asset when fetching golangci-lint - #671

Open
l1a wants to merge 1 commit into
creativeprojects:masterfrom
l1a:build/eget-asset-selection
Open

build: exclude the sbom asset when fetching golangci-lint#671
l1a wants to merge 1 commit into
creativeprojects:masterfrom
l1a:build/eget-asset-selection

Conversation

@l1a

@l1a l1a commented Jul 30, 2026

Copy link
Copy Markdown

Problem

make lint fails on any machine that does not already have the pinned linter, whenever stdin is not a TTY (CI step, container, editor task, agent shell):

[*] /home/user/go/bin/golangci-lint-v2
"/home/user/go/bin/eget" golangci/golangci-lint --tag v2.12.2 --asset=tar.gz --upgrade-only --to '/home/user/go/bin/golangci-lint-v2'
2 candidates found for asset chain: please select manually
(1) golangci-lint-2.12.2-linux-amd64.tar.gz
(2) golangci-lint-2.12.2-linux-amd64.tar.gz.sbom.json
Enter selection number: Error reading selection
make: *** [Makefile:107: /home/user/go/bin/golangci-lint-v2] Error 1

The golangci-lint release publishes …-linux-amd64.tar.gz.sbom.json next to …-linux-amd64.tar.gz. --asset=tar.gz is a substring match, so it matches both and eget prompts for a choice. With no TTY to answer, the target fails and takes make lint with it.

It works once the binary is present, because --upgrade-only then skips the fetch — so this only bites on a fresh checkout or a new machine, which is exactly when a contributor is least equipped to debug it.

Fix

Add eget's ^ exclusion prefix so the match is unambiguous.

Verification

Removed the installed binary to force a re-fetch, then ran make lint with stdin not a TTY:

[*] /home/user/go/bin/golangci-lint-v2
"…/eget" golangci/golangci-lint --tag v2.12.2 --asset=tar.gz --asset=^sbom --upgrade-only --to '…/golangci-lint-v2'
https://github.com/golangci/golangci-lint/releases/download/v2.12.2/golangci-lint-2.12.2-linux-amd64.tar.gz
Extracted `golangci-lint-2.12.2-linux-amd64/golangci-lint` to `…/golangci-lint-v2`
[*] lint
GOOS=darwin  …/golangci-lint-v2 run → 0 issues.
GOOS=linux   …/golangci-lint-v2 run → 0 issues.
GOOS=windows …/golangci-lint-v2 run → 0 issues.

Note

Only the golangci-lint target needs this today — the mockery and hugo releases don't currently publish a colliding asset, so I left those lines alone. The same one-word fix would apply if they ever do.

🤖 Generated with Claude Code

`make lint` fails on a machine that does not yet have the pinned linter,
whenever stdin is not a TTY:

    2 candidates found for asset chain: please select manually
    (1) golangci-lint-2.12.2-linux-amd64.tar.gz
    (2) golangci-lint-2.12.2-linux-amd64.tar.gz.sbom.json
    Enter selection number: Error reading selection
    make: *** [Makefile:107: .../golangci-lint-v2] Error 1

The release ships an SBOM alongside each archive, and `--asset=tar.gz`
matches both, so eget asks which one to use. With no TTY to answer, the
target dies and takes `make lint` with it.

Adding eget's exclusion prefix makes the match unambiguous.

Assisted-By: Claude Opus 5
l1a added a commit to l1a/resticprofile that referenced this pull request Jul 30, 2026
- PRs 1, 3 and 5 are now open upstream as creativeprojects#670, creativeprojects#672 and creativeprojects#671. Note that
  they are opened with ghpub, since the default fine-grained PAT cannot
  create pull requests on repositories we do not own.
- Flag that creativeprojects#672 conflicts with our own master: the fork already fixed
  that same test differently in 1282c8d (before/after count rather than
  filtering). Records how to resolve it on the next merge.
- Quote issue creativeprojects#331, where the maintainer states linger is not something
  resticprofile should set up automatically and drop-in files are the
  sanctioned mechanism. Wave 4A must not be opened as-is; notes the
  warning-instead-of-enforcement slice that could land.
- Correct the mock drift note: mockery v3.7.0 vs upstream's pinned
  v3.7.1 is the likelier cause, and mark the check as unconfirmed.
- Keep PR 3 and 5 bodies alongside PR 1's in upstream-prs/.

Assisted-By: Claude Opus 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant