Skip to content

Conversation

@Xophmeister
Copy link
Member

@Xophmeister Xophmeister commented Jan 15, 2025

Migrate to tree-sitter-loader to build grammars

Resolves #821
Resolves #829

Description

  • Do a light clone of the grammar repo (--filter=blob:none).

  • Use tree-sitter-loader::Loader::compile_parser_at_path to build grammars dynamically, rather than curating our own build pipeline. This should give us cross-platform support.

Checklist

Checklist before merging:

  • CHANGELOG.md updated
  • README.md up-to-date

@Xophmeister Xophmeister marked this pull request as ready for review January 16, 2025 17:29
@Xophmeister Xophmeister requested review from nbacquey and yannham and removed request for nbacquey January 16, 2025 17:30
@Xophmeister
Copy link
Member Author

Xophmeister commented Jan 17, 2025

Hmm... Well this is quite annoying.

This builds fine and cargo test --all-features passes with no problem, but nix flake check is giving weird Clippy errors against code that hasn't changed 😞

@Xophmeister
Copy link
Member Author

It was just a WASM-thing, in the end. Thanks @yannham for the help 🙏

As the playground has now been detached from main, I've also taken the liberty of removing the Clippy WASM and playground checks from the flake. Hopefully that should shed some time from the CI.

@Xophmeister
Copy link
Member Author

The CI results in #813 -- whose branch has been rebased off this one -- show that compiling on Windows now works (as well as Linux and macOS) 🎉 Although, note, that branch's CI is currently failing for some other reason; under investigation. However, this branch is all ✅

This PR is ready for review and merge.

Copy link
Member

@nbacquey nbacquey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice job finding tree-sitter-loader 🎉

@Xophmeister Xophmeister merged commit c144f48 into main Jan 21, 2025
9 checks passed
@Xophmeister Xophmeister deleted the chris/grammar-build branch January 21, 2025 12:57
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.

Should we shell out to tree-sitter build to build grammar libraries? Clone the parser with specific depth to reduce network traffic

4 participants