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

make.bash: make default GOROOT_BOOTSTRAP more useful #14339

Closed
perillo opened this issue Feb 15, 2016 · 5 comments
Closed

make.bash: make default GOROOT_BOOTSTRAP more useful #14339

perillo opened this issue Feb 15, 2016 · 5 comments
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@perillo
Copy link
Contributor

perillo commented Feb 15, 2016

There are currently two problems with default GOROOT_BOOTSTRAP handling in the make.bash script.

The first problem is that the default value set in make.bash ($HOME/go1.4) will not be used by the go dist tool, since the new GOROOT_BOOSTRAP environment variable is not exported. The code works only because the go dist tool uses the same default value.

The second problem is that $HOME/go1.4 will be an invalid GOROOT for the majority of users, thus forcing the user to explicitly set the GOROOT_BOOSTRAP environment variable.

I propose to change the default GOROOT_BOOTSTRAP value to the value returned by go env GOROOT, where the go command in PATH is used. The GOROOT_BOOSTRAP should be exported. As an example:

export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$(go env GOROOT 2>/dev/null)}
export GOROOT="$(cd .. && pwd)"
@minux
Copy link
Member

minux commented Feb 15, 2016 via email

@perillo
Copy link
Contributor Author

perillo commented Feb 15, 2016

On Mon, Feb 15, 2016 at 8:57 PM, Minux Ma notifications@github.com wrote:

Changing the default GOROOT_BOOTSTRAP to $(go env GOROOT)
will break users of go tip.

But using $HOME/go1.4 will force everyone to explicitly set
GOROOT_BOOTSTRAP.
What is better: forcing "normal " users to explicitly set GOROOT_BOOTSTRAP
or forcing users of go tip to explicitly set GOROOT_BOOTSTRAP?

@minux
Copy link
Member

minux commented Feb 15, 2016 via email

@ianlancetaylor ianlancetaylor added this to the Go1.7 milestone Feb 16, 2016
@rsc rsc modified the milestones: Go1.8, Go1.7 May 18, 2016
@quentinmit quentinmit added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Oct 10, 2016
@rsc
Copy link
Contributor

rsc commented Oct 10, 2016

I strongly disagree about using the current PATH's 'go', because many times that will be the Go distribution being rebuilt at that moment, and you'll get into weird circularity problems.

However, if you can filter out the current directory's go command, for example with appropriate processing of "which -a go", then using the next go in the path might be reasonable. That seems fine if someone wants to write the CL (and it's simple!), but it's not a release blocker.

@rsc rsc modified the milestones: Go1.8Maybe, Go1.8 Oct 10, 2016
@rsc rsc added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Oct 10, 2016
@rsc rsc modified the milestones: Go1.9, Go1.8Maybe Nov 2, 2016
@bradfitz bradfitz modified the milestones: Go1.10, Go1.9 Jun 14, 2017
@gopherbot
Copy link
Contributor

Change https://golang.org/cl/57753 mentions this issue: make.bash: add go env GOROOT as default GOROOT_BOOTSTRAP value

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants