Skip to content
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

cmd/go,x/tools/go/packages: doesn't propagate permission errors (missing from go list -e) #50869

Open
dominikh opened this issue Jan 27, 2022 · 1 comment
Labels
NeedsInvestigation Tools
Milestone

Comments

@dominikh
Copy link
Member

@dominikh dominikh commented Jan 27, 2022

Preface: this is another instance of go list -e failing and reporting the error on stderr, and go/packages trying to process stderr intelligently.

Under certain conditions, go/packages will swallow permission errors and return no packages + no error. The bug boils down to the error processing in golistState.invokeGo.

Simple reproducer: https://go.dev/play/p/L53GCKnfxg3

@gopherbot gopherbot added the Tools label Jan 27, 2022
@gopherbot gopherbot added this to the Unreleased milestone Jan 27, 2022
@mknyszek mknyszek added the NeedsInvestigation label Jan 28, 2022
@mknyszek
Copy link
Contributor

@mknyszek mknyszek commented Jan 28, 2022

mvdan added a commit to mvdan/go-dvote that referenced this issue Feb 10, 2022
Staticcheck has been doing nothing on CI most of the time for the past
few weeks, printing:

	warning: "./..." matched no packages

That turned out to be caused by our GOCACHE containing directories that
the current user could not modify, and the x/tools/go/packages library
was hiding that error from staticcheck and us.
See golang/go#50869 for more details.

staticcheck will most likely get fixed up for this edge case soon.
Until then, what we can do is run staticcheck in a separate step,
making it easier to notice when it does nothing.
vdo pushed a commit to vocdoni/vocdoni-node that referenced this issue Feb 15, 2022
Staticcheck has been doing nothing on CI most of the time for the past
few weeks, printing:

	warning: "./..." matched no packages

That turned out to be caused by our GOCACHE containing directories that
the current user could not modify, and the x/tools/go/packages library
was hiding that error from staticcheck and us.
See golang/go#50869 for more details.

staticcheck will most likely get fixed up for this edge case soon.
Until then, what we can do is run staticcheck in a separate step,
making it easier to notice when it does nothing.
@findleyr findleyr changed the title x/tools/go/packages: doesn't propagate permission errors cmd/go,x/tools/go/packages: doesn't propagate permission errors (missing from go list -e) Feb 16, 2022
jordipainan pushed a commit to vocdoni/vocdoni-node that referenced this issue Apr 22, 2022
Staticcheck has been doing nothing on CI most of the time for the past
few weeks, printing:

	warning: "./..." matched no packages

That turned out to be caused by our GOCACHE containing directories that
the current user could not modify, and the x/tools/go/packages library
was hiding that error from staticcheck and us.
See golang/go#50869 for more details.

staticcheck will most likely get fixed up for this edge case soon.
Until then, what we can do is run staticcheck in a separate step,
making it easier to notice when it does nothing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Tools
Projects
None yet
Development

No branches or pull requests

3 participants