Closed bitemyapp closed 9 years ago
We get this a lot in Snowdrift. If we don't run stack test
before stack ghci
, we'll get an error like:
cannot satisfy -package yesod-test
I'm not sure if anyone is reported our version yet.
@pharpend I mentioned that
I ran
stack build
andstack test
before-hand
to highlight that my situation seems different somehow.
I also encountered this problem today after running stack build and stack test. Once I fixed the build error and ran stack build again it worked, but obviously I want ghci to make it easier to get it to work :)
@cocreature I need stack ghci
to work even when code is broken, but my stack ghci
has had a successful stack build && stack test
since then and stack ghci
still fails with the same error.
e.g.
All 8 tests passed (0.03s)
Configuring GHCi with the following packages: Multiprocessing, cryptohash, riak, riak-http, ua-parser, vector-bytestring
GHCi, version 7.8.4: http://www.haskell.org/ghc/ :? for help
<command line>: cannot satisfy -package hspec
(use -v for more information)
@bitemyapp I know, I was just pointing out another case :)
@bitemyapp Ah for me the package that couldn't be satisfied was the package I was working on so maybe that explains why it got fixed for me but not for you (assuming you are only using hspec and not working on hspec itself).
Allright, I found the problem causing the error for me: If the benchsuite (I think the same goes for the test suite, but I've only looked at the code not tried it) depends on the main package, the package is added to the dependencies causing ghci to fail if it has not been built before.
Allright, I made a simple fix filtering the main package. This fixes the issue I was having.
Still fails with:
$ stack --version
Version 0.1.2.0, Git revision 05ab70d77cbf9490ec7623775669e822a58dfb60
I got further by running stack test
before stack ghci
, curiously, it runs the tests for all of my vendored dependencies, not just my project.
Prelude> :l src/Main.hs
ghc: /Users/callen/work/gordium/vendor/vector-bytestring/Data/Vector/Storable/ByteString/Internal.hs:12:14-19: Incompatible Safe Haskell flags! (Trustworthy, Unsafe)
Usage: For basic information, try the `--help' option.
There may be good reasons for barfing on this, but cabal repl
appears to ignore it and works fine.
I checked and cabal repl
has no problem loading my project or the vector-bytestring
dependency.
I didn't have my vendored dependencies configured properly, I'm good to go now. I needed to call them out as locations with extra-dep: true
:bear: :fearful:
I've run into this same issue: "cannot satisfy package
I don't have extra-deps on the project in question. In fact, it is the yesod-sqlite
boilerplate template generated by stack, slightly modified. Also, I haven't quite figured out under what circumstances, but stack 1.1.2 seems to work sometimes when 1.4.0 fails in the aforementioned way on the same project. Could it be a regression?
Edit: Would you prefer if I opened another issue, or if we reopened this one?
@Wizek Sure, feel free to open a new issue. However, for me, stack ghci
works just fine on the yesod-sqlite
template.
I ran
stack build
andstack test
before-hand, they both reach the build error (type error) in my code.Possibly related: https://github.com/commercialhaskell/stack/issues/509