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

Try including the generated grammar in-tree #2141

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jneem
Copy link
Member

@jneem jneem commented Jan 22, 2025

This is an attempt at #2123, by checking in a version of the generated grammar. The checked in file is 22MB (!), but I checked that the compressed cargo package size is more reasonable (1.2 MB). crates.io has a limit of 10MB per crate.

Stepping back, the main goal here is to avoid making users of the published nickel-lang-core generate the grammar when building. But we also need to make sure that it isn't too painful to modify the grammar. I think there are two basic approaches

  1. check in the generated grammar, and require some workarounds when modifying it
  2. generate the grammar at publish time, so it's in the published crate but not in the git repo.

Option 2 seems nicer in principle, but I'm worried that because publishing is infrequent and mostly automated, it will be prone to undetected breakage. So this PR does option 1, but I think the mechanism in the build script would work with either one; option 2 would just need some more work on the release script.

@jneem jneem requested a review from yannham January 22, 2025 16:16
@yannham
Copy link
Member

yannham commented Jan 22, 2025

I haven't reviewed, but I want to point out one of LALRPOP co-maintainer's interesting remark: https://github.com/orgs/lalrpop/discussions/1031#discussioncomment-11908105. There's a checksum of the lalrpop grammar file included somewhere, so maybe we can just include a check in the build script so that if the file has changed we rebuild it automatically?

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.

2 participants