kcsongor / generic-lens

Generically derive traversals, lenses, and prisms.
437 stars 53 forks source link

can't get it on nixos: test suite failed. #59

Closed YuMingLiao closed 6 years ago

YuMingLiao commented 6 years ago

I `nix-haskell ghc843 generic-lens' and get error.

Preprocessing test suite 'examples-doctests' for generic-lens-1.0.0.1..
Building test suite 'examples-doctests' for generic-lens-1.0.0.1..
[1 of 1] Compiling Main             ( examples/doctest.hs, dist/build/examples-doctests/examples-doctests-tmp/Main.o )
Linking dist/build/examples-doctests/examples-doctests ...
running tests
Running 6 test suites...
Test suite generic-lens-bifunctor: RUNNING...
Test suite generic-lens-bifunctor: PASS
Test suite logged to:
dist/test/generic-lens-1.0.0.1-generic-lens-bifunctor.log
Test suite generic-lens-examples: RUNNING...
Test suite generic-lens-examples: PASS
Test suite logged to: dist/test/generic-lens-1.0.0.1-generic-lens-examples.log
Test suite generic-lens-test: RUNNING...
Test suite generic-lens-test: PASS
Test suite logged to: dist/test/generic-lens-1.0.0.1-generic-lens-test.log
Test suite generic-lens-syb-tree: RUNNING...
Test suite generic-lens-syb-tree: PASS
Test suite logged to: dist/test/generic-lens-1.0.0.1-generic-lens-syb-tree.log
Test suite doctests: RUNNING...
Test suite doctests: PASS
Test suite logged to: dist/test/generic-lens-1.0.0.1-doctests.log
Test suite examples-doctests: RUNNING...

examples/Biscuits.hs:12:1: error:
    Could not find module ‘Data.Generics.Product’
    Use -v to see a list of the files searched for.
   |
12 | import Data.Generics.Product
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

examples/Biscuits.hs:13:1: error:
    Could not find module ‘Data.Generics.Sum’
    Perhaps you meant
      Data.Generics (from syb-0.7)
      Data.Generics.Text (from syb-0.7)
    Use -v to see a list of the files searched for.
   |
13 | import Data.Generics.Sum
   | ^^^^^^^^^^^^^^^^^^^^^^^^
Test suite examples-doctests: FAIL
Test suite logged to: dist/test/generic-lens-1.0.0.1-examples-doctests.log
5 of 6 test suites (5 of 6 test cases) passed.
builder for '/nix/store/cpzaq3n7yzfgji973axggynsf90bj07r-generic-lens-1.0.0.1.drv' failed with exit code 1
cannot build derivation '/nix/store/6cpl1n2mscn1iv4flmxbszmgs6n1qaf2-ghc-8.4.3-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/6cpl1n2mscn1iv4flmxbszmgs6n1qaf2-ghc-8.4.3-with-packages.drv' failed

I git clone it and stack build. It says ghc841 is missing. My nixos-unstable doesn't have ghc841.

Then I changed resolver to resolver: nightly-2018-08-09 (It's ghc843) and stack test worked.

Should the resolver be updated? Or it's just an nixos issue?

kcsongor commented 6 years ago

I just tested locally with stack, and got the same error as you did, so I updated the resolver version to the latest nightly, which indeed works on my local machine.

I'm not familiar with the ways of nix -- how should I go about fixing this? Or will the updated stackage resolver somehow percolate into the nix store?

YuMingLiao commented 6 years ago

I found a discussion about updating haskell packages in nix. But I don't really get it...

Thanks for confirmation!

kcsongor commented 6 years ago

I think the actual solution was this: https://github.com/kcsongor/generic-lens/pull/60

YuMingLiao commented 6 years ago

Thanks!

twhitehead commented 5 years ago

nixpkgs included the #60 patch in master. I just submitted a pull request to get this into 18.09 as well.

https://github.com/NixOS/nixpkgs/pull/50806