Skip to content

Improve migration strategy for the XDG compliance change to the GHC appdir

Zubin requested to merge wip/xdg-fix into master

Improve migration strategy for the XDG compliance change to the GHC application directory.

We want to always use the old path (~/.ghc/..) if it exists. But we never want to create the old path. This ensures that the migration can eventually be completed once older GHC versions are no longer in circulation.

We first check for ~/.ghc/<arch-ver> and use that if it exists (for ghc and ghc-pkg at least). Otherwise we use $XDG_DATA_HOME/ghc/<arch-ver>

For GHCi files (ghci.conf, ghci_history), we check if ~/.ghc exists, and use that if it does. Otherwise we use $XDG_DATA_HOME/ghc.

Fixes #20684 (closed), #20669 (closed), #20660 (closed)

Edited by Zubin

Merge request reports