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
dl: golang.org/dl installer shouldn't create a new subdirectory of $HOME #26520
Comments
There are two separate issues here, I think. One is that the email template we used was wrong; I've updated our release docs with a fix. That leaves the install directory issue, for which I will retitle this issue. |
I agree that I do not have such a directory, and frankly I find it pretty surprising too: when I install per-language SDKs, I usually put them in I would argue that ¹https://tip.golang.org/cmd/go/#hdr-GOPATH_environment_variable |
+1 on not liking $HOME/sdk, but I expect my $GOBIN to hold binaries, not whole trees. $GOPATH/sdk makes the most sense to me, even if it ends up being back to $HOME/sdk for me). |
$GOPATH is going away, so let's not overload that and give it new reasons to exist. |
If go1.11beta2/bin/go and everything else don't care where they are, using argv[0] to hone in, then why not insist the user state the location with go1.11beta2 download $root. |
@RalphCorderoy, this is supposed to be the easy way to install Go. No required arguments. If people feel strongly that there be an optional flag to set the location, maybe. But then you have to store its location somewhere in a known location (probably in $HOME/.config, for which we don't have a helper like https://tip.golang.org/pkg/os/#UserCacheDir) so the "go1.N" binary can find it. So I'm kinda meh on this bug. The tool is opinionated for simplicity. If you don't like its opinions, install it the traditional way wherever you like? shrug |
Perhaps we should use That seems to be the standard place to stuff long-lived data files that the user otherwise doesn't want to think about. ¹https://specifications.freedesktop.org/basedir-spec/latest/ar01s03.html |
And for Mac and Windows? $HOME/.local/share isn't idiomatic on those platforms. Mac would be ~/Library/ something. And Windows surely has something else. But even on Unix, IMO it's kinda gross to put large files in dot directories. But I suppose we already do that for ~/.cache. I suppose I'm neutral on XDG_DATA_HOME. |
I would argue that it's kinda gross to put large files any place the user didn't specify explicitly, except perhaps a subdirectory of the current working directory (which
Presumably |
I am not really an expert in this area, but
I would say that normal users are not allow to write there. So you need to be admin to be able to do that.
Maybe. Except I do not have %APPDATA%\Local directory on my computer:
and
Alex |
Regarding $XDG_DATA_HOME, it's analogous to /usr/share, thus its default of $HOME/.local/share, and things reading from it are meant to also continue the search through the colon-separated paths in $XDG_DATA_DIRS. My $XDG_DATA_HOME does have a few executables, typically 'contrib' scripts. The 612 MiB go1.11beta2 dwarfs the 1-2 MiB directories in $XDG_DATA_HOME here, though size isn't a criteria in the spec. It's content doesn't change, but I suppose it's not a .cache because work is required to bring it back after delete. The audience is small. Would an optional $GOSDK to override the use of homedir()/"sdk" in version.go be acceptable? (I'd have it set to outside the area that's backed up.) |
I'm neutral. I'll let others here decide. |
One more thought on $XDG_DATA_HOME, the user's version of /usr/share, http://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREARCHITECTUREINDEPENDENTDATA is it seems to be for architecture-independent files, e.g. a $HOME can be mounted on various architectures, just like /usr/share, that's the reason the latter is called 'share'. Rust describes it that way, https://docs.rs/xdg/2.0.0/xdg/struct.BaseDirectories.html and the executables under mine are scripts rather than ELFs. |
I too find it surprising that my home directory was polluted. I agree that we shouldn't tie it to
Why not put the release download cache there too? For example, we already have The only other complication is that the sdk download cache might get large, and it would be somewhat hidden. A solution could be for each |
In 2018 I wrote:
At the time it wasn't clear whether Go 1.8's implicit GOPATH was going to stick around. But it has stuck around (or better or worse) and still works, and it's used heavily for the module cache:
So we could put it under (what's another 100 MB or so drop in the bucket?) @RalphCorderoy, @bcmills, @FiloSottile, @dmitshur, shall we move it from top-level |
Something to consider, I often use |
@dmitshur, I think even if we put those commands in some subdirectory of (The |
I'd be fine with |
My suggestion is to use Please note that I'm not proposing to add support for |
Change https://golang.org/cl/310009 mentions this issue: |
I would highly appreciate if the downloader would put new releases in a subdirectory of the existing |
I installed the Go 1.18 beta and ran into this issue. Being able to move the hardcoded |
+1 to https://go-review.googlesource.com/c/dl/+/310009 @bradfitz @bcmills can you perform a review of the changeset from @perillo |
That old perillo changeset allows a GOSDK environment variable to override the existing location. It's unclear that has been decided upon as the solution. Alternatives above include Changing the default doesn't have this problem and the alternative above has, as I said, the benefit of ‘a user who doesn't want ~/go will already be setting $GOPATH, and it will be clear what's to blame for the space consumption’. |
Download and unpack versions under `$GOPATH/sdk`. Fixes golang/go#26520
Download and unpack versions under `$GOPATH/sdk`. Fixes golang/go#26520
Change https://go.dev/cl/439215 mentions this issue: |
@andybons sent an email to golang-dev yesterday, subject 'Go 1.11 Beta 2 is Released'.
The instructions included
These fail with Arch Linux's go 2:1.10.3-1 package.
Removing the `https://' worked. It then matches the comment in https://go.googlesource.com/dl/+/master/go1.11beta2/main.go
Please consider warning that 'go1.11beta2 download' will install to
$HOME/sdk/go1.11beta2 as some folks, me included, won't appreciate new
top-level $HOME directories. Altering $HOME for the run of 'go1.11beta2
download' avoided this on Unix, and it looks like similar is possible on other
platforms.
(Opened issue as requested by Andy in private email.)
The text was updated successfully, but these errors were encountered: