golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
122.22k stars 17.47k forks source link

x/build/cmd/relui: add checkbox to Go installers to delete previous GOENV configuration file #45208

Open gekigek99 opened 3 years ago

gekigek99 commented 3 years ago

I had a problem recently (#45174) where after reinstalling golang the go env file would remain unchanged and this caused multiple issues since all tools and binaries were compiled for 386 arch and not for amd64 arch (as I expected).

I understand that many people want to preserve the old configuration after an update or reinstallation... but sometimes a "true" clean install might be useful.

What I suggest is to add a checkbox in the golang installation program that, if set to true, will wipe out all previous config (either all or some selectable folders) (%GOENV%, %GOPATH%, %GOCACHE% ... etc).

thanks

ianlancetaylor commented 3 years ago

This doesn't have to be a proposal. This can be decided by the maintainers of the installation program. That said, I'm not sure what installation program you mean. Is this Windows-specific?

gekigek99 commented 3 years ago

This can be decided by the maintainers of the installation program

oh ok I didn't know about a specific group of maintainers of the the installation program... how can I propose this to them?

Yep I'm referring to windows golang installation program (the .msi executables here)

ianlancetaylor commented 3 years ago

CC @golang/osp-team

cagedmantis commented 3 years ago

/cc @golang/release as well as the osp-team.

gekigek99 commented 3 years ago

Sorry I don't understand... Is this issue ok or should I open an other? If yes, where?

dmitshur commented 3 years ago

This issue is okay.

If we consider this to be about resetting configuration in the go env GOENV file, then this can apply to the Windows installer and also the macOS installer.

gekigek99 commented 3 years ago

resetting configuration in the go env GOENV file

yep my specific problem arose because of the go env GOENV file not being reset after the installation...

and while suggesting this feature I thought that this problem might arise again because of other user configs (I am thinking about %GOPATH% folder, which remains the same after re-installing golang) I am not a professional thought and probably deleting only go env GOENV file is enough to accomplish a "true" fresh golang installation...

this can apply to the Windows installer and also the macOS installer.

yes indeed, I forgot to mention the macOS installer but absolutely... (and all other OS that require an installer)

dmitshur commented 3 years ago

Deleting the go env GOENV file seems feasible because it's a file at a well-known location, controlled by Go itself.

It wouldn't be feasible for the Go installer to try to find or delete configuration in places that aren't well known (e.g., custom user .bash_profile or similar files), so I suspect there's not much more can be done in those cases. I'm not sure where the Windows registry entries fall, but that can be considered as part of this.

gekigek99 commented 3 years ago

delete configuration in places that aren't well known (e.g., custom user .bash_profile or similar files), so I suspect there's not much more can be done in those cases.

oh yea... sure you are completely right...

ad what about the possibility to delete for example the folder %GOPATH%/src or %GOPATH%/pkg? would that be feasible? (I think that %GOPATH% directory is known during installation right?) to me the possibility of completely removing old packages while reinstalling golang seems a cool little feature...

not sure where the Windows registry entries fall

yep I think reading windows registry entries it's a pain... especially if the installer needs to run on different windows versions... (and it would add a layer of complexity when working with different OS)

gekigek99 commented 3 years ago

sorry, are there any news about this project?