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

x/build/cmd/release: installers should add GOBIN to PATH #39531

Open
jayconrod opened this issue Jun 11, 2020 · 1 comment
Open

x/build/cmd/release: installers should add GOBIN to PATH #39531

jayconrod opened this issue Jun 11, 2020 · 1 comment

Comments

@jayconrod
Copy link
Contributor

@jayconrod jayconrod commented Jun 11, 2020

We currently provide installers for Go for Windows (an .msi file) and macOS (a .pkg file).

Both installers add $GOROOT/bin to PATH. This lets users run commands like go build without having to edit PATH themselves.

However, users still need to edit PATH in order to run binaries installed with go install or go get. This introduces unnecessary confusion for new developers. To avoid this, both installers should add $GOBIN to PATH as well.

(Note that neither GOBIN nor GOPATH are likely to be set when an installer runs. If they are set, we should respect them; the goal is just to ensure that the directory where go install writes binaries is added to PATH).

@gopherbot gopherbot added the Builders label Jun 11, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jun 11, 2020
@dmitshur
Copy link
Member

@dmitshur dmitshur commented Jun 11, 2020

I think this is a good idea as it will lead to a noticeable improvement to the user experience for new users, and we should do this, unless we are able to discover a reason why doing so could be harmful or dangerous.

Given the installers already own the decision of where to place the Go installation and make it available (via an added entry to PATH or a platform-equivalent), and by not setting a GOPATH, they are implicitly relying on the default GOPATH value that go uses (which is $HOME/go or platform-equivalent), I think also adding GOBIN to PATH is an appropriate and in-scope task for an installer.

I'll think more about it, but I can't think of concerns with doing so.

I'll tentatively mark this for consideration for 1.15, since it seems like a minor and safe change to me (and the change doesn't need to be done in the main Go tree). It's an opportunity to use an upcoming beta release to try it out and get user feedback. That said, we are in the release freeze for 1.15, so if people think this decision needs more time or input, we can move this for 1.16 cycle.

/cc @golang/osp-team

@dmitshur dmitshur modified the milestones: Unreleased, Go1.15 Jun 11, 2020
@jayconrod jayconrod modified the milestones: Go1.15, Go1.16 Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.