Provide way to retrieve current GHC path in a code generator #10632
Labels
re: code-generators
Concerning the `code-generators` field/functionality for `testsuite`s
type: enhancement
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 theghc-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 customSetup.hs
script with a code generator. While usingghc-paths
as part of this solution mostly works, I am missing the ability to completely remove the dependency on customSetup.hs
scripts due to the need for aghc-paths
dependency. (This dependency is only used in thesingletons-base
test suite, however, so the situation is not as severe as when the entiresingletons-base
library required a customSetup.hs
script.)The text was updated successfully, but these errors were encountered: