crem
crem copied to clipboard
nix build fails because TwoSwitchesGate is an lhs file
running nix build . i get
> Error:
>
> <no location info>: error:
> Could not load module ‘Crem.Example.TwoSwitchesGate’
> It is a member of the hidden package ‘crem-0.1.0.0’.
> You can run ‘:set -package crem’ to expose it.
> (Note: this unloads all the modules in the current scope.)
i think it's because the TwoSwitchesGate module is defined in an lhs file, and perhaps something special has to be done to make nix find that :/
Hi Noon, thanks for reporting!
You know Nix much better than me...
I tried to follow the README instructions and using
nix develop
and then
cabal build
inside the shell works like a charm.
So the question is, what's the difference between nix develop and nix build?
Yeah there's two things at play here:
- Your
cabal buildis actually cheating somehow; when I runcabal buildI get:
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Warning: Requested index-state 2023-03-14T09:58:19Z is newer than
'hackage.haskell.org'! Falling back to older state ().
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: crem-0.1.0.0 (user goal)
[__1] trying: crem:*test
[__2] next goal: crem:hspec-discover:exe.hspec-discover (dependency of crem
*test)
[__2] rejecting:
crem:hspec-discover:exe.hspec-discover-2.8.5/installed-FTVhaVWjrbjHDYFa4NfYZ8
(does not contain executable 'hspec-discover', which is required by crem
*test)
[__2] fail (backjumping, conflict set: crem,
crem:hspec-discover:exe.hspec-discover, crem:test)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: crem, crem:test,
crem:hspec-discover:exe.hspec-discover, hspec, hspec-discover
Try running with --minimize-conflict-set to improve the error message.
- The original issue
So I suppose there's now two things to fix 😀
Unfortunately I had a quick glance and couldn't fix it. I'll try and take a closer look at some point :)