-
Notifications
You must be signed in to change notification settings - Fork 36
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
Config dir on macOS should not be ~/Library/Preferences #62
Comments
When this fix is made, there will also need to be some API that provides access to the old path, so tools can use it to migrate data to the correct location. |
What about using XDG style paths instead or in addition to? Or having an option to do so? |
I agree that XDG-style paths are preferable for CLI apps, though there would need to be some way to get the desired macOS-style paths for GUI apps. |
@lilyball Maybe only the docs are wrong? |
@squarism That line is the data dir. Look one line up, the config dir is |
This is probably more a bug in dirs-rs than this library per se, but I'd also like to see this fixed; I'd like to adopt directories-rs rather than rolling my own code, but not at the expense of polluting the wrong directories in the process of trying to respect platform conventions :( |
fwiw, that was the rationale for choosing As a user, the hiearchy of |
As Apple keeps tightening its after-sale ownership of macOS appliances, it's becoming increasingly unlikely that randomly dumping stuff in $HOME will keep working. I'm not going to sign up to build stuff that guarantees that people will come running my way when things break a few years down the road, because my lib happens to show up last in their stacktrace.
Alternatively simply do what Apple tells you to do and use |
Switching to the XDG directories would be a major change – though I personally think it's extremely unlikely that you're ever going to be unable to write to dotfiles in |
Alternatively simply do what Apple tells you to do and use |
I'm confused... Doesn't the argument of "As Apple keeps tightening its after-sale ownership of macOS appliances, it's becoming increasingly unlikely that randomly dumping stuff in $HOME will keep working." apply even stronger to Their rules explicitly say it's okay to put your own configuration files in
and I don't see anything mandating the use of |
Apple is tightening up system stuff, including the root volume, but the only restrictions they've placed on what a user can do in their own home folder is adding explicit permissions to accessing certain sensitive data (such as contacts database). There's no motivation for them to prevent users from creating dotfiles and I would be shocked if they ever did it. As for
Stuffing arbitrary stuff into |
Is this bug effectively WONTFIX? If so, could the incorrect behaviour at least be documented and the issue closed? I'm not sure what the point of a platform directories library advertising support for macOS is if it's not going to use the correct platform-specific directories. |
Not WONTFIX; but WORKS AS INTENDED if I don't come up with a bright idea on how to resolve this in a way that doesn't introduce incorrectness. Letting multiple things point to the same folder brings up the same problems as on Windows (https://github.com/soc/directories-rs/blob/master/src/win.rs#L65), where cache/config/data postfixes are added defensively to safe "smart" developers from themselves and shouldn't be done lightly (nor retroactively). |
As I understand the issue, it's neither WONTFIX, nor WORKS AS INTENDED, it's still an attempt at specifying the best behavior. Should the API introduce an optional context to precise things such as |
I think there are already crates out there that do that (this crate won't). |
FWIW I have a user that is interested in the same sort of thing: https://gitlab.com/ttyperacer/terminal-typeracer/-/issues/29 I know what's going on right now is technically the right behavior, but I figured it was worth voicing too. |
Thanks to all for your persistence! Version 3 of both dirs and directories shipped with the proposed change to |
The directories crate doesn't use XDG on macOS, which is apparently the preferred way for CLI apps to store configuration. See: dirs-dev/directories-rs#47 dirs-dev/directories-rs#62
This library is vending ~/Library/Preferences as the config dir on macOS. This is a bad idea. Apple's own documentation explicitly states
Any configuration files written by the app without using one of those two APIs belongs in ~/Library/Application Support instead.
The text was updated successfully, but these errors were encountered: