Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with data-fix-0.0.7 #63

Closed
mdorman opened this issue Sep 13, 2017 · 12 comments
Closed

Doesn't work with data-fix-0.0.7 #63

mdorman opened this issue Sep 13, 2017 · 12 comments

Comments

@mdorman
Copy link

mdorman commented Sep 13, 2017

To be clear, I do not in any way, shape or form understand this failure.

With version 0.0.7 of the data-fix package, hnix fails to build its tests with the following error:

tests/ParserTests.hs:340:23: error:
    • No instance for (Data.Functor.Classes.Eq1 NExprF)
        arising from a use of ‘assertEqual’
    • In the expression:
        assertEqual ("Parsing data file " ++ file) expected actual
      In a case alternative:
          Success actual
            -> assertEqual ("Parsing data file " ++ file) expected actual
      In a stmt of a 'do' block:
        case res of {
          Success actual
            -> assertEqual ("Parsing data file " ++ file) expected actual
          Failure err
            -> assertFailure
               $ "Unexpected error parsing data file `"
                 ++ file ++ "':\n" ++ show err }

On the other hand, with version 0.0.4, it builds fine.

The part that I find baffling is that the only difference between those versions would appear to be:

diff -uNr /home/mdorman/t/data-fix-0.0.4/ /home/mdorman/t/data-fix-0.0.7/
diff -uNr /home/mdorman/t/data-fix-0.0.4/data-fix.cabal /home/mdorman/t/data-fix-0.0.7/data-fix.cabal
--- /home/mdorman/t/data-fix-0.0.4/data-fix.cabal	2017-03-29 05:37:43.000000000 -0400
+++ /home/mdorman/t/data-fix-0.0.7/data-fix.cabal	2017-09-03 18:04:27.000000000 -0400
@@ -1,6 +1,6 @@
 Name:            data-fix
-Version:         0.0.4
-Cabal-Version:   >= 1.6
+Version:         0.0.7
+Cabal-Version:   >= 1.10
 License:         BSD3
 License-file:    LICENSE
 Author:          Anton Kholomiov
@@ -12,7 +12,7 @@
   Fixpoint types and recursion schemes. If you define your AST as
   fixpoint type, you get fold and unfold operations for free.
   .
-  Thanks for contribution to: Matej Kollar
+  Thanks for contribution to: Matej Kollar, Herbert Valerio Riedel
 
 Stability:       Experimental
 
@@ -24,7 +24,8 @@
     Location: https://github.com/anton-k/data-fix
 
 Library
-  Build-depends: base >= 4, base < 5
+  Default-Language: Haskell2010
+  Build-depends: base >= 4.7, base < 5
   Hs-source-dirs: src/
 
   ghc-options: -Wall

Diff finished.  Wed Sep 13 06:24:32 2017
@mdorman
Copy link
Author

mdorman commented Sep 13, 2017

Just as a note, I'm building on nixos, synced to roughly the latest commit. The command I used to run the build was nix-build --no-build-output --attr haskellPackages.hnix ~/src/nixpkgs. When I started getting the error, I bisected to the change that updated data-fix, backed out that one single update to the haskellPackages set, and it built again.

@Profpatsch
Copy link
Contributor

Here’s the whole change:

screenshot

Probably something in base or tasty-hunit changed.

@Profpatsch
Copy link
Contributor

Profpatsch commented Sep 13, 2017

Oh, @jwiegley, 0.3.4 was uploaded a few days ago, but the last commit on github is from May?! (Curse hackage being unaware of the source code repo.)

@anton-k
Copy link

anton-k commented Sep 13, 2017

Hi! i'm the author of data-fix. Unfortunately it doesn't compile with the latest ghc. There are some incompatible changes regarding instances of Eq vs Eq1 and Ord vs Ord1. I don't completely understand them right now, but if my package causing any trouble I'm willing to learn and cooperate :)

@anton-k
Copy link

anton-k commented Sep 13, 2017

There was a PR that proposed the updates. I have accpeted it. It's data-fix-0.6 but then I've reverted it in 0.7 since some of my libraries doesn't work well with it. Maybe I need to update the libraries also and keep the change to make your packages compile!

Can you try out the data-fix-0.0.6. Does it work for you?

@anton-k
Copy link

anton-k commented Sep 13, 2017

The 0.0.7 is exactly as 0.0.4

@mdorman
Copy link
Author

mdorman commented Sep 13, 2017

@Profpatsch It's not one of the deps, because I can add a data-fix_0_0_4 expression, point hnix to that expression and it works---so that's definitely the source of the issue.

@anton-k I don't quite understand the nature of the failure myself---I hope to do a little investigation, but I'm hardly an expert. I do wonder if the change in the haskell version is actually the issue?

@Profpatsch
Copy link
Contributor

Profpatsch commented Sep 13, 2017

With 0.0.6, the error is the same:

→ ghc-pkg list
/nix/store/0k3j1cg179shkdnsk86p01cvkaxl42ap-ghc-8.0.2-with-packages/lib/ghc-8.0.2/package.conf.d
    Cabal-1.24.2.0
    …
    data-fix-0.0.6
…

→ cabal test
Preprocessing library for hnix-0.3.4..
Building library for hnix-0.3.4..
…
[3 of 5] Compiling ParserTests      ( tests/ParserTests.hs, dist/build/hnix-tests/hnix-tests-tmp/ParserTests.o )

tests/ParserTests.hs:348:23: error:
    • No instance for (Data.Functor.Classes.Eq1 NExprF)
        arising from a use of ‘assertEqual’
    • In the expression:
        assertEqual ("Parsing data file " ++ file) expected actual
      In a case alternative:
          Success actual
            -> assertEqual ("Parsing data file " ++ file) expected actual
      In a stmt of a 'do' block:
        case res of {
          Success actual
            -> assertEqual ("Parsing data file " ++ file) expected actual
          Failure err
            -> assertFailure
               $ "Unexpected error parsing data file `"
                 ++ file ++ "':\n" ++ show err }

The corresponding failing function is:

assertParseFile :: FilePath -> NExpr -> Assertion
assertParseFile file expected = do
  res <- parseNixFile $ "data/" ++ file
  case res of
    Success actual -> {- HERE -} assertEqual ("Parsing data file " ++ file) expected actual
    Failure err    -> assertFailure $ "Unexpected error parsing data file `" ++ file ++ "':\n" ++ show err

I’m on the latest nixpkgs master with these haskell packages. hnix is checked out from the github master.

@Profpatsch
Copy link
Contributor

Profpatsch commented Sep 13, 2017

Update: can confirm that it works with 0.0.4 and hnix 0.3.4. But not with 0.0.6 or 0.0.7.

@jwiegley
Copy link
Member

@Profpatsch Do you recommend setting an upper bound, or does it now work with 0.0.7?

@Profpatsch
Copy link
Contributor

Profpatsch commented Sep 23, 2017

Yes, it works with 0.0.7. So a lower bound on 0.0.7 might be sensible, or an exclusion of 0.0.6.

Based on my input, the author bumped the version to 0.2.0, so they can indicate non-API-breaking changes.

@jwiegley
Copy link
Member

OK, I've changed the latest version of hnix to depend on at least 0.0.7 of data-fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants