Skip to content
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

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

Open
Bodigrim opened this issue Jan 5, 2025 · 0 comments

Comments

@Bodigrim
Copy link
Collaborator

Bodigrim commented Jan 5, 2025

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

@Bodigrim Bodigrim changed the title Is ~/.cabal/config is supposed to be used when exists or not, in the absence of envvars? Is ~/.cabal/config is supposed to be used when exists, in the absence of envvars and XDG folder? Jan 5, 2025
@Bodigrim Bodigrim changed the title Is ~/.cabal/config is supposed to be used when exists, in the absence of envvars and XDG folder? Is ~/.cabal/config supposed to be used when exists, in the absence of envvars and XDG folder? Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant