Description
I've observed what I think is the following interaction:
Project P has
- A shell with
exactDeps
set - A package A which depends on B
- A
source-repository-package
stanza patching C which is a dependency of B
In this scenario, cabal will always want to rebuild B. There is no way to convince it to take a prebuilt B from a package-db short of removing the source-repository-package
stanza. But setting exactDeps
says "we don't want cabal to build anything", and indeed this will "work": cabal will decide it wants to build B, but fail because it has no repositories ("unknown package B").
(In fact, we're clever enough to not even bother putting our prebuilt B into the shell, because we know cabal will ignore it. This can seem a little surprising if you're not expecting B to be missing!)
I think this is inescapable: cabal will absolutely insist on building B, and exactDeps
won't let it. If we just wanted exactDeps
to say "don't let cabal hit the network", then we could point it at a local repository instead, perhaps.
My preferred solution: don't use exactDeps
.