evolutics / haskell-formatter

Haskell source code formatter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

base < 4.8 Restriction Breaks Build

theNerd247 opened this issue · comments

When performing a clean clone and build using make sandbox:

cabal sandbox init
Writing a default package environment file to
/home/noah/src/com/haskell-formatter/cabal.sandbox.config
Using an existing sandbox located at
/home/noah/src/com/haskell-formatter/.cabal-sandbox
make build
make[1]: Entering directory '/home/noah/src/com/haskell-formatter'
cabal install --only-dependencies --enable-tests -j
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: haskell-formatter-1.0.0 (user goal)
next goal: base (dependency of haskell-formatter-1.0.0)
rejecting: base-4.8.2.0/installed-0d6... (conflict: haskell-formatter =>
base>=4.6 && <4.8)
rejecting: base-4.9.0.0, 4.8.2.0, 4.8.1.0, 4.8.0.0, 4.7.0.2, 4.7.0.1, 4.7.0.0,
4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0, 4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0,
4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0, 4.0.0.0, 3.0.3.2, 3.0.3.1 (global
constraint requires installed instance)
Dependency tree exhaustively searched.

Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.
make[1]: *** [Makefile:10: build] Error 1
make[1]: Leaving directory '/home/noah/src/com/haskell-formatter'
make: *** [Makefile:33: sandbox] Error 2

Compiling succeeds with removing the restrictions however running tests fail with this

Thanks for the error report. It looks like it is time to relax the version bounds on base. Since the base version can apparently not be changed in Cabal sandboxes, I need to find another way to test different versions of base.

The tests that fail then are the ones using doctest. I will try to reproduce that once I managed to update Cabal here.

For my system, it works.

Which restrictions did you remove? Is it only the upper version bound on base (< 4.8), or other things as well? Also, what is your version of doctest? Thanks.

I removed the upper bounds base < 4.8 and it built fine. Honesty I would switch to stack. It lets you manage builds much easier and it's rather simple to port a cabal project over to it.

If you switch to stack you can use travis-cl to configure mutliple test builds with different versions of base. See here. That's what I've been doing for my haskell projects.

Hey, that looks cool! ^^ I have not heard about Stack until now – definitely very interesting. It might take a while until I make the step. Cheers.