-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: go mod download breaks on 1.21.0 due to empty GOPROXY #61928
Comments
The default What do |
And, on a related note: what are the contents of |
In the freshly built Go root dir, go.env contains the following:
So these values look expected. My /home/snaipe/.local/etc/go/env contains:
I don't quite remember why I set this before, so I removed the file. The behavior stays the same on different environments. If I build Go from source from a minimal Alpine Linux container, which should avoid any weird user config, the error remains. |
I edited the initial reproducer; I realized upon rereading that I failed to transcribe it correctly. |
I straced the newly built Go process and the path it tries to open go.env at seems very wrong:
And sure enough, as you suspected, GOROOT seems wrong:
(it should have been /tmp/go/out) Is GOROOT_FINAL no longer respected for building Go? |
Nevermind, the problem was our build toolchain; I think GOROOT was incorrectly still set to the source directory. Let me investigate a bit to make sure, but it's likely not a problem with Go. |
Ah, see #61921. |
After more investigation, the "reproducer" I had wasn't accurately representing what was happening on our end. It turns out our build instructions had a bit of a footgun that caused the go.env file to not get copied. I can confirm that things are now working as expected. Thanks for the pointers about go.env, I don't think I'd have been able to figure what was wrong that quickly otherwise. |
Fix the following error: go: GOPROXY list is not the empty string, but contains no entries It started appearing after switching to Go 1.21.0. See golang/go#61928 I changed go.env to disable settings which I consider unsafe.
include patched go.env into goroot Fix the following error: go: GOPROXY list is not the empty string, but contains no entries It started appearing after switching to Go 1.21.0. See golang/go#61928 I changed go.env to disable settings which I consider unsafe.
Reference: golang/go#61928 Signed-off-by: Muhammad Falak R Wani <[email protected]>
if you ran into this issue, try unsetting your GOROOT: unset GOROOT It fixed the issue for me on my old laptop where I hit this issue. |
@ghasemloo ty for this, saving a many hour detour |
for me setting the env var to GOPROXY="direct" solved the issue, before that i removed GOPROXY and set it to empty, it seems for go version < 1.21 setting GOPROXY ="" is ok , |
Reference: golang/go#61928 Signed-off-by: Muhammad Falak R Wani <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, and it only happens with the latest 1.21.0. Things were working by default on the previous release.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Run
go mod download -x github.com/xdg/[email protected]
What did you expect to see?
It should have worked, and output something like this:
What did you see instead?
The command fails with this error:
A simple way to reproduce the issue:
For comparison, using my locally installed Go 1.20.1:
The text was updated successfully, but these errors were encountered: