Skip to content
This repository has been archived by the owner on Apr 25, 2020. It is now read-only.

Can't satisfy dependencies in projects created by stack #605

Open
mineo opened this issue Sep 16, 2015 · 2 comments
Open

Can't satisfy dependencies in projects created by stack #605

mineo opened this issue Sep 16, 2015 · 2 comments

Comments

@mineo
Copy link

mineo commented Sep 16, 2015

Here's what I did:

↪ stack new simple
[...]
↪ cd simple
↪ stack build
simple-0.1.0.0: configure
Configuring simple-0.1.0.0...
simple-0.1.0.0: build
Preprocessing library simple-0.1.0.0...
[1 of 1] Compiling Lib ( src/Lib.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Lib.o )
In-place registering simple-0.1.0.0...
Preprocessing executable 'simple-exe' for simple-0.1.0.0...
[1 of 1] Compiling Main ( app/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/simple-exe/simple-exe-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/simple-exe/simple-exe ...
simple-0.1.0.0: install
Installing library in
/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/lib/x86_64-linux-ghc-7.10.2/simple-0.1.0.0-1IIGo5ep6Dc2qVkLbojo7S
Installing executable(s) in
/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/bin
Registering simple-0.1.0.0...
↪ ghc-mod boot
ghc-mod: : cannot satisfy -package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
(use -v for more information)

GHC in /usr/bin is 7.10.1, I've previously built 7.10.2 for stacks lts-3.5 resolver with stack setup. I think stack itself is using the latter version of GHC to build things.

/Edit: Sorry, forgot the output of ghc-mod debug:

↪ ghc-mod debug
Root directory: /home/wieland/dev/ghc-mod-test/simple
Current directory: /home/wieland/dev/ghc-mod-test/simple
GHC Package flags:
-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/wieland/.stack/snapshots/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-db
/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-XHaskell2010
GHC System libraries: /usr/lib/ghc-7.10.1
GHC user options:

Stack ghc executable: Just "/home/wieland/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc"
Stack ghc-pkg executable:Just "/home/wieland/.stack/programs/x86_64-linux/ghc-7.10.2/bin/ghc-pkg"
Cabal file: Just "/home/wieland/dev/ghc-mod-test/simple/simple.cabal"
Project: StackProject (StackEnv {seDistDir = ".stack-work/dist/x86_64-linux/Cabal-1.22.4.0", seBinPath = ["/home/wieland/.stack/snapshots/x86_64-linux/lts-3.5/7.10.2/bin","/home/wieland/.stack/programs/x86_64-linux/ghc-7.10.2/bin","/home/wieland/.local/bin","/home/wieland/.cabal/bin","/opt/java/jre/bin","/home/wieland/dev/bin","/home/wieland/dev/mpdstuff","/usr/local/sbin","/usr/local/bin","/usr/bin","/usr/lib/jvm/default/bin","/usr/bin/site_perl","/usr/bin/vendor_perl","/usr/bin/core_perl","/home/wieland/dev/go/bin"], seSnapshotPkgDb = "/home/wieland/.stack/snapshots/x86_64-linux/lts-3.5/7.10.2/pkgdb", seLocalPkgDb = "/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/pkgdb"})
Cabal entrypoints:
Setup.hs
Main (/home/wieland/dev/ghc-mod-test/simple/Setup.hs)
library
Lib (/home/wieland/dev/ghc-mod-test/simple/src/Lib.hs)
exe:simple-exe
Main (/home/wieland/dev/ghc-mod-test/simple/app/Main.hs)
test:simple-test
Main (/home/wieland/dev/ghc-mod-test/simple/test/Spec.hs)
Cabal components:
Setup.hs
Main (/home/wieland/dev/ghc-mod-test/simple/Setup.hs)
library
Lib (/home/wieland/dev/ghc-mod-test/simple/src/Lib.hs)
exe:simple-exe
Main (/home/wieland/dev/ghc-mod-test/simple/app/Main.hs)
test:simple-test
Main (/home/wieland/dev/ghc-mod-test/simple/test/Spec.hs)
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/wieland/.stack/snapshots/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-db
/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-XHaskell2010
exe:simple-exe
-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/simple-exe/simple-exe-tmp
-iapp -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/simple-exe/simple-exe-tmp
-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/wieland/.stack/snapshots/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-db
/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-XHaskell2010 -threaded -rtsopts -with-rtsopts=-N
test:simple-test
-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/simple-test/simple-test-tmp
-itest -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/simple-test/simple-test-tmp
-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/wieland/.stack/snapshots/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-db
/home/wieland/dev/ghc-mod-test/simple/.stack-work/install/x86_64-linux/lts-3.5/7.10.2/pkgdb/
-package-id base-4.8.1.0-4f7206fd964c629946bb89db72c80011
-XHaskell2010 -threaded -rtsopts -with-rtsopts=-N
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
exe:simple-exe
-i
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/simple-exe/simple-exe-tmp
-iapp -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/simple-exe/simple-exe-tmp
-optP-include
-optP.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h
test:simple-test
-i
-i.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/simple-test/simple-test-tmp
-itest -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/simple-test/simple-test-tmp
-optP-include
-optP.stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/autogen/cabal_macros.h

and ghc-mod --version:

ghc-mod version 5.4.0.0 compiled by GHC 7.10.1

@DanielG
Copy link
Owner

DanielG commented Sep 16, 2015

You need to recompile ghc-mod against GHC 7.10.2.

@mgsloan
Copy link

mgsloan commented Jan 13, 2016

I've opened #726 for tracking giving better error messages for this case. Spewing errors like this for version mismatches is pretty awful, this took me a while to track down.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants