user3550758
user3550758

Reputation: 71

How to update .cabal file using Stack?

I have an older project that I created with Stack. I want to move my project to the latest LTS set from Stackage.

When I change the resolver in the stack.yaml file, the problem is that the versions in the extra-deps in the .cabal file are still for the old LTS set. Is there a way to automatically update the version numbers in the .cabal file using Stack?

Upvotes: 4

Views: 1392

Answers (1)

sjakobi
sjakobi

Reputation: 3606

You could simply delete (some of) the (upper) bounds of the build-depends in your cabal file.

When it comes to distributing your package, stack can automatically add dependency bounds if you use the --pvp-bounds flag, e.g. stack sdist --pvp-bounds upper, stack upload --pvp-bounds both etc.

There's a blog post by Michael Snoyman on this feature.

Upvotes: 0

Related Questions