hadrian: Work out how to add a rule which using system cabal to build a package
There are two situations where we have wanted to use system cabal in order to build a package for use in GHC's build system but can't work out how to do it.
- To install packages necessary for
reqlib
tests (#16264 (closed)) - To run a plugin whilst building stage1 or stage3
My attempt to do this involved invoking cabal install
which worked to install the package but I couldn't work out
how to integrate it into shake.
That branch is here: https://gitlab.haskell.org/ghc/ghc/tree/wip/hadrian-sys-cabal
It didn't work because the library was installed to something like foo-longhash.conf.d
and all the rules in hadrian assume that the libraries get installed to something like directory.conf.d
without the hash. This means the rule complains that
it didn't produce its output.
Apparently cabal should let you configure whether the hash is included or not but I had no luck. https://github.com/haskell/cabal/issues/5807
Does anyone have any ideas on this one? Perhaps it is similar to just using cabal to build all the dependencies.