cabal icon indicating copy to clipboard operation
cabal copied to clipboard

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

Open lexi-lambda opened this issue 6 years ago • 0 comments

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.)

lexi-lambda avatar Oct 29 '19 19:10 lexi-lambda