-
Notifications
You must be signed in to change notification settings - Fork 53
Output cabal-store: Use XDG directory structure for cabal 3.10? #210
Description
Newly released cabal 3.10.1.0 uses the XDG directory structure unless a ~/.cabal is already present.
From https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-3.10.1.0.md#significant-changes:
Cabal/cabal-install now uses the XDG Base Directory Specification to store configuration, caches, and the store. Specifically,
$XDG_CONFIG_HOME/cabalstores the configuration file,$XDG_CACHE_HOME/cabalstores downloaded packages and similar, and$XDG_STATE_HOME/cabalmainly contains the store of compiled packages. Further,cabal installwill put executables in~/.local/binby default.The
dist/dist-newstyledirectories are not affected.On Windows, these XDG paths are mapped to other (hopefully) appropriate locations. See the Cabal User Guide for information.
If the
CABAL_DIRenvironment variable is set, the indicated directory will be used to store all Cabal-related files, as in previous versions.Backwards compatibility: If
~/.cabalalready exists, this will be interpreted asCABAL_DIR=~/.cabal. This means that upgrading on an existing system already using cabal-install should not cause any change in behaviour. An existing system can be migrated by deleting~/.cabal(possibly copying~/.cabal/configto~/.config/cabal/configfirst).
We likely need to adapt the cabal-store output to respect this change or make sure stuff lands in ./~cabal as it used to be:
actions/setup/src/setup-haskell.ts
Lines 61 to 67 in 86bd3ed
| if (process.platform === 'win32') { | |
| fs.appendFileSync(configFile, `store-dir: C:\\sr${EOL}`); | |
| core.setOutput('cabal-store', 'C:\\sr'); | |
| } else { | |
| core.setOutput('cabal-store', `${process.env.HOME}/.cabal/store`); | |
| // Issue #130: for non-choco installs, add ~/.cabal/bin to PATH | |
| const installdir = `${process.env.HOME}/.cabal/bin`; |
Upstream issue: