Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Output cabal-store: Use XDG directory structure for cabal 3.10? #210

@andreasabel

Description

@andreasabel

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/cabal stores the configuration file,$XDG_CACHE_HOME/cabal stores downloaded packages and similar, and $XDG_STATE_HOME/cabal mainly contains the store of compiled packages. Further, cabal install will put executables in ~/.local/bin by default.

The dist/dist-newstyle directories 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_DIR environment variable is set, the indicated directory will be used to store all Cabal-related files, as in previous versions.

Backwards compatibility: If ~/.cabal already exists, this will be interpreted as CABAL_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/config to ~/.config/cabal/config first).

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:

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:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions