← Back to context

Comment by skydhash

1 day ago

I don’t mind ~/.* for config, especially when the config is just one or two files. What I don’t like is programs like go and cargo treating my $HOME as a dumping ground for every file they want to download and/or cache.

At least cargo places everything in a .cargo directory, so it doesn’t display by default. Go will instead write to $HOME/go, without even the decency to use a hidden directory, unless you first define the GOPATH environment variable.

And if you install more than one version of go, they get placed in $HOME/sdk [0]. Last I checked, this path is hard-coded with no override, despite this being a known issue for 8 years.

[0] https://github.com/golang/go/issues/26520

In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

  • > In general, I find it unacceptable for programs to use (anywhere in) my file system, besides /tmp, as a dumping ground for their caches and downloads, without cleaning it up.

    /tmp must be world-writable and for multi-user or multi-tenant systems it becomes a security hole. Storing temporary files in the current user's home directory (or a subdirectory thereof) makes sense.

    What doesn't make sense is this blog post about TMP and TEMP, and ending with "I don't know why" (in different words).

    The reason is simple: different programmers thought the other name was bad. They were under no obligation to come to a consensus.

    Don't forget about TEMPDIR and TMPDIR! Also Windows has its own environment variables for this. But generally, Linux software ported to Windows still use TMP or TEMP.

    • > /tmp must be world-writable and for multi-user or multi-tenant systems it becomes a security hole. Storing temporary files in the current user's home directory (or a subdirectory thereof) makes sense.

      It makes sense when it's a user option. If /tmp isn't an option due to security concerns, then use $CWD by default. I can always alter the config to some other location if I do not like it. With the amount of programs that litter $HOME, especially with caches, you have to whitelist directories when backing it up. With a naive rsync, you'll find half your transfer is junk.