-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running error: context loading failed: failed to load program with go/packages: could not determine GOARCH and Go compiler #21
Comments
Can you try |
I also released |
Problem reproducible upstream w/ golangci-lint docker image: I'm having the same issue in the Action as well as locally w/ the same upstream docker image: Ran with the step as follows:
Same error given the suggested
|
|
Tested v1.1.2 just now, unfortunately the same error:
|
Hmm, it's interesting if v1.1.2 doesn't work. |
It does work outside of Docker, e.g. from host's PATH; The docker container for |
Do you use |
I do not use Let me try adding this step before
and get back to you if that works, one moment please |
Nope, that didn't work. Let me try removing that dependency then and see if that's the cause, or add a step to |
It seems golangci-lint doesn't use latest go/packages. https://github.com/golangci/golangci-lint/blob/d3e36a97cdc1c68566b0a274df367a44cd766cfb/go.mod#L55 So it doesn't include this commit to improve the error message.... golang/tools@622ba90 |
I can now confirm that dumping my dependency on private repo does result in the Adding |
Probably because downloaded pkgs are not mounted (and i'm not sure how to do that). Removing |
Not sure what that would buy me either if the downloaded packages aren't being mounted anyway? |
I can confirm if we could mount the host's modules into the Action's container, this should work.
Reading GH Action's documentation to see if we can mount a volume now. |
I can also reproduce this and do not have any private Go modules imported. |
Having the same issue |
Maybe it's because they use I think "golangci-lint image" and "reviewdog image" based on it expect "GOROOT" to be I think it will be solved by dividing https://github.com/actions/setup-go/blob/9fbc767707c286e568c92927bbf57d76b73e0892/lib/installer.js#L122 |
Got same error without any private deps. |
I got this issue by running this on a private repo. I fixed it by making the repo open source. 🧀 |
I have the same issue. I found the workaround to remove this error: I set the GOROOT variables only for golangci job (thanks @yokogawa-k) - name: Lint
uses: reviewdog/[email protected]
env:
GOROOT: "/go"
with:
golangci_lint_flags: "--disable-all -E errcheck"
github_token: ${{ secrets.github_token }} But I still have this issue: Any workaround ? |
My previous GOROOT configuration was wrong, and I misunderstood it as GOPATH. I'm sorry. |
https://docs.github.com/en/actions/creating-actions/creating-a-composite-run-steps-action It should be able to reuse the go build cache and share the same build context/environment by using the same default workspace instead of using Docker. It should resolve an issue such as #21 as well.
#46 should fix this issue. Can anyone try the new version? |
@haya14busa Thanks for the fix. |
Hi,
I'm trying to use the linter with one of my private github go projects.
My .golangci.yml file:
This project uses Go Modules, and references a private repo in Github
the golangci-lint step fails with this error:
The text was updated successfully, but these errors were encountered: