Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create happy-boot exe #212

Draft
wants to merge 1 commit into
base: release/1.21
Choose a base branch
from
Draft

Conversation

Ericson2314
Copy link
Collaborator

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.

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.
@int-index
Copy link
Collaborator

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?

@phadej
Copy link
Contributor

phadej commented Nov 10, 2021

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).

@int-index
Copy link
Collaborator

int-index commented Nov 10, 2021

@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?

@phadej
Copy link
Contributor

phadej commented Nov 10, 2021

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).

@Ericson2314
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants