Skip to content

Is ~/.cabal/config supposed to be used when exists, in the absence of envvars and XDG folder? #10713

@Bodigrim

Description

@Bodigrim

cabal/doc/config.rst

Lines 80 to 86 in ed1e4d7

The configuration file location is determined as follows:
1. If option ``--config-file`` is given, use it;
2. otherwise, if ``$CABAL_CONFIG`` is set use it;
3. otherwise, if ``$CABAL_DIR`` is set use ``$CABAL_DIR/config``;
4. otherwise use ``config`` in ``$XDG_CONFIG_HOME/cabal``, which
defaults to ``~/.config/cabal`` on Unix.

The documentation means that unless --config-file / $CABAL_DIR / $CABAL_CONFIG are set explicitly, ~/.cabal/config won't ever be used even if it exists and ~/.config/cabal does not. Yet, reading https://github.com/haskell/cabal/blob/master/cabal-install/src/Distribution/Client/Config.hs, I believe this is untrue. Could it please be reconciled?

Cf. haskell-CI/haskell-ci#655

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions