Skip to content

Conversation

dricross
Copy link

@dricross dricross commented Sep 2, 2025

Description

When running make lint in a fresh environment with no go cache or after running go clean -modcache, the process fails because the https://github.com/tdakkota/asciicheck/ repo cannot be found:

go: downloading github.com/tdakkota/asciicheck v0.4.1
.../go/pkg/mod/github.com/golangci/golangci-lint/[email protected]/pkg/golinters/asciicheck/asciicheck.go:4:2: reading github.com/tdakkota/asciicheck/go.mod at revision v0.4.1: git ls-remote -q origin in .../go/pkg/mod/cache/vcs/e91413ff76cb95901df8e2d834855d07c617befa58b5014bc6cd6fd1148034dd: exit status 128:
	remote: Repository not found.
	fatal: repository 'https://github.com/tdakkota/asciicheck/' not found
make: *** [.../opentelemetry-collector-contrib/.tools/golangci-lint] Error 1

golangci-lint repo maintainers discovered this issue a couple weeks ago: golangci/golangci-lint#6017. They have a fix but it is not yet released: golangci/golangci-lint#6018.

In the mean time, switching from building golangci-lint from source to installing by downloading the binary directly, as recommended here: https://golangci-lint.run/docs/welcome/install/#local-installation. Hopefully, we can undo this change the next time we synchronize our repo with upstream (golangci-lint should have a fix by then which upstream will consume).

Testing

  • make lint succeeds after change

@dricross dricross force-pushed the dricross/golangcilint branch 6 times, most recently from 056aeea to 60e2d5e Compare September 3, 2025 12:25
@dricross dricross force-pushed the dricross/golangcilint branch from b50840f to 2ea8ef4 Compare September 3, 2025 12:59
flock -x 200; \
if [ ! -f $@ ]; then \
echo "Downloading golangci-lint..."; \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v2.1.1; \
Copy link
Author

Choose a reason for hiding this comment

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

v2.1.1 was chosen as that is the version that was used in the internal/tools/go.mod file previously, so this will keep the linting rules consistent. Trying to use the latest version caused additional linting rules to identify linting issues.

@@ -27,225 +26,69 @@ require (
)

require (
4d63.com/gocheckcompilerdirectives v1.3.0 // indirect
Copy link

Choose a reason for hiding this comment

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

all of these dependencies are used to build golangci? wow

Copy link
Author

Choose a reason for hiding this comment

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

yeah thats kind of wild

Copy link

@agarakan agarakan left a comment

Choose a reason for hiding this comment

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

Nice solution before git cache clears and linters fail

@dricross dricross merged commit e44b5cd into aws-cwa-dev Sep 3, 2025
357 of 401 checks passed
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.

4 participants