-
Notifications
You must be signed in to change notification settings - Fork 175
stack and test-suite #640
Comments
Hmm, I solved problem by removing the Setup.hs file. Do not understand why..... |
It's weird. It was working and suddenly not anymore. |
If you need more information let me know. |
Can you try running |
Oh |
Sorry, I tried different combinations but I do not get it solved. |
Hmm, while
|
Have you configured to enable the tests? Else ghc-mod will not know about them, or their dependencies |
@dxld I am beginning to wonder if ghc-mod should not have a private |
|
I do not use stack much, but perhaps run On Tue, Oct 6, 2015 at 10:19 PM, Rik notifications@github.com wrote:
|
What happens if you run the ghc-mod check command after |
@alanz No difference |
Then I can't help On Tue, Oct 6, 2015 at 10:30 PM, Rik notifications@github.com wrote:
|
@alanz as well thanks for your help |
I'll have to give this a closer look at some point then, not sure what's going on. |
@DanielG Let me know if I can help you. |
I'm actually seeing a similar error with
|
I got rid of these errors by installing hspec-discover to my global binaries with stack install hspec-discover. It would of course be nice to not have to do that :) |
@kritzcreek Thanks! This also solved the problem with |
I have the same problem:
Doing |
Steps to reproduce from scratch:
|
We're having the same problem as @ilyagr above. An interesting thing we've discovered that this only seems to be an issue when multiple .hs files are involved. For example, if you modify @ilyagr's sample project above and change the I've also seen some weirdness that I can't reliably reproduce where doing the above to get ghc-mod to work, and then reverting the changes, then trying ghc-mod again results in ghc-mod still working. The issue doesn't seem to be related to the use of hspec-discover in module Spec where
import Test.Hspec
import LibSpec
main :: IO ()
main = hspec spec |
I experience the same issue. I have no clue what's really happening, but I suspect the issue with |
We've since discovered that we can make this problem go away by listing all the non-exposed modules in the test project (ie almost all of them) in the |
I already have all my test modules in the |
No, that was the only thing that changed for us. But it worked sometimes even before that, so there might be something else in play causing the issue for you. Sorry our workaround didn't work for you :( |
Don't worry, I've found my own one ;) |
fwiw I am now getting this issue using |
Ghc-mod should launch GHC with |
@enolan that does sound like a reasonable thing to do. I think this would have to go somewhere in |
Hi, are there any updates on this issue? Currently experiencing this with QuickCheck. I can make ghc-mod happy if I place QuickCheck in library dependencies, but if I keep it in the test section only, I get the 'could not find module QuickCheck' |
Build project with stack. Test dependencies in test-suite (for example hspec) are not recognized by ghc-mod. If I put same dependencies in library section, ghc-mod does not complain anymore.
ghc-mod debug
Warning: resolveModule "/home/rik/haskell/projects/quicksort/test/Spec.hs":
could not execute: hspec-discover
Root directory: /home/rik/haskell/projects/quicksort
Current directory: /home/rik/haskell/projects/quicksort
GHC Package flags:
-hide-all-packages -no-user-package-db -package-db
/home/rik/.stack/snapshots/x86_64-linux/lts-3.4/7.10.2/pkgdb/
-package-db
/home/rik/haskell/projects/quicksort/.stack-work/install/x86_64-linux/lts-3.4/7.10.2/pkgdb/
-package-id QuickCheck-2.8.1-b8cde035baf86e10569b5c8f1da0c941
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-package-id hspec-2.1.10-d1430dd5c99e21ed2da59fe60fa379d9
GHC System libraries: /opt/ghc/7.10.2/lib/ghc-7.10.2
GHC user options:
Stack ghc executable: Just "/opt/ghc/7.10.2/bin/ghc"
Stack ghc-pkg executable:Just "/opt/ghc/7.10.2/bin/ghc-pkg"
Cabal file: Just "/home/rik/haskell/projects/quicksort/quicksort.cabal"
Project: StackProject (StackEnv {seDistDir = ".stack-work/dist/x86_64-linux/Cabal-1.22.4.0", seBinPath = ["/home/rik/.stack/snapshots/x86_64-linux/lts-3.4/7.10.2/bin","/home/rik/bin","/usr/local/sbin","/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin","/usr/games","/usr/local/games","/home/rik/bin","/home/rik/.local/bin/","/home/rik/.cabal/bin","/opt/ghc/7.10.2/bin","."], seSnapshotPkgDb = "/home/rik/.stack/snapshots/x86_64-linux/lts-3.4/7.10.2/pkgdb", seLocalPkgDb = "/home/rik/haskell/projects/quicksort/.stack-work/install/x86_64-linux/lts-3.4/7.10.2/pkgdb"})
Cabal entrypoints:
Setup.hs
Main (/home/rik/haskell/projects/quicksort/Setup.hs)
library
Quicksort (/home/rik/haskell/projects/quicksort/src/Quicksort.hs)
test:spec
Cabal components:
Setup.hs
Main (/home/rik/haskell/projects/quicksort/Setup.hs)
library
Quicksort (/home/rik/haskell/projects/quicksort/src/Quicksort.hs)
test:spec
GHC Cabal options:
Setup.hs
library
-fbuilding-cabal-package -O -outputdir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -odir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -hidir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -stubdir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -i
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -isrc
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -optP-include
-optP.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h
-hide-all-packages -no-user-package-db -package-db
/home/rik/.stack/snapshots/x86_64-linux/lts-3.4/7.10.2/pkgdb/
-package-db
/home/rik/haskell/projects/quicksort/.stack-work/install/x86_64-linux/lts-3.4/7.10.2/pkgdb/
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-XHaskell2010 -Wall
test:spec
-fbuilding-cabal-package -O -outputdir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-odir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-hidir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-stubdir
.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp -i
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-itest -isrc
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-optP-include
-optP.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h
-hide-all-packages -no-user-package-db -package-db
/home/rik/.stack/snapshots/x86_64-linux/lts-3.4/7.10.2/pkgdb/
-package-db
/home/rik/haskell/projects/quicksort/.stack-work/install/x86_64-linux/lts-3.4/7.10.2/pkgdb/
-package-id QuickCheck-2.8.1-b8cde035baf86e10569b5c8f1da0c941
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-package-id hspec-2.1.10-d1430dd5c99e21ed2da59fe60fa379d9
-XHaskell2010 -Wall -Werror
GHC search path options:
Setup.hs
library
-i -i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -isrc
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build -optP-include
-optP.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h
test:spec
-i
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-itest -isrc
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen
-I.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/spec/spec-tmp
-optP-include
-optP.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h
The text was updated successfully, but these errors were encountered: