Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I somehow use a package with a later version of base than what the package specifies?

I'm quite new to the Haskell stack, so I might be misunderstanding how things are intended to work here, but I have a problem that I've seen a few times and am wondering if I'm going about the wrong way.

In short, I sometimes want to use a package with a version spec that is capped at a lower version of base than what my Stack resolver includes.

For example, I can't use the lts-12.14 resolver with PSQueue-1.1, because the former includes base-4.11.1 and the latter requires base >=4 && <4.11.

The two ways I have found to resolve that has been to either

  • add a specific version of base to my extra-deps, making sure that the pinned version is within the range my package allows; or
  • choose a different resolver (using e.g. https://www.stackage.org/diff/ to figure out which one is the latest resolver with an early enough version of base)

Both of these feel suboptimal, especially since I might want to use packages which have non-overlapping ranges (e.g. one >=3 && <4.11 and one >=4.11). I realize that using such a combination toghether might fail, especially if they are locked on different major-versions of base (assuming base uses semver), but so far I'm only writing pretty small programs, so if they seem to work I'm quite happy even if there are other, non-exercised code paths that will fail on the specific combination of packages and versions. In other words: I know the risk - but I can't chance it, because I don't know how to.

Is there a way to force Stack to allow a newer version of base than the one specified in the requirements of a dependency?

like image 635
Tomas Aschan Avatar asked Jan 14 '19 18:01

Tomas Aschan


1 Answers

I think you are looking for allow-newer - https://docs.haskellstack.org/en/stable/yaml_configuration/#allow-newer

Ignore version bounds in .cabal files. Default is false.

like image 168
tylerweir Avatar answered Nov 10 '22 04:11

tylerweir