Skip to content

build(deps): Bump all dependencies to their latest versions - #1253

Merged
marco-c merged 3 commits into
masterfrom
bump-all-deps
Nov 21, 2026
Merged

marco-c merged 3 commits into
masterfrom
bump-all-deps

Conversation

@marco-c

@marco-c marco-c commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #1225: bumps every dependency in the workspace (and the non-member enums crate) to its latest release.

Dependency updates

Crate From To
tree-sitter 0.26.5 0.27.2
tree-sitter-rust 0.24.0 0.24.2
tree-sitter-cli (npm, Mozilla grammars) ^0.26.5 ^0.27.2
askama (enums) 0.15 0.16
toml (cli) 0.9 1.2
num-derive 0.4 0.5
insta 1.46.1 1.49.0
tree-sitter-language (grammars) 0.1.0 0.1.9

Version-requirement floors were also raised to the current releases for aho-corasick, regex, termcolor, walkdir, pretty_assertions, clap, actix-rt, actix-web and cc. All other tree-sitter grammar crates (java, typescript, javascript, python, cpp, kotlin-sg) are already at their latest releases.

Code changes

tree-sitter 0.27 changed two Node APIs:

  • Node::child_count now returns u32. Our Node::child_count and Node::child wrappers now use u32 too, matching tree-sitter, instead of converting to and from usize. The only usize conversion left is where the count is used as a Vec capacity.
  • Node::kind now returns &'tree str instead of &'static str. AstNode stores its type as a public &'static str, so instead of changing that public API, Alterator now resolves the kind through the generated language enums (LanguageInfo::BaseLang), which already map every kind id to a &'static str. LanguageInfo::BaseLang gains a From<u16> + Into<&'static str> bound, which every generated enum satisfies.

A new test, alterator::tests::kind_names_match_tree_sitter, checks that this mapping matches Language::node_kind_for_id for every kind id (plus ERROR) of every supported language. That also guards against the generated enums going stale after a future grammar bump.

Grammars

tree-sitter 0.27 raises the MSRV to Rust 1.90. CI uses rust:bookworm, so that's fine.

Snapshot changes

tree-sitter 0.27 recovers differently from a missing semicolon after a macro used as a statement (__Pyx_PyThreadState_declare in DeepSpeech's pywrapfst.cc): it is now parsed as an expression_statement instead of a lone type_identifier, so it counts as a logical line. This changes lloc for one function (22 → 23) in both copies of the file. The snapshots were updated in mozilla/rust-code-analysis-output#6, and this PR bumps the tests/repositories/rca-output submodule accordingly.

Test plan

  • cargo test --workspace, including the DeepSpeech, pdf.js and serde repository tests: 299 passed
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo fmt --all -- --check

@marco-c
marco-c force-pushed the bump-all-deps branch 2 times, most recently from 935008a to 400d116 Compare November 20, 2026 00:54
marco-c added a commit to mozilla/rust-code-analysis-output that referenced this pull request Nov 21, 2026
 (#6)

tree-sitter 0.27 recovers differently from the missing semicolon after the
`__Pyx_PyThreadState_declare` macro in pywrapfst.cc: it is now parsed as an
expression statement, which counts as a logical line of code.
Notable updates: tree-sitter 0.27.2, tree-sitter-rust 0.24.2, askama 0.16,
toml 1.2, num-derive 0.5.

tree-sitter 0.27 changed `Node::kind` to return a `&'tree str` instead of
`&'static str`, and `Node::child_count` to return `u32`.

Our `Node::child_count` and `Node::child` wrappers now use `u32` too,
matching tree-sitter, instead of converting to and from `usize`.

Since `AstNode` stores its type as `&'static str`, `Alterator` now resolves
node kinds through the generated language enums, which map each kind id to
a `&'static str`. A test checks that this mapping matches tree-sitter's
names for every kind id of every supported language.
@codecov-commenter

codecov-commenter commented Nov 21, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.21053% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.43%. Comparing base (4c5328f) to head (b9ce53a).

Files with missing lines Patch % Lines
src/alterator.rs 80.64% 6 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1253       +/-   ##
===========================================
+ Coverage   70.34%   90.43%   +20.08%     
===========================================
  Files          62       62               
  Lines       16414    16438       +24     
===========================================
+ Hits        11547    14866     +3319     
+ Misses       4867     1572     -3295     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Regenerate tree-sitter-mozcpp, tree-sitter-mozjs, tree-sitter-preproc and
tree-sitter-ccomment with tree-sitter-cli 0.27.2, and bump the grammar crate
versions accordingly. The generated parsers now use ABI 15, since
tree-sitter-cli 0.27 no longer requires a tree-sitter.json for it.
tree-sitter 0.27 recovers differently from a missing semicolon after a
macro used as a statement in DeepSpeech's pywrapfst.cc, which changes its
LOC metric (mozilla/rust-code-analysis-output#6).
@marco-c
marco-c merged commit d04dc9d into master Nov 21, 2026
2 checks passed
@marco-c
marco-c deleted the bump-all-deps branch November 21, 2026 14:29
@marco-c

marco-c commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator Author

I looked at the differences reported by the grammar check tasks for this PR (https://community-tc.services.mozilla.com/tasks/groups/VF3vy5QbQ7G3-7Pp57HjVQ). Java, Kotlin, Python and TypeScript weren't checked, since their grammars didn't change. For mozjs (29 files), mozcpp (215) and Rust (63):

Rust's \u{0__} escapes (valid Rust, e.g. in litrs' tests) also fail with both the old and new grammar, but recovery differs.

With #1263, all the 307 files with differences pass basic consistency checks on the new metrics: the root spans the whole file, spaces are nested in their parents, LOC values are consistent, and nothing is negative.

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