haskell / haskell/cabal

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

Open
#6,319 0 comments 0 reactions 0 assignees View on GitHub
documentation re: config-file re: project-file
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.