Open Ericson2314 opened 2 years ago
Cabal doesn't realize it should use happy-boot for
.ly
files
Could this be resolved by having a custom Setup.hs and calling happy-boot by hand?
Having build-type: Custom
is not great solution.
If I understand right, this work is to make developing experience of happy
itself better. That should not come with trade-offs for happy
users (and lets not forget that there are other users in addition to GHC).
IMHO, if parser can be generated locally it should... Until there is needed support in Cabal
or cabal-install
(e.g. being to specify that .ly
files should be preprocessed by happy-boot
).
@phadej OK. How do you imagine it should be done?
Should there be a field in the .cabal
file specifying that .y
and .ly
files are to be processed with happy-boot
? Would this field allow mapping arbitrary extensions to arbitrary build tools?
Would this field allow mapping arbitrary extensions to arbitrary build tools?
I'd imagine it work so. That would be great addition in general. Hardcoding/blessing just some tools is not future-proof nor extensible.
EDIT: it could be bikeshedded to somehow support not 1-to-1 preprocessing as well, but I'd leave that out until someone has a concrete plan. Or to process files in order / all at once. (search for c2hs and BNFC on cabal issue tracker).
There's a small irony here that In the longer term I hope happy will always be usable via TH (even in GHC), and there will be no need for these custom preprocesors or generalized support for them in Cabal, but we're not there yet.
This helps avoid missing features in cabal-install, but doesn't yet work because Cabal doesn't realize it should use
happy-boot
for.ly
files.