Skip to content

Clarify the relationship between ~/.cabal/config and cabal.project files #6319

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

Open
lexi-lambda opened this issue Oct 29, 2019 · 0 comments
Open
Labels
documentation re: config-file Concerning the cabal configuration file and the `--config-file` option re: project-file Concerning cabal.project files

Comments

@lexi-lambda
Copy link

lexi-lambda commented Oct 29, 2019

The ~/.cabal/config and cabal.project files are ostensibly very similar, and the documentation for cabal.project files states the following:

The full configuration of a project is determined by combining the following sources (later entries override earlier ones):

  1. ~/.cabal/config (the user-wide global configuration)
  2. cabal.project (the project configuration)
  3. cabal.project.freeze (the output of cabal v2-freeze)
  4. cabal.project.local (the output of cabal v2-configure)

At first I interpreted this to mean that ~/.cabal/config is basically just a global cabal.project file, albeit probably without clearly project-specific options like packages. However, this appears to not be the case: some things use a shared syntax between the two files, but others do not. For example, package stanzas are not allowed in ~/.cabal/config (why not?).

It would be nice if the documentation were clearer about how these configuration formats relate, if they relate at all.

(This is very related to #2403.)

@ulysses4ever ulysses4ever added the re: config-file Concerning the cabal configuration file and the `--config-file` option label Sep 19, 2022
@ulysses4ever ulysses4ever added the re: project-file Concerning cabal.project files label Nov 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation re: config-file Concerning the cabal configuration file and the `--config-file` option re: project-file Concerning cabal.project files
Projects
None yet
Development

No branches or pull requests

3 participants