Skip to content

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

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

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 l1a closed this by deleting the head repository Aug 1, 2026
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