-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: builds fail when GOPATH=/dev/null #31100
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
Comments
@josharian IMHO, set |
If those files do not need to be updated and no modules need to be downloaded, then the lock does not need to be acquired, and Regardless of the cause, we could proceed without locking if |
Change https://golang.org/cl/169877 mentions this issue: |
Change https://golang.org/cl/169918 mentions this issue: |
Thanks. I went ahead and mailed my simple workaround for you to take a look at. |
…on occurs If the go.mod file exists and is empty, we initialize it from any of various formats supported by legacy dependency-management tools. We also initialize the 'go' directive at that point: we know that the go.mod file is incomplete, because it does not reflect the information in the legacy configuration file, and since we know that the go.mod file is incomplete, we should complete it with as much information as we have — including the version of the language currently in use. However, if there is no legacy configuration file present, then we cannot infer that the go.mod file is incomplete: it may correctly specify a module without external dependencies. In that case, we should not initialize the 'go' directive either: the user will not be expecting unnecessary edits to the go.mod file, and we generally do not make unnecessary-but-helpful edits unless 'go mod tidy' is invoked explicitly. Fixes #30790 Fixes #31100 Change-Id: I05a7872bce54a917c10d910cd9a616cab52e2730 Reviewed-on: https://go-review.googlesource.com/c/go/+/169877 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
When run with
GOPATH=/dev/null
,go build
fails:That seems fine. Who would run with
GOPATH=/dev/null
‽ It's not even a directory.But it's not fine, because run.bash sets
GOPATH=/dev/null
. Why? The comment says:The $GOPATH value doesn't need to point to an actual directory, it just needs to pass the semantic checks performed by Go.
I don't know who is wrong here, but I do want all.bash to pass. I have a workaround I can mail just for TestLldbPython (set
GOPATH=
). Or we can fix this mess...somewhere else.Opinions?
@bcmills @jayconrod @bradfitz
The text was updated successfully, but these errors were encountered: