Description
Right now there is a limitation to cabal which means that you have to build all a packages dependencies before configuring a package. When combined with multiple home units this is a serious issue because you have to build all the packages first before you start your multi-component session which then builds them again. This limitation makes multi-component unsuitable as a means of doing builds for example (as much work is duplicated).
In addition, for clients such as HLS, which has support for multi-component sessions, having to build everything before discovering the options is sub-optimal (for the same reason, the build will be completed again by HLS).
So it would be good to find a way to configure all the packages we're going to build before we actually build any of them. There are two problems to overcome:
Problem 1: Setup.hs scripts might depends on the assumption that all dependencies are built (for example might consult the package database to look at the abi of a dependency).
Problem 2: The Setup.hs configure logic requires that a package has been built (and in the package database) for the configure step to work.
The proposed solution to these issues is:
- Add a new custom Setup.hs type which distinguishes whether the
Setup.hs
requires the dependencies to be already built or not before configuring. Almost all customSetup.hs
do not require dependencies to have been built. - Modify the configure logic so that it's possible to distinguish between packages which should be in the package database and packages which are going to be built together. Therefore it's possible to configure against a mix of installed and "virtual" packages which are not yet built (but will be built together in a multi-component session).