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

dist: provide one-line installer #23381

Open
rsc opened this issue Jan 8, 2018 · 15 comments
Open

dist: provide one-line installer #23381

rsc opened this issue Jan 8, 2018 · 15 comments
Assignees
Labels
DevExp anything around developer experience FeatureRequest NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Jan 8, 2018

We all agree we want a 1-line installer. tools/cmd/getgo is a start but has work to do. This is the tracking bug for shipping it (and advertising it on the install page).

@pciet
Copy link
Contributor

pciet commented Jan 8, 2018

Something that bothered me about the 1.10 beta installer is that, while definitely convenient, it didn’t feel very official. Are there any possible features to make the experience feel more secure?

I understand that downloading an archive from the download page or doing just about anything on the Internet also requires the same level of trust (why were the files hosted on something other than dl.google.com for awhile?), but a thought is the convenience offered by a 1-line installer could make people more complacent in their sourcing of it.

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 8, 2018
@bradfitz
Copy link
Contributor

bradfitz commented Jan 9, 2018

why were the files hosted on something other than dl.google.com for awhile?

Are you referring to #22648? I agree that it looked sketchy, which is part of why I filed the bug to get it changed.

@pciet
Copy link
Contributor

pciet commented Jan 9, 2018

Yes that was it, thanks for the change.

I trusted the redirector.gvt1.com link because of the https://golang.org/dl/ URL and Chrome saying the cert is valid there, but I thought about it for a moment.

Downloading a 1-click downloader binary over HTTPS from a trustworthy URL page (even pointing at gvt1.com) is the only security I'd actually expect, but the previous comment seemed worth sharing here.

@broady broady added the DevExp anything around developer experience label Jan 11, 2018
@broady
Copy link
Member

broady commented Jan 11, 2018

@pciet regarding safety/trust - I'd suggest opening a new bug to discuss that that, but the short answer is that we do provide GPG signatures for tarballs (add .asc to any those download URLs). They're signed with the Google private key. Some more docs for that may be warranted.

@pciet
Copy link
Contributor

pciet commented Jan 12, 2018

@broady here it is: #23430, thanks.

@rasky
Copy link
Member

rasky commented Jan 12, 2018

This bug has little description. What is this one-line installer? What problem is supposed to solve? On which operating systems? Is there any kind of doc/spec on how it should work?

@ianlancetaylor
Copy link
Contributor

@rasky It's intended to be a single short command that anyone can run to install or update Go on their system. It's intended to be the Go equivalent of https://www.rustup.rs/ .

@pciet
Copy link
Contributor

pciet commented Jan 13, 2018

@ianlancetaylor comment in the other issue:

When you suggest some additional documentation that "could be part of the tool distribution," what do you mean?

I was referring to what @broady said above. Maybe explaining good security practices, such as how to verify the GPG signature, could be part of the documentation for the tool. This could be on the website and in the program as help text.

@andybons andybons self-assigned this Jan 13, 2018
@enocom
Copy link

enocom commented Mar 7, 2018

I've been talking with @spf13 about the one-line installer. If the idea is to use tools/cmd/getgo, then how about the following?

curl -LO https://get.golang.org/$(uname)/go_installer \
  && chmod +x go_installer \
  && ./go_installer \
  && rm go_installer \
  && source ~/.go_env

The idea would be to set the necessary environment variables -- GOPATH and appending to PATH -- in the .go_env file. For future sessions, getgo could also add a line sourcing .go_env to the shell config file.

This would presumably resolve #21277.

Granted, it's not as nice as:

curl https://sh.rustup.rs -sSf | sh

but getgo does support Windows without a separate installation process.

@spf13
Copy link
Contributor

spf13 commented Mar 7, 2018

if we rename it from go_installer to "gi" it shortens the command a lot :)

It's a fundamentally different approach from the rustup.sh approach. The rustup approach can't set variables in the current shell which is a major stumbling block for users.

@enocom
Copy link

enocom commented Mar 8, 2018

Here is an attempt at resolving #21277 as we've discussed.

/cc @spf13 @broady @Deleplace

@owenthereal
Copy link

I saw that no progress was made with getgo so I built goup for myself. Blog post: https://owenou.com/goup.

@smasher164
Copy link
Member

A few questions I have about a potential tool like this:

  1. Is it going to allow multiple Go toolchains to coexist on a system?
  2. If so, is it going to allow setting a default toolchain?
  3. Do environment variables need to be set? I assume they won't, since the go command has sensible defaults, and GOPATH is deprecated.
  4. Will it be module-aware, i.e. if I run go build in a project that expects a different version of the language, would another version be fetched? I assume not, since there would have to be some interaction between the compiler and the installer.

@harrisonmetz
Copy link

I think this is a great idea, but continuing the comparison with Rust, that has 3 tools:

  • rustc - the actual compiler
  • cargo - the package and project manager
  • rustup - the rust toolchain / target installer and manager

The go binary seems to cover the first 2 cases. What is nice about using rustup, is it’s much more than just a simple install script. You can upgrade your rust install, you can add targets, and you can add tool chains. The rust project nailed it with their tooling and it’s a pleasure to work with.

Perhaps a in the same naming spirit, a go-up tool which can manage versions of go installed and select the active or default version and upgrade it. And it could have a nice 1 line installer with curl piping into sh.

@hyangah
Copy link
Contributor

hyangah commented Feb 16, 2024

fyi - getgo is deprecated.
The new GOTOOLCHAIN helps updating/switching go toolchain conveniently - assuming there is already a version of go toolchain installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DevExp anything around developer experience FeatureRequest NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests