crem icon indicating copy to clipboard operation
crem copied to clipboard

nix build fails because TwoSwitchesGate is an lhs file

Open silky opened this issue 1 year ago • 2 comments

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 :/

silky avatar May 13 '24 06:05 silky

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?

marcosh avatar May 13 '24 08:05 marcosh

Yeah there's two things at play here:

  1. Your cabal build is actually cheating somehow; when I run cabal build I 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.
  1. 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 :)

silky avatar May 13 '24 08:05 silky