Skip to content

Add "require-cabal-version" and use this to enable Cabal-1.24 build plans #2479

@mgsloan

Description

@mgsloan

The fix to haskell/cabal#1725 is in Cabal >= 1.24. This means that configure doesn't always need to take as many deps (for buildable: false). In #2475 , this came up as issues with the solver, because the solver thinks some things aren't deps, that stack thinks are necessary deps.

Currently, the Cabal version in use is something selected by the user not the project, and this can be a source of non-determinism. Currently build plan resolution is independent of Cabal version, and we'd prefer to keep it that way. Why? Because then we have better hope for consistent results for users. Lets say we do vary build-plan based on installed Cabal version. Then, a stack.yaml for Cabal-1.24 could easily break for a user of Cabal-1.22.

How do we solve this? I think I prefer the following approach:

  1. Add a require-cabal-version field, similar to require-stack-version. Check installed Cabal version on build.

  2. When the version range excludes < 1.24, instead use the build plans with fewer deps. This way we can force consistency.

  3. Relevant to stack init --resolver ghc-7.10.3 creates incomplete stack file #2475, for stack init, this would mean that when the user has cabal-install >= 1.24, it will output a stack.yaml with require-cabal-version: ">= 1.24". If the user is using an earlier version, then a warning will be omitted and no require-cabal-version added.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions