-
Notifications
You must be signed in to change notification settings - Fork 1
Tracking PR - Ruby HEAD & tree-sitter v0.26 compat #20
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
Draft
pboling
wants to merge
18
commits into
joker1007:main
Choose a base branch
from
pboling:tree_haver
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update tree_stump to support the tree-sitter Rust crate 0.26.x, enabling grammars with LANGUAGE_VERSION 15 to be loaded. Changes: - Replace Language::version() with Language::abi_version() - Remove deprecated parser timeout/cancellation APIs - Handle Parser::language() returning Option<LanguageRef> - Convert usize to u32 for Node::child() and Node::named_child() - Use streaming_iterator for QueryMatches iteration - Update Cargo.toml to tree-sitter = "0.26.3" - Add streaming-iterator = "0.1" dependency BREAKING CHANGE: Parser#timeout_micros method is removed (deprecated in 0.25, removed upstream in 0.26). Parser#language now returns nil after setting a language due to API changes in the Rust crate. Closes joker1007#16
Consolidate tree-sitter environment setup using the kettle-rb/ts-grammar-action composite action instead of separate steps for Java, tree-sitter, and Rust. Before: - actions/setup-java@v5 (conditional for TruffleRuby/JRuby) - tree-sitter/setup-action@v2 (library and CLI) - actions-rust-lang/setup-rust-toolchain@v1 (Rust for tree_stump) After: - kettle-rb/ts-grammar-action@v1 (all-in-one) - install-cli: true - install-lib: true - setup-rust: true (required for tree_stump Rust extension) - setup-java: conditional (for TruffleRuby/JRuby) This reduces workflow complexity and ensures consistent tree-sitter environment setup across kettle-rb projects. Closes joker1007#17
- usize can be larger than u32. - On conversion failure (index > 4,294,967,295) - Now returns None - Previously truncated the value
- Remove unsound unsafe transmute in Parser::language() that extended LanguageRef lifetime from borrowed scope to 'static. The safety comment claimed languages outlive parsers, but this wasn't enforced by the type system and could lead to use-after-free. - Redesign Parser to store language_name and look up the language directly from the global LANG_LANGUAGES map in build_query(), keeping proper lifetime bounds tied to the lock guard.
Rust source changes (ext/tree_stump/src/*.rs): - Fix compilation error in parser.rs by changing Query::new to accept &tree_sitter::Language instead of &tree_sitter::LanguageRef - Replace deprecated magnus::exception::runtime_error() calls with build_error() helper throughout lib.rs, query.rs, and tree.rs - Replace deprecated magnus::exception::type_error() with ruby.exception_type_error() in query.rs - Fix deprecated into_symbol() -> into_symbol_with(&ruby) in query.rs - Fix deprecated into_value() -> into_value_with(ruby) in query.rs - Add #[allow(deprecated)] for unavoidable fallback case in util.rs - Fix lifetime elision warnings by adding explicit <'_> lifetime parameters to Node and TreeCursor return types in tree.rs Spec changes: - Update spec_helper.rb to use TREE_SITTER_RUBY_PATH env var for grammar path, falling back to local path for CI - Add is_missing? and missing? method tests for Node class - Add helper methods find_missing_nodes and check_all_nodes for tree traversal in tests
- Ruby 4.0, 4.1 compat - oxidize-rb/rb-sys#697
- Change gemspec extensions from Cargo.toml to extconf.rb to use rb_sys/mkmf - Add rb_sys ~> 0.9.119 as runtime dependency (required by extconf.rb) - Add CI build verification steps to ensure extension compiles before tests - Add Rust version verification and explicit compile step in workflow - Improve error diagnostics for extension build failures Fixes issue where extension built successfully but .so file wasn't found in CI due to RubyGems using native Cargo builder instead of rb_sys.
# Conflicts: # .github/workflows/rspec.yml
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is tracking changes in my fork, where I am working on two things:
LANGUAGE_VERSION 154.1.0+1(current HEAD)Refs:
Includes (on top of):