General summary/comments (optional)
When one package bar has another local package foo as a dependency (either in packages or extrs-deps), rebuilding separately package foo will cause package bar erroring during build with:
ghc-pkg: cannot find package foo
Steps to reproduce
Here are two sample projects that replicate the problem: https://github.com/lehins/bugs/tree/master/haskell/stack-ghc-pkg-cannot-find-package
$ git clone https://github.com/lehins/bugs
$ cd bugs/haskell/stack-ghc-pkg-cannot-find-package
$ cd bar
$ stack build
$ cd ../foo
$ stack build
$ cd ../bar
$ stack build --force-dirty
...
Standard error:
ghc-pkg: cannot find package foo
Not 100% sure, but I think it is important that foo and bar are both on a different snapshots, but with the same ghc, eg. one is lts-14.4 another lts-14.20.
Expected
Regardless of the order packages build successfully.
Actual
Here is also a sample log with --verbose: https://github.com/lehins/bugs/blob/master/haskell/stack-ghc-pkg-cannot-find-package/output.log
Stack version
Stack version used was the latest, but I've been observing this issue since 2.0, but was unable to reproduce it reliably on small set of packages
$ stack --version
Version 2.2.0, Git revision c3c33b61a4d5c286a6718550d285305270ba4bf0 PRE-RELEASE x86_64 hpack-0.31.2
Method of installation
General summary/comments (optional)
When one package
barhas another local packagefooas a dependency (either inpackagesorextrs-deps), rebuilding separately packagefoowill cause packagebarerroring during build with:Steps to reproduce
Here are two sample projects that replicate the problem: https://github.com/lehins/bugs/tree/master/haskell/stack-ghc-pkg-cannot-find-package
Not 100% sure, but I think it is important that
fooandbarare both on a different snapshots, but with the same ghc, eg. one islts-14.4anotherlts-14.20.Expected
Regardless of the order packages build successfully.
Actual
Here is also a sample log with
--verbose: https://github.com/lehins/bugs/blob/master/haskell/stack-ghc-pkg-cannot-find-package/output.logStack version
Stack version used was the latest, but I've been observing this issue since
2.0, but was unable to reproduce it reliably on small set of packagesMethod of installation
stack upgrade --git