-
Notifications
You must be signed in to change notification settings - Fork 702
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
directory: ensure xdg compliance #7188
Conversation
f401088
to
3b4980d
Compare
Just making this change will break all cabal users. There should be some migration story, and this change should be clearly and well communicated in advance. I'm sorry, but I cannot accept this PR. (Also |
I can add a check in this PR looking for .cabal, use it if found and otherwise default to XDG paths. This should ensure a smooth transition and could eventually be removed in a later release. Are you fine with that? |
@@ -63,7 +63,7 @@ import Data.TreeDiff.Pretty (ansiWlEditExprCompact) | |||
parseIndex :: (Monoid a, NFData a) => (FilePath -> Bool) | |||
-> (FilePath -> B.ByteString -> IO a) -> IO a | |||
parseIndex predicate action = do | |||
cabalDir <- getAppUserDataDirectory "cabal" | |||
cabalDir <- getXdgDirectory XdgData "cabal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also not right. E.g. ~/.cabal/config
is XdgConfig
, and about everything else (e.g. ~/.cabal/store
, ~/.cabal/packages
) are probably XdgCache
.
What about ~/.cabal/bin
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I wasn't sure either of how cabal was processing all of its config, so I figured the fastest way to see was to draft up a PR for review. Will change the appropriate paths once validate finishes to complete.
~/.cabal/bin
should be ~/.local/bin
as per the systemd file system specification, no environment variable there. This one is a little bit less thought out but that's the current take on it.
Related: #680
you may be referring to this: #1857 (comment) (and later comments) |
any progress here? I fought so hard to get a clean $HOME and now it is being littered by multiple new tools, including cabal... |
There was no activity here for a long while, and a more comprehensive solution is being developed in #7386. Should we close it? |
Hello! Anybody here? :) |
Hey! Just saw your comment @Mikolaj . I'm going to close this PR as yours definitely supersedes mine, although I'll have to pass on the review. Good luck with this though! |
Thank you. When it's released, let us know if you notice any problems. |
Please include the following checklist in your PR:
changelog.d
directory).^ Not sure how I should add that to the changelog, any input appreciated!
This ensures compliance with the XDG base specification.
This will need to be merged alongside the upstream ghc PR https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4567 to avoid any unintended breakage.
This fixes the upstream bug https://gitlab.haskell.org/ghc/ghc/-/issues/6077