I have a simple two-package project (A, B) and the Cabal file for packageB
has only an executable
stanza, which depends on packageA
:
cabal-version: 1.12
name: packageB
version: 0.1.0.0
build-type: Simple
executable packageB
main-is: Main.hs
hs-source-dirs:
app
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
, packageA
default-language: Haskell2010
When Stack builds that project, there is no installed packageB
: stack exec -- ghc-pkg list
(extracts):
C:\Users\mikep\Documents\Code\Haskell\multiTest\.stack-work\install\c3501600\pkgdb
packageA-0.1.0.0
Is that the expected behaviour? Would Cabal (the tool) do something different?
If I do add a library
stanza to packageB
, the depends:
field of the resulting installed package (stack exec -- ghc-pkg field packageB depends
) excludes the dependencies of the executable
stanza:
depends: base-4.17.2.0
Again, is that the expected behaviour? Would Cabal (the tool) do something different?
EDIT: The motivation for this question is that Stack âagressively unregistersâ installed local/mutable packages to ensure that things are rebuilt when source files are âdirtyâ, but that only works if ghc-pkg dump
will yield the dependencies of such packages. It looks to me like dependencies of executable
stanzas are omitted from *.conf
files.