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

"Could not import module" error for GHC 9.0, but GHC 9.2 and 9.4 works fine; nix-shell issue? #65

Closed
peterbecich opened this issue Jan 29, 2023 · 3 comments

Comments

@peterbecich
Copy link

peterbecich commented Jan 29, 2023

I am using doctest-parallel 0.3.0: haskell/hackage-server#1171

The error appears to be different than #22 and the other suggestions.

There is no error at all for GHC 9.4. cabal test DocTests succeeds.

There are intermittent errors for GHC 9.0 and 9.2. cabal run doctests, cabal build, etc. do not solve it. The DocTests may have succeeded one time for GHC 9.2, I'm not sure.

Update: the error only occurs for GHC 9.0 in the nix-shell, so I'm closing this issue

If you want to reproduce the error, please clone https://github.com/peterbecich/hackage-server.git , branch update-doctest-parallel.

Thank you

@martijnbastiaan
Copy link
Owner

That branch doesn't seem to compile for me. Can you run with cabal run doctests -- --debug -j1 and post the behavior you see here (or gist.github.com)?


Git config:

martijn@volthe:~/code/hackage-server$ cat .git/config 
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
[remote "origin"]
	url = git@github.com:peterbecich/hackage-server.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
[branch "update-doctest-parallel"]
	remote = origin
	merge = refs/heads/update-doctest-parallel
martijn@volthe:~/code/hackage-server$ git branch
  master
* update-doctest-parallel

Cabal:

martijn@volthe:~/code/hackage-server$ cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library 

GHC 9.0.2

martijn@volthe:~/code/hackage-server$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.0.2
martijn@volthe:~/code/hackage-server$ cabal run doctests
Error: cabal: Cannot run the test suite 'DocTests' because the solver did not
find a plan that included the test suites for hackage-server-0.5.1. It is
probably worth trying again with test suites explicitly enabled in the
configuration in the cabal.project{.local} file. This will ask the solver to
find a plan with the test suites available. It will either fail with an
explanation or find a different plan that uses different versions of some
other packages. Use the '--dry-run' flag to see package versions and check
that you are happy with the choices.

GHC 9.2.5

martijn@volthe:~/code/hackage-server$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.2.5
martijn@volthe:~/code/hackage-server$ cabal run doctests
Resolving dependencies...
Error: cabal: Cannot run the test suite 'DocTests' because the solver did not
find a plan that included the test suites for hackage-server-0.5.1. It is
probably worth trying again with test suites explicitly enabled in the
configuration in the cabal.project{.local} file. This will ask the solver to
find a plan with the test suites available. It will either fail with an
explanation or find a different plan that uses different versions of some
other packages. Use the '--dry-run' flag to see package versions and check
that you are happy with the choices.

@peterbecich
Copy link
Author

peterbecich commented Jan 29, 2023

Here is the error using GHC 9.0: https://gist.github.com/peterbecich/3a3e945a0533469604ba3c3a66b600f9

This is in the nix-shell.

I'm going to close this issue because I can only reproduce it now in the nix-shell.

Thanks


With GHC 9.2 there is no error, good news. I thought the error happened intermittently with 9.2 but I was wrong.

╭─peterbecich@neptune ~/haskell/libraries/hackage-server2  ‹update-doctest-parallel*› 
╰─➤  cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library 
╭─peterbecich@neptune ~/haskell/libraries/hackage-server2  ‹update-doctest-parallel*› 
╰─➤  ghc --version     
The Glorious Glasgow Haskell Compilation System, version 9.2.5
╭─peterbecich@neptune ~/haskell/libraries/hackage-server2  ‹update-doctest-parallel*› 
╰─➤  cabal run doctests
Up to date
[INFO   ] [ThreadId 4] Examples: 26  Tried: 26  Errors: 0  Unexpected output: 0

cabal test doctests also works

I have omitted all the compilation.


Regarding the compilation error you saw, if you want to continue to investigate this, what does cabal build all --enable-tests result in?

hackage-server needs some libraries. I wonder if cabal run doctests might hide some errors here; could be a Cabal issue.

If that fails, would you try the nix-shell? This will provide GHC 9.0 and all of the libraries:

╭─peterbecich@neptune ~/haskell/libraries/hackage-server2  ‹update-doctest-parallel*› 
╰─➤  nix-shell      

[nix-shell:~/haskell/libraries/hackage-server2]$ which ghc
/nix/store/6i58g7y5bx4vdjfjrf4gzwgcpjf0b1pk-ghc-9.0.2/bin/ghc

@peterbecich peterbecich changed the title "Could not import module" error for GHC 9.0, 9.2 but GHC 9.4 works fine "Could not import module" error for GHC 9.0, but GHC 9.2 and 9.4 works fine; nix-shell issue? Jan 29, 2023
@andreasabel
Copy link
Contributor

The build errors for GHC 9.0 and 9.2 are due to:

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

3 participants