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

after fresh golang installation GOARCH=386 (not amd64) (GOHOSTARCH=amd64) #45174

Closed
gekigek99 opened this issue Mar 23, 2021 · 6 comments
Closed

Comments

@gekigek99
Copy link

What version of Go are you using (go version)?

go version go1.15.10 windows/amd64

Does this issue reproduce with the latest release?

yes (the lastest 1.15 release)

What operating system and processor architecture are you using (go env)?

go env Output
C:\Users\gekigek99>go env
set GO111MODULE=auto
set GOARCH=386
set GOBIN=
set GOCACHE=C:\Users\gekigek99\AppData\Local\go-build
set GOENV=C:\Users\gekigek99\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\gekigek99\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\gekigek99\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set GO386=sse2
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m32 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\gekigek99\AppData\Local\Temp\go-build417896366=/tmp/go-build -gno-record-gcc-switches

What did you do?

installed golang on windows 10 64 bit

What did you expect to see?

GOARCH to be set to amd64

What did you see instead?

GOARCH=386 (even though GOHOSTARCH=amd64)

Comment

I can set GOARCH=amd64 manually, but some tools while compiling do not do it automatically and this results in an error

@AlexRouSg
Copy link
Contributor

The only way i could get GOARCH to say 386 is if I used the 386 binary or set GOARCH manually.
Please check your env var configs to make sure it is not being set somewhere.
Also try go env -u GOARCH to make sure it is not being set in the go env file.

Else there needs to be clearer repro instructions than "install go on windows"

@gekigek99
Copy link
Author

if I used the 386 binary or set GOARCH manually.

i did not do any of those, I installed the amd64 version and didn't set GOARCH

There was actually the file C:\Users\gekigek99\AppData\Roaming\go\env which contained

GOARCH=386
GO111MODULE=auto
GOOS=windows

and I removed the file (is it ok to just remove it right?)

now it appears to be working

just one question... why when I uninstall golang the go env file is not removed?
(so that when I reinstall golang the installation is truly fresh?)

@AlexRouSg
Copy link
Contributor

and I removed the file (is it ok to just remove it right?)

yup

just one question... why when I uninstall golang the go env file is not removed?
(so that when I reinstall golang the installation is truly fresh?)

It does not remove files in the %USERPROFILE% directory and only removes from the install directory. I guess this is working as intended then since there's a GOARCH=386 in the env file

@gekigek99
Copy link
Author

It does not remove files in the %USERPROFILE% directory and only removes from the install directory.

it's seems quite inconvenient to me to have an incomplete uninstallation... Is it something I can suggest to the devs or is there a reason for this behaviour? (maybe just to remove the env file and leave other directories which might contain important files?)

any way thanks a lot I've been banging my head over this for more than a week now

@AlexRouSg
Copy link
Contributor

You could make a proposal issue for a checkbox in the installer to optionally remove config and other files, I think that is reasonable tho I have no authority on it. As for why it's not removeing them, I would argue that it is more inconvenient to remove config files every install in the general case.

@gekigek99
Copy link
Author

I would argue that it is more inconvenient to remove config files every install in the general case.

yea you are probably right, but I like the idea of a checkbox during installation to remove old config files, I think I'll create an issue for that

Thanks again for the suggestion and support

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants