A standard set of Setup.hs hooks is autoconfUserHooks. When using these hooks, or any other I suppose, the Setup.hs script is allowed to create a .buildinfo file, whose content will be merged with that of the .cabal file in any subsequent actions, as documented here.
Stack doesn't need to do anything special in the case of stack build, since building is outsourced to the Cabal library, which knows to source the .buildinfo file if present. But stack ghci doesn't use Cabal, so in that case we have to do it ourselves.
An example of package that does this: http://hackage.haskell.org/package/network. It's a package that can't currently be loaded into GHCi due to this issue. See also #1239.
cc @chrisdone.
A standard set of
Setup.hshooks isautoconfUserHooks. When using these hooks, or any other I suppose, theSetup.hsscript is allowed to create a.buildinfofile, whose content will be merged with that of the.cabalfile in any subsequent actions, as documented here.Stack doesn't need to do anything special in the case of
stack build, since building is outsourced to the Cabal library, which knows to source the.buildinfofile if present. Butstack ghcidoesn't use Cabal, so in that case we have to do it ourselves.An example of package that does this: http://hackage.haskell.org/package/network. It's a package that can't currently be loaded into GHCi due to this issue. See also #1239.
cc @chrisdone.