Description
Describe the feature request
Currently, there does not appear to be a way to retrieve the path of the current GHC version you are using to build a package in the context of a cabal
code generator. As such, in order to programmatically retrieve the GHC path, one has to resort to tricks like what the ghc-paths
library does. This is unsatisfying for multiple reasons:
ghc-paths
requires a customSetup.hs
script. One of the key use cases forcabal
code generators is to avoid customSetup.hs
scripts, so needing to depend on a package which uses a customSetup.hs
script in order to use a code generator is unfortunate.ghc-paths
's assumptions about where GHC is installed are incorrect if you relocate your GHC installation.
Additional context
I encountered this in the context of goldfirere/singletons#622, in which I replaced singletons-base
's custom Setup.hs
script with a code generator. While using ghc-paths
as part of this solution mostly works, I am missing the ability to completely remove the dependency on custom Setup.hs
scripts due to the need for a ghc-paths
dependency. (This dependency is only used in the singletons-base
test suite, however, so the situation is not as severe as when the entire singletons-base
library required a custom Setup.hs
script.)