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

Doctests on crem-examples not working on nix #64

Open
marcosh opened this issue Feb 27, 2023 · 0 comments
Open

Doctests on crem-examples not working on nix #64

marcosh opened this issue Feb 27, 2023 · 0 comments
Assignees

Comments

@marcosh
Copy link
Owner

marcosh commented Feb 27, 2023

When running nix build -L ".#crem.ghc90" with doctests in crem-examples, I get

crem> Could not import module: Crem.Example.TwoSwitchesGate. This can be caused by a number of issues:                                                                                                                                      
crem>  1. A module found by GHC contained tests, but was not in 'exposed-modules'. If you want                                                                                                                                              
crem>     to test non-exposed modules follow the instructions here:                                                                                                                                                                         
crem>     https://github.com/martijnbastiaan/doctest-parallel#test-non-exposed-modules                                                                                                                                                      
crem>  2. For Cabal users: Cabal did not generate a GHC environment file. Either:                                                                                                                                                           
crem>    * Run with '--write-ghc-environment-files=always'                                                                                                                                                                                  
crem>    * Add 'write-ghc-environment-files: always' to your cabal.project                                                                                                                                                                  
crem>  3. For Cabal users: Cabal did not generate a GHC environment file in time. This                                                                                                                                                      
crem>     can happen if you use 'cabal test' instead of 'cabal run doctests'. See                                                                                                                                                           
crem>     https://github.com/martijnbastiaan/doctest-parallel/issues/22.                                                                                                                                                                    
crem>  4. The testsuite executable does not have a dependency on your project library. Please                                                                                                                                               
crem>     add it to the 'build-depends' section of the testsuite executable.                                                                                                                                                                
crem> See the example project at https://github.com/martijnbastiaan/doctest-parallel/blob/main/example/README.md for more information.                                                                                                      
crem> The original reason given by GHCi was:                                                                                                                                                                                                
crem> Error:                                                                                                                                                                                                                                
crem> <no location info>: error:                                                                                                                                                                                                            
crem>     Could not load module ‘Crem.Example.TwoSwitchesGate’                                                                                                                                                                              
crem>     It is a member of the hidden package ‘crem-0.1.0.0:crem-examples’.                                                                                                                                                                
crem>     You can run ‘:set -package crem’ to expose it.                                                                                                                                                                                    
crem>     (Note: this unloads all the modules in the current scope.)
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

2 participants