Let Cargo put data into platform-specific directories #1615
|
There's a stale pull request to do something like this: rust-lang/cargo#2127, I'll gladly update it if it is desired. I figured that it might be big enough of a change to justify an RFC. |
| +``` | ||
| + | ||
| +## Other unixy systems (Linux, BSDs) | ||
| + | ||
| +Here, we're following the XDG spec: | ||
| + | ||
| +``` | ||
| +cache: .cache/cargo | ||
| +config .config/cargo | ||
| +binaries: .local/bin | ||
| +``` | ||
| +# Drawbacks | ||
| + | ||
| +* This increases the complexity of where to find the files Cargo uses. This can | ||
| + be alleviated by providing library functions for Cargo related tools and a | ||
| + command line to tell which paths are in use. |
|
steveklabnik
It's not just this though; it's also things like documentation, explaining how cargo works to the user, etc |
| + | ||
| +## OS X | ||
| + | ||
| +``` | ||
| +cache: Library/Caches/Cargo | ||
| +config: Library/Cargo | ||
| +binaries: Library/Cargo/bin | ||
| +``` | ||
| + | ||
| +## Other unixy systems (Linux, BSDs) | ||
| + | ||
| +Here, we're following the XDG spec: | ||
| + | ||
| +``` | ||
| +cache: .cache/cargo | ||
| +config .config/cargo |
|
tbu-
They are, perhaps I should clarify that a little. We're following the XDG spec, and by default it's these directories. |
| + | ||
| +## Windows | ||
| + | ||
| +We'll obtain each of the following directories using the correct API. | ||
| + | ||
| +``` | ||
| +cache: AppData\Local\Temp\Cargo | ||
| +config: AppData\Roaming\Cargo | ||
| +binaries: AppData\Local\Programs\Cargo | ||
| +``` | ||
| + | ||
| +## OS X | ||
| + | ||
| +``` | ||
| +cache: Library/Caches/Cargo | ||
| +config: Library/Cargo |
|
withoutboats
I'm currently using OS X, and the config for all of the CLI tools I have any interest in configuring are stored somewhere under my home directory. I've never touched a config file under
tbu-
I don't know a lot about OS X. Isn't there a
Sean1708
Others may disagree but in my experience the unwritten rule of OSX is that GUI apps use
withoutboats
My CLI tools configs and caches are all at the same location as they'd be on Linux, including some that are following XDG.
plietar
Homebrew uses |
|
I personally think all CLI tools should adopt XDG on all *nix platforms as the only reasonable attempt at a standard that anyone's produced. There's no actual standard on any *nix platform as far as I know, and I don't see a way that storing the files in the way specified by XDG is worse than storing them in I don't think that Rust tools should do something different on OS X from what they do on other *nixen, for the reasons cited in the issue. |
|
@withoutboats Indeed, and that's also what |
| +Currently, Cargo puts all its files in a directory named `.cargo` below the | ||
| +home directory of the user. Using this proposal, it would reuse existing | ||
| +standard directories of the host platform. This allows other tools oblivious to | ||
| +Cargo to function in the best way. Using standard directories is the best way | ||
| +to go unless there are concrete reasons for not doing so, otherwise Cargo just | ||
| +adds complexity to all systems that try to interoperate with it. Benefits | ||
| +include: | ||
| + | ||
| +* Using a standard directory for binary outputs can allow the user to execute | ||
| + Cargo-installed binaries without modifying their `PATH` variable. E.g. on | ||
| + Fedora this is apparantly already the case, in Debian there's a ticket to | ||
| + include it. | ||
| +* Putting caches in designated cache directories allows backup tools to ignore | ||
| + them. | ||
| +* Using a `.cargo` directory on Windows is not idiomatic at all, no programs | ||
| + for Windows would such a directory. |
|
|
|
@withoutboats I exchanged the plan for OS X with one of the alternatives. Now everything is the same across non-Windows platforms and only Windows differs. |
|
Another huge upside to this is that it removes clutter from |
Could you elabrate? What tools will interacts well (better) with Cargo, and why? Edit: cache or disk cleanup tools will benifit at least, as the motivation section said. |
|
One drawback that may want to be added to this is that there are a good number of other apps and such which don't follow the XDG spec on Linux, and likely for their own "good reasons". This in turn means that if one day the spec becomes widely adopted it will likely need to be changed in one form or another. Put another way, many other major projects aren't following this spec, and to follow the spec it's quite likely that it'll need some sort of breaking change in one way or another. It's seems like it may be risky to hitch ourselves to this bandwagon? Also, are there any other apps which follow XDG on OSX? Is the spec even defined for OSX? I'd be quite hesitant to follow a Linux spec on OSX as it seems like we'd just be winding up in the same situation of OSX users thinking that we're not doing the "native thing" |
|
@alexcrichton On my MacBook, I have "configstore", "fish", "git', "gtk-2.0", "htop", and "nvim" directories in my |
|
On Linux, my impression is that all per-app dotfiles/dotdirs either predate or are done in ignorance of the XDG spec. Separating configuration from caching is quite useful and I cannot envision any downsides. |
That's been my experience as well. @alexcrichton Are you aware of any projects that would follow the spec if some sort breaking change were implemented? Most cases I've seen where it was brought up and rejected were due to inertia. |
|
@alexcrichton on linux:
Is there a specific program with issues with xdg that you're thinking of? |
|
From the RFC text:
[1]: the installer can/already do this (one off job). not a benefit. So, there is only one benefit: to make 3rd-party tools happy, to help them find/clean cargo's cache data. And this is not a benefit for us, the users and developers of cargo. We get little benefit on this. But it will make difficulty to our life: we must remember more dirs, if we want to find them; we must do more os-specific work to implement it and maintain it; we can't easily create a portable cargo that all in one directory. One more thing: it's not clear what will be put into cache directory. (e.g. Will (XDG spec is nice. But what's the benefit if we follow it?) |
|
@liigo It is not the only benefit. See my comment from earlier. This should also be added to the RFC text. |
[1] is a benefit because that way, you don't end up with a path in I think it's pretty clear that all of these are benefits. Whether they're worth the trade-off is what the RFC discussion should be about, but claiming that they aren't benefits isn't really helping. EDIT: Regarding making 3rd party tools happy vs interacting with them: I as a user would be happy if the backup tool would know to ignore the Cargo cache. This is not for the benefit of the 3rd party tool, but for the benefit of me, the user of Cargo. |
|
@liigo as a cargo user who sometimes uses other tools also, making cargo interoperate with them better definitely makes my life better. :-) |
To me it seems like everyone would want to implement the change but may not be able to. If no one actually implements it then no one's following the spec, which seems to defeat the purpose of having it in the first place? It seems to me that if updates can't happen, then the spec is frozen as-is today. Then if it's frozen as-is there are major tools which have good reasons for not following it, and there's little hope for those reasons to get resolved?
Looking in my home folder, programs which don't follow xdg include:
Notably including many other languages' package managers. I forget if this has been brought up before, but I've at least discussed it with others. The point about operating with third-party programs is also an interesting one. There are programs which don't follow XDG, so any robust third-party program would already have to handle non-conforming programs with some heuristics. In that sense you may not actually get any benefit at all if Cargo follows XDG because the heuristics are already correctly classifying Cargo. If Cargo isn't falling in the right bucket but could easily do so for some popular programs, that would also be a reasonable course of action I think. |
|
Both pip and git support XDG.
I use rsnapshot for backups. The heuristic is the user adding exceptions on their own. It would be much nicer if Cargo didn't need an exception. I mentioned advantages and disadvantages in the RFC. It seems that at least the advantages are real for some users. Maybe the discussion should focus on how to weigh these arguments against each other. Especially on Windows, there seems little resistance against using the Windows-specific directories. |
Not everyone. For some programs which have been around longer than I've been alive, following the XDG spec as a fallback would be a change in functionality that has worked for decades. Inertia gets in the way there. "If it ain't broke, don't fix it." I'm not aware of any project that has been told about the spec and decided not to follow it but would have followed it if the spec had X changed where X wasn't just keep doing what already works.
People do implement it: $ ls .config
abrt goa-1.0 Pinta
anjuta google-chrome ppsspp
autostart gtk-2.0 pulse
beets gtk-3.0 QtProject.conf
cef_user_data gvbam ranger
Clementine hexchat retroarch
CuteMarkEd Project htop Rygel
dconf ibus rygel.conf
dleyna-renderer-service.conf imsettings sealert.conf
dleyna-server-service.conf inkscape sonata
easytag insta-site syncthing
enchant jstest-gtk systemd
eog keepnote tilda
epiphany libreoffice tomboy
evince libvirt totem
evolution markdownlint tracker
filezilla menus Trolltech.conf
gambatte mimeapps.list unity3d
gconf monitors.xml user-dirs.dirs
gedit mono.addins user-dirs.locale
gespeaker MonoGame VirtualBox
git mopidy vlc
gnome-boxes mpv watch-later
gnome-builder mupen64plus yelp
gnome-control-center myapp youtube-dl
gnome-initial-setup-done nautilus Zeal
gnome-session nvim
gnote PCSX2Just not everyone: $ ls -d .?*
.. .git-credential-cache .lastpass .rbtools-cookies
.adobe .gitk .lesshst .sdkman
.bash_aliases .gnome .local .serverauth.22085
.bash_history .gnupg .m2 .serverauth.4384
.bash_logout .gradle .macromedia .speech-dispatcher
.bashrc .grails .mozilla .ssh
.cache .grails_history .multirust .subversion
.cargo .groovy .netrc .Xauthority
.config .gstreamer-0.10 .npm .xinitrc
.emacs.d .ICEauthority .nvimlog .xsel.log
.esd_auth .idlerc .pki .zshrc
.exercism.json .inputrc .profile
.gimp-2.8 .java .python_history
If you're going to make that argument, having at least one example would be nice. You have a point about most other languages' package managers though. You can add sdkman to the list. |
|
I asked about programs that have issues with XDG, not ones simply that don't impliment it. I'm looking for a downside, a complication, that would cause a program to actively avoid XDG. Right now one hasn't been presented.
I don't believe that is the case. At the least, no one has noted a reason (other than a program being old or inertia) that things don't impliment it. Please let us know if there is some reason you're aware of. |
|
My opinions on this subject (not commenting directly on the content of the RFC, which I've only skimmed - sorry). I think we should change where It's important for consistency that users can find Rust tools in expected places. There is no universal agreement on Unixes about the future of the XDG spec, and we should not use it by default. For those that want XDG we should consider making it optional. |
Why not? On Linux, at least, it seems to be quite popular. I've seen several applications I use move toward using it, and I haven't noticed any moving away. It keeps my home directory much less cluttered. |
|
The xdg directory spec (for user configuration and caching) isn't really something that needs support from the OS. It'd be really unfortunate to hurt our manageability on all unixes just because OS X doesn't explicitly support XDG (that is what "no universal agreement" is referring to, right? I haven't seen any thing that is actually hostile to the xdg directory spec). |
|
People could use the XDG environment variables to stick their mac config in the Library directory (or where it normally goes, I don't have a mac). Then we both have a single Unix policy and everything is in its proper place. Win, win! |
I don't understand this argument. Why do we care if OS X doesn't "support" it? Applications that conform to XDG work fine on Mac OS X, which has no consistent policy about where these files should go. I agree that all Unixes should use the same location (which is what the RFC currently proposes as I recall); I see no argument in favor of making that location not the location specified by XDG. |
I have said this many, many times. It makes it harder for users to predict where their cargo stuff is. If every platform puts their stuff in a different place it makes for a less consistent experience. It makes life more difficult for people using Rust on many platforms (which is something we expect - Rust is aggressively cross-platform). |
|
@brson I think one point people are making, is that on unix (linux, mac or otherwise)
Furthermore If we adopted |
|
I get to scan the output of I even use Windows once in a while to run cargo and I really couldn’t care less if cargo stuff there isn’t in |
The RFC proposes putting these files in the XDG compliant location on all UNIX platforms. It does not propose fragmenting the location of these files more than UNIX vs Windows. I already have programs following XDG on both my Mac and my Arch systems (more on Arch). |
|
This is clearly the right thing to do for windows platforms. I strongly disagree with the argument that "not everyone else follows the spec, so we shouldn't either" - if there were no history behind this choice, the XDG spec would clearly be a better option than the alternative. If we're going to favour tradition above the many benefits it provides, shouldn't we all still be using C++? Postponing this transition is just going to make things harder in the future - I think it's inevitable that we'll want to make this change eventually. |
|
I'm in favor. I don't like |
|
As I previously stated in the #2127 , there are multiple issues with this RFC. It mixes up concepts of XDG user directories (open standard, fully configurable by user via environment variables), Windows "standard" directories (serves different purposes, may sometimes be configurable via registry) and SystemD standard directories (why would anyone want to use these?) Consequently, individual points are poorly researched. The answer to "How do Cargo users benefit from this RFC" sounds unsatisfactory for me. As a precedent, this RFC mentions a couple of software projects, implementing parts of some of the listed standards. Yet, it fails to mention overwhelming amount of software, which does not follow either all or some of listed proposals. Specifically, this RFC does not deal with, nor mention the fact, that many cross-platform programs will keep using XDG or their homebrew conventions on Windows, but no known cross-platform programs will use Windows conventions on Mac or Linux. In my opinion there may be a few reasons for that:
As someone, who is forced to use Windows alongside with Linux on regular basis, and occasionally would use Mac (but, probably, not for Rust development), I would be rather inconvenienced, if this RFC got implemented in it's current state. In my opinion, the only way to work around the shortcomings of this RFC is splitting it into separate RFCs, dealing with individual issues at hand: an RFC about XFG directory layout, one about Windows directory layout, another for Mac directory layout, SystemD directory layout etc. That would allow those proposals to better reach their target audience and make possible constructive discussion of their technical sides (as opposite to whatever is currently going on in this thread). |
What "SystemD standard directories" are you talking about may I ask? All I see in the RFC are |
|
When some software project does something their own way, that does not automatically become "informal addition" to any specifications. Even if that "someone" is (behold!) one of Python packaging frameworks. At most, that's a local quirk, unless proven otherwise. A specification by definition must have a body and endorsers. The mentioned local quirk does not belong to XDG standard body and, as far as I am aware, have never been proposed to XDG mailing lists (and IMO, it wouldn't have stood a critical review, if it were). Whoever calls it a "part of XDG" is trying to ride on XDG name, when, in fact, you have no basis to do so. On other hand, the only documentation of such quick so far is found in SystemD manuals. The largest party, that "endorses" such behavior is Red Hat, by putting a single reference to How does any of this make |
|
@Alexander-- I think simply answering the question along the lines of "The only documentation found endorsing |
|
@SShrike interestingly, the author of this RFC have previously referred to use of |
Duh. The systemd thing was linked in the original post, and I forgot to include it in this RFC (the discussion has been going on for more than half a year already, it's not that unlikely that things will get lost). The |
| +2. Otherwise, if the platform-specific directories exist, use them. | ||
| +3. If that's not the case, check whether the legacy directory exists (`.cargo`) | ||
| + and use it in that case. | ||
| +4. If everything else fails, create the platform-specific directories and use | ||
| + them. | ||
| + | ||
| +This makes Cargo use platform-specific directories for new installs while | ||
| +retaining compatibility for the old directory layout. It also allows one to | ||
| +keep all Cargo related data in one place if one wishes to. | ||
| + | ||
| +## Windows | ||
| + | ||
| +We'll obtain each of the following directories using the correct API. | ||
| + | ||
| +``` | ||
| +cache: AppData\Local\Temp\Cargo |
|
ollie27
I think this should be
tbu-
Using
ollie27
That's true but I would hope that Cargo can manage it's own cache. Do you have any examples of other software using
ollie27
IE's cache is in |
Not quite. As far as this practical application go, this is a natural extension of so-called "DLL hell", a well-known design decision to put all your independently managed executables in single directory. Because what can possibly go wrong? |
|
@Alexander-- I think it's a little harsh to call a directory of executables dynamic linked library hell. executable are not loaded by other executable. |
|
@Ericson2314 Indeed, because this is actually worse, than classic DLL hell. Thanks to existence of sonames, reenacting classic DLL hell from early 90's era with dynamic libraries would be rather hard. But if we talk about executables… |
Well, what can go wrong? Can you elaborate a bit, @Alexander--? |
@Ericson2314 Huh, replacing
I think you must have meant
I appreciate that following the same scheme on Unix allows for consistency everywhere except Windows, but why do you think following XDG on Macs, and every Unix system, is the right thing to do? Certainly the XDG scheme is not the official config scheme on macs. @tbu- can you add a drawback, that this uses a non-standard configuration scheme on mac?
@Alexander-- can you say more about how it conflates these concepts? It's not obvious to me. Particular re systemd - the RFC doesn't mention it. |
|
@tbu- re the first motivation bullet:
ISTM from both your own writing here and other comments that |
|
@brson Cargo has a special case for looking at Is there a official config scheme on Mac that people can agree on? It seems XDG is one valid choice, see e.g. git. Re |
|
@brson For the link to systemd, see the PR that this RFC spawned off from. |
If you're looking for opinions here, I vote |
|
@frewsxcv I'm explicitly not looking for opinions. I'm saying that XDG is a possible standard for Mac, and that I don't know of any standard that everyone can agree on. |
Neither do I, and I don't think Apple has a standard regarding this. They do seem to have recommendations for directories for Apps (like |
@frewsxcv It adds clutter to the home directory, which is a downside if you uss the shell or have Finder configured to show all files, and at the same time the configuration files are missing from the expected location. |
|
regarding
It should be noted that it has the potential for more support than |
Wow! I once wondered about whether that special case existed---the docs at http://doc.crates.io/config.html#hierarchical-structure are extremely unclear as to that point. I think using a different naming scheme for the home directory would make the special casing a lot more intuitive---@tbu- IMO this de-obfuscation is worth adding to the RFC as extra motivation.
Haha yes I did, edited in OP.
I was referencing your earlier post which said:
The point being with this RFC we can be consistent and compliant with respect to
Standards, conformity, etc aside, I think the config vs cache distinction is just useful. For example the college I went to has extremely tiny home directory quotas. So its common for students to go around deleting dot files willy-nilly when they need more space for a soon-due assignment. It's annoying to be without configuration you forget you set (and thus can't easily reset) when you just want to empty some caches. While mac doesn't have official guidance, I consider |
@tbu- Your previous PR suggested "On OS X, use ~/Library/Caches/Cargo for cache files, ~/Library/Cargo for config files and ~/Library/Cargo/bin for binary files." which looks more consistent with OS X norms.
hm, I suppose it's not a disadvantage compared to the status quo, but it does not accomplish the stated goal of the RFC that "using a standard directory for binary outputs can allow the user to execute Cargo-installed binaries without modifying their PATH variable". Because we can't rely on having the system run bins in
Thanks.
Good point, but I think it would be good to get insight from a distro packager. Other language packagers have done similar things for local installations.
@Ericson2314 I don't follow why this special case matters. In this new design wouldn't cargo still be looking either in |
Second one. Note that the current |
Further investigation showed that command line applications on Mac OS X almost universally do not follow this scheme, and it would be outside of the norms for cargo to follow it. I don't want to accuse you of arguing in bad faith, but I can't help but notice that you are having it both ways here. Before you were against putting cargo files in in |
|
I know a transition would not come easy. But, the longer this status quo will be, the harder the implementation will be (expired patch, etc). The given patch has all the steps necessary steps for transition. So, I propose we should implement the XDG standard at least for Linux, as it is the XDG standard platform origin. I wonder those who disagree with this RFC is using Linux. Coz, having too much dotfiles on the In addition, some linux desktops now targeted to casual user (which still far from expectation). And actually this "Dot files problem", is going to be a barrier to them. Hope the Best, |
|
Could we move this RFC into FCP? It's been almost a year since the initial pull request (2015-11-09), and the discussion is no longer active. Preferrably, the answer from the core team would be one of these:
For 1), we can just close the corresponding issues in Cargo (rust-lang/cargo#1734, rust-lang/cargo#1976), for 2) motivated people could try to figure out what is wanted, for 3) we just implement this. |
|
My personal opinion in a different comment: I hope we don't close this as "too late", because the chance to merge this earlier was there for a long time... This change would probably also convince Cargo-related tools to store their things in the platform-specific directories. :) Also, on unixy operating systems, the XDG spec is not only respected by desktop applications: E.g. fish, git, neovim (not the original vim though), rr (the Mozilla record&replay debugger), ... :) |
|
An explicit uniform root directory is great for Cargo and Rust, so people can find everything inside it easily. We should keep using |
|
don't restart the discussion please. people want this, the only reason @tbu- mentioned fish, git, neovim, and rr is because nobody brought that before – your argument has been brought and debunked before. |
|
The argument has indeed been brought up before, and is listed in the Disadvantages section in the RFC text. |
|
and i still don't buy it.
|
|
We're now over a year old. @alexcrichton What needs to be done for this to progress? Can we move this into FCP? What is missing for this? |
<tin_foil_hat=on>What if that is the plan. Wait long enough, then close it as "too late".</tin_foil_hat> |
|
no, they’d never do that, they’re an honest bunch |
|
So I've been trying to catch up on this thread (and on the background issues: I had never heard of XDG before). Since this conversation has been going on now for over a year -- and a significant part of it seems to have taken place in a PR -- I want to produce a kind of summary that I think captures the current state of the conversation. This writeup is not intended to reflect my personal POV; after posting this comment, I will also post my own thoughts. The status quoCargo has a need to store various bits of data. Currently, except for configuration, this is always stored in Of the files in
There are two additional directories containing internal cargo state. Both of these are caches, in that the data in them can always be reconstructed by downloading stuff from the internet.
Locating cargo configuration. In addition to the "user configuration" in their home directory, cargo also allows directories to override the configuration at any point. To find the config file, then, it first traverses the directory hierarchy. If no configuration is found anywhere, then it ultimately checks the user's home directory (note that this is typically visted when traversing the parents of the current directory, but not necessarily). Relation to other programsThis RFC does not discuss other programs. However, changes to the status quo will naturally affect other programs. The most obvious one of these is
The problemThere are some downsides to the current setup:
Proposed solutionThe proposed solution is try and adopt the conventions of the host platform, if they exist. Frequently, this means taking the data that was combined into
Fallback. The RFC is a bit loose about legacy compatibility, the interaction with the "find configuration" search, and the interaction with other tools. It does suggest that we would use the new directories in preference to the old ones, which I have tried to reflect below (I think the particulars of this choice are worth discussing, more later).
Pros and consIf we were to adopt this proposal, would it address the stated problems? The answer varies by platform.
What are other impacts?
Points of informationThere were various things that were not clear to me in writing this write-up. I have mentioned a few as I went, but I wanted to collect those here at the end, and also add a few other points.
|
|
OK, let me speak personally now. Honestly, I have no real dog in this race. I don't care very much where my cargo files go as long as I can find them. I'm old enough that That said, I do have some concerns about the quality of the RFC text itself. In general, it seems pretty light on specifics, and I think it could use more background. I don't think that reading this RFC would be sufficient for a user of cargo to know where their data is found. Also, I think it should absolutely discuss rustup -- this whole conversation feels pretty incomplete with that. So, if it were up to me, I'd want to see the RFC beefed up a little before accepting. Some specific comments:
|
|
awesome writeup, many thanks! a thing to add: some people might have
|
|
Great summary. I can answer some of the Windows questions. The best way to get the location of directories like AppData on Windows is to call the SHGetFolderPath function or SHGetKnownFolderPath if you don't care about Windows XP support. There is a list of special folders that you can get the path of.
Yes,
I would say Windows does have standards for settings vs cache, although you somewhat have to infer them. Putting cache files in
That's a relative path. For a long time, Windows had no guidelines for user binaries. However, since Windows 7,
I can't find much more Microsoft documentation on this at the moment (I've seen it before), but I'll keep looking. I don't think it matters much what other programs do on Windows, even Microsoft programs. Even if some other team inside Microsoft doesn't follow Windows' guidelines, it isn't an excuse for Rust not to. |
|
Regarding rustup, I wrote a proposal rust-lang-nursery/rustup.rs#247 (comment) to move to OS standard directories. I don't think rustup should be using Cargo's bin directory at all. Earlier in that thread @brson says he thinks it's more important for rustup to follow Cargo than the OS and other programs running on it. I disagree with that but if that's the case then I guess rustup changes will need to be shoehorned into this RFC as well. The good thing about rustup is that as it's still in beta we don't have to worry too hard about a migration strategy and can drop support for the legacy directories entirely. |
|
Something I haven't seen anyone talk about in this thread (though it is quite a long thread by now) is why don't we only follow XDG iff the user has the relevent XDG env vars set? That way the XDG behaviour essentially becomes opt-in, and (unless I'm missing something) to me that seems like a win-win. Obviously doesn't really help on Windows though. |
|
XDG is supposed to work without the envars. I don't have them set because I use the defaults. |
|
Well obviously, but it's the only compromise that I can see that would make both groups not entirely unhappy. |
|
@Sean1708 XDG variables are usually not set. They are only set in the exceptional case that you want the directories somewhere nonstandard. This is a bit similar to how |
|
Headings are quotes from @nikomatsakis above.
|
|
I'd very much like to see this change, for many reasons:
To answer what seems to have become a FAQ at this point: |
|
Meanwhile rustup is being bumped to 1.0. |
Bump version to 1.0 #857
|
I said this on the rustup PR, but there's no reason that rustup 1.0 precludes changing how it stores data. Whatever the version number, that ship has sailed, and it will require the same amount of work to make changes. I understand that people are passionate about this issue, and angry at the inaction. There's not much to be done about that now I suppose. Untangling this issue is going to take enormous effort since there are many distinct issues and strong emotions. It's hard to picture when that will happen and how. |
|
i’m also sorry. congrats to 1.0 and i hope this can be done soon! an automatic migration of the data should mitigate the problems. |
|
I've been trying to catch up on this issue some, and @nikomatsakis's summary was extremely helpful. To boil things down even further, I've been thinking about how to frame this question in terms of basic values. Here are some possibilities:
These are all good values; the question, I think, is how to prioritize them. If we look at where we're trying to head with Rust -- increasing productivity and friendliness to new users -- I feel like the second two values are more important than the first. Why? Using Rust on multiple platforms is a relatively advanced thing to do, and it's reasonable to expect a bit more work for that case than for the simpler case of getting up and running with Rust on your "home" platform. Now, even if you agree with that, it's not exactly a slam dunk in favor of the XDG approach on unix systems, since unix "platform expectations" don't necessarily match XDG, and tooling doesn't necessarily take it into account. Reasonable people can argue that In short, I tend to agree with @joshtriplett's comment. In a case where there isn't such a clear-cut choice based on principles alone, let's take the most pragmatic approach. A thought about the cost of changing. Given the algorithm that @nikomatsakis outlined, it seems like this RFC could be implemented in a way that is easily backwards compatible, and the main change would be where to create the directories by default, if they're not found. Am I missing something? One compromise idea -- which is probably a bad one, but still worth mentioning. There was a suggestion to switch to XDG based on environment variables, which was shot down. But I wonder if we could do something similar, based on the existence of a The upside would be "automatic detection" of the "right" platform expectations for a unix system. But there are several downsides. For one, the existence of |
|
good summary, but i’d like to add a few things:
partly.
sadly
i’d extend it to “if ~/.config exists or the but i think it’s hard to find a linux system without ~/.config these days. granted, it’s more likely on a GUI-less system, but even there, most people have git, htop, ImageMagick, fontconfig, gconf, dconf, systemd, neovim and a few things I didn’t see in the 104 directories in there (not counting all the *rcs also in there) |
You mentioned this as a correction, but I don't think we can take that as an agreed-upon fact -- if everybody agreed with that, there wouldn't be a need for debate! I think a more fair assessment is to say that there are multiple conventions at play, with XDG being more recent and a fair amount of software adopting its conventions, and no single convention being universal.
Yep, I was being imprecise and using "XDG" as a proxy for what this RFC proposes to do on unix systems. Mea culpa. |
|
ah, i softened it down to “addition” already. but it’s a fact that XDG isn’t a convention: it’s a spec, to be followed or not followed by software. and i see as little motivation in not folloing it as i see motivation in distributing your software as a single directory in /opt/. We have XDG now, and we should use it. besides, it has tangible benefits. e.g. |
|
@flying-sheep To be clear, I agree with your conclusion and about the benefits, but want to draw a clear line between facts and value judgments. I didn't mean to use the term "convention" in a disparaging sense; conventions are very important! I don't think it makes a lot of difference, in terms of the values I was listing, whether XDG is formalized as a spec or not. The deeper point for the second value is whether it will match the expectations of users for various unix-y systems. We don't have any hard data on what those expectations are, and it's likely that they'll shift over time as XDG continues to take hold (or doesn't). But I think there's enough software following the XDG approach that us following it by default wouldn't strongly violate expectations. You mentioned git, which made me curious. I dug around in https://git-scm.com/docs/git-config#FILES a bit, and it looks like global configuration data is by default written to |
|
yeah, git searches if nothing exists, it defaults to creating git’s situation is different from ours:
i think a fitting comparison to what cargo does might be
AFAIK nobody ever complained that PIP uses platform-specific dirs. i searched a bit in its issues, and everything was about either expanding XDG to OSX or other things, never using |
|
look here for how people feel about ~/.rustup |
|
In terms of arguments against this RFC, I'm left still with a couple of questions:
|
|
@aturon I don't think you've missed anything. Use the new directory if it exists, otherwise use the old directory if it exists, otherwise create and use the new directory. That'll avoid any breakage for existing users, while letting new users get the new directory. I agree with your argument that Rust should focus on getting along with the rest of the world, rather than keeping a different behavior just to increase consistency across platforms for people who use Rust across multiple platforms. I think "matching platform conventions" provides a form of consistency in its own way: you can always expect Rust to follow platform conventions, so look where you'd look for a native program. |
|
My impression is that everyone is in favor of changing the directory on Windows. Since this RFC proposes using XDG on all Unix systems, this RFC is not any more fragmented than an RFC which changes only Windows. For this reason, I really don't see a downside to this RFC other than the transition cost. I think much of the negative attitude is not fully acclimated to the changes to this RFC since the time it proposed putting cargo files in I think the benefits of this RFC are not huge, but when accumulated over the fullness of time, among all future Rust users, they justify the immediate costs. |
|
@alexcrichton @brson when you get a chance, can you give your thoughts on the latest discussion? I think you were the two members of the tools team not in favor of this change in its entirety. |
|
@aturon in all honesty I've grown incredibly weary of this topic. There seem to be no strong arguments against this feature that are taking hold, so it sounds like this is the way to go. |
(rendered)