Stackage: Diff test suite fails to compile

Created on 9 Jan 2019  Â·  7Comments  Â·  Source: commercialhaskell/stackage

No one to report it to, so:

[3 of 3] Compiling Main             ( test/Test.hs, dist/build/diff-tests/diff-tests-tmp/Main.o )

test/Test.hs:137:16: error:
    • Couldn't match expected type ‘Double’ with actual type ‘Bool’
    • In the first argument of ‘cover’, namely ‘(haskDiff == utilDiff)’
      In the expression: cover (haskDiff == utilDiff) 90 "exact match"
      In the expression:
        cover (haskDiff == utilDiff) 90 "exact match"
          $ classify
              (haskDiff == utilDiff)
              "exact match"
              (div ((length haskDiff) * 100) (length utilDiff) < 110)
    |
137 |     in  cover (haskDiff == utilDiff) 90 "exact match" $
    |                ^^^^^^^^^^^^^^^^^^^^
test-suite

Most helpful comment

@terlar thanks--I was able to do this like so, hopefully it's useful for someone else: https://gist.github.com/ddellacosta/910c09f284e6a1eabdf9d3c658547019

All 7 comments

Same issue appeared during trying to build project with nix-shell on OS X for ghc-8.4.4.

I can verify I experience the same with nix-shell on NixOS for ghc-8.2.2.

cc Sterling Clover s.clover@gmail.com

I was able to reproduce this locally like so:

stack unpack Diff-0.3.4 && cd Diff-0.3.4
echo 'resolver: nightly-2019-02-24' > stack.yaml
stack build --test --bench --no-run-benchmarks --fast

The test suite passes if you swap the order of args to cover on the line mentioned in the error message:

cover 90 (haskDiff == utilDiff) "exact match"

@swamp-agr or @terlar did you find a workaround for this in Nix? Apologies if this is the wrong place to ask this, happy to move this discussion elsewhere if need be.

@ddellacosta No, but I think you should be able to do an overlay/patch and apply it here:
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-common.nix#L1038

But for the Diff package instead and with the proposed change above. See this for more details:
https://nixos.org/nixpkgs/manual/#how-to-specify-source-overrides-for-your-haskell-package

Another solution I am using for one repo is a pinned nixpkgs repo with an older minor version that don't have this issue.

@terlar thanks--I was able to do this like so, hopefully it's useful for someone else: https://gist.github.com/ddellacosta/910c09f284e6a1eabdf9d3c658547019

This wasn't fixed in the actual package release, as far as I know, but curators will not be taking any further action on this, so I'm closing the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

igrep picture igrep  Â·  3Comments

ygale picture ygale  Â·  7Comments

alexeyzab picture alexeyzab  Â·  4Comments

bergmark picture bergmark  Â·  8Comments

alexeyzab picture alexeyzab  Â·  7Comments