You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tree-sitter is a direct dependency of Topiary. Each Tree-sitter grammar (e.g., tree-sitter-json, tree-sitter-rust, etc.) has a transitive dependency on tree-sitter. The direct dependency and transitive dependencies must maintain API compatibility, otherwise Topiary won't build.
Currently, we are using Tree-sitter 0.20. v0.21 is now available and some grammars allow this, which causes Cargo to build both 0.20 and 0.21 for Topiary and subsequently fail. We can use the [patch] directive in our Cargo.toml to pin the transitive dependency (e.g., e91534b).
This might be more of a "Cargo problem", than a Topiary one, but it would be nice if there were some tooling around this. Perhaps, at least, a CI step that checks there's only one version of tree-sitter in the Cargo.lock...
Would pinning the git dependencies on those grammars help, or even with a pinned dep, cargo would still somehow fetch a newer version of tree-sitter if available?
Would pinning the git dependencies on those grammars help, or even with a pinned dep, cargo would still somehow fetch a newer version of tree-sitter if available?
Pinning both the grammar and its transitive dependency on Tree-sitter appears to work in practice. It's a bit verbose, mind you:
tree-sitter
is a direct dependency of Topiary. Each Tree-sitter grammar (e.g.,tree-sitter-json
,tree-sitter-rust
, etc.) has a transitive dependency ontree-sitter
. The direct dependency and transitive dependencies must maintain API compatibility, otherwise Topiary won't build.Currently, we are using Tree-sitter 0.20. v0.21 is now available and some grammars allow this, which causes Cargo to build both 0.20 and 0.21 for Topiary and subsequently fail. We can use the
[patch]
directive in ourCargo.toml
to pin the transitive dependency (e.g., e91534b).This might be more of a "Cargo problem", than a Topiary one, but it would be nice if there were some tooling around this. Perhaps, at least, a CI step that checks there's only one version of
tree-sitter
in theCargo.lock
...(#4 will definitely be impacted by this.)
The text was updated successfully, but these errors were encountered: