Skip to content

Remove special global Cabal? #3049

@mgsloan

Description

@mgsloan

I believe that with support for the custom-setup stanza, #2866 , we're using the snapshot / extra-deps version of Cabal for building anything with a custom-setup stanza.

For everything else, we're using the globally installed version of Cabal (the one updated via stack setup --upgrade-cabal). This can be nice, as you can update your Cabal version without needing to modify your configurations. This means that you can get bugfixes / enhancements without updating your build configs.

This seems inconsistent to me, I think it might simplify things to always use the snapshot / extra-deps version of Cabal.

Edit: One tricky detail that I'm only considering now that I've typed all this up, is that in order to build Cabal and its dependencies, we'll need to use an existing version of Cabal - likely the global one. So it seems hard to get full consistency of Cabal version used. Thoughts on this? Just special case Cabal and its transitive deps?

We'd get the following benefits:

  1. Better build reproducibility
  2. Ability to use a custom Cabal - Support using a custom Cabal  #2910 - can even have it as a local package incase you need custom modifications
  3. Obviates the need for enhancing stack setup to specify a cabal version to install (Add stack setup --install-cabal VERSION in addition to stack setup --upgrade-cabal. #2386 / Add --cabal-install #2995)
  4. Would fix Cabal version mismatch errors caused by lacking a custom-setup stanza - Stack is using a different version of cabal to install extra-deps packages #2924
  5. Obviates the need for a proposed require-cabal-version field in stack.yaml - Add "require-cabal-version" and use this to enable Cabal-1.24 build plans #2479
  6. Removal of stack setup --upgrade-cabal would mean --upgrade-cabal wants write access to system ghc installation #2230 can be closed (case where it wants to write to a system ghc install)

This would add an implicit dependency on Cabal to every package. So, if Cabal or anything it depends on is installed locally, everything must be installed locally rather than in the snapshot.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions