-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: several commands require the build cache but don't use it #39882
Comments
Err, this is worse than I thought - I can't even do
What am I missing? |
Need to add a test case for |
Change https://golang.org/cl/240548 mentions this issue: |
CL 236563 fixes a different issue. I just mailed CL 240548, which should fix this for module commands that don't use the build cache. There are a number of other commands that probably should work but don't, like |
Neat :) If those other changes would be similarly small enough, perhaps we can label this "help wanted". |
modload.Init initialized the build cache with the intent of providing a better error message in Go 1.12, when the build cache became mandatory (in module mode, packages aren't installed outside the build cache). Unfortunately, this didn't provide a more descriptive error (the cache calls base.Fatalf with its own message), and it caused errors for commands that don't use the cache (like 'go mod edit'). This CL removes the cache initialization from modload.Init. The builder will initialize it when it's needed. For #39882 Change-Id: Ibc01ae4e59358dcd08a07ffc97bf556514d0366f Reviewed-on: https://go-review.googlesource.com/c/go/+/240548 Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Are we going to do anything here for 1.17? Thanks. |
Steps to repro:
I think this should succeed.
go mod edit -go=X
only has to modify a line ingo.mod
, it shouldn't require the build cache to exist or be writeable. However, that last command fails:I encountered this while writing some tests, which are run in a temporary directory with a near-empty environment (partly to not pollute the user's $HOME and such).
The text was updated successfully, but these errors were encountered: