-
Notifications
You must be signed in to change notification settings - Fork 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
chore: Bump Rust version(s) #52
base: main
Are you sure you want to change the base?
Conversation
16f6b4d
to
2ce3533
Compare
Upstream base `tree-sitter` has seen some updates this now incorporates. It also bumps this crate's version. The scheme chosen is for the Rust crate's version to be in lockstep with the `tree-sitter` dependency. Looking at the major tree-sitter libraries, this seems to be the general style chosen. For example: - Python: https://github.com/tree-sitter/tree-sitter-python/blob/0dee05ef958ba2eae88d1e65f24b33cad70d4367/Cargo.toml - TypeScript: https://github.com/tree-sitter/tree-sitter-typescript/blob/198d03553f43a45b92ac5d0ee167db3fec6a6fd6/Cargo.toml The commit also adjust the Rust code to be compatible (the `&'static` change was just a lint, not a compile error). `cargo build` and `cargo test` now pass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm @amaanq can you ptal?
We don't tie parser versions to the tree-sitter crate (that's what ABI is for, which can be checked independently of the version). And aren't the bindings autogenerated? |
Thanks for your comments! I'm not sure I understand the versioning scheme. Would appreciate guidance here! Starting from current diff --git a/Cargo.toml b/Cargo.toml
index d0b9dc6..6341487 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -15,7 +15,7 @@ include = ["bindings/rust/*", "grammar.js", "queries/*", "src/*"]
path = "bindings/rust/lib.rs"
[dependencies]
-tree-sitter = "~0.20.10"
+tree-sitter = ">=0.22.0"
[build-dependencies]
cc = "1.0" I can regenerate bindings as cargo install [email protected] && ~/.cargo/bin/tree-sitter generate using diff --git a/bindings/rust/build.rs b/bindings/rust/build.rs
index 8851fed..718f897 100644
--- a/bindings/rust/build.rs
+++ b/bindings/rust/build.rs
@@ -7,6 +7,9 @@ fn main() {
.flag_if_supported("-Wno-unused-parameter")
.flag_if_supported("-Wno-unused-but-set-variable")
.flag_if_supported("-Wno-trigraphs");
+ #[cfg(target_env = "msvc")]
+ c_config.flag("-utf-8");
+
let parser_path = src_dir.join("parser.c");
c_config.file(&parser_path); aka no changes in Re: versioning scheme. I found this example where the Is the versioning I chose here wrong? I'm happy to adjust! |
This is the result of running ```bash cargo install [email protected] && ~/.cargo/bin/tree-sitter generate ``` and committing only the Rust changes.
The versioning scheme is basically semver, from the point of view of queries (so reflecting minor/major/breaking changes in the grammar only). And try removing the bindings first; some files are not touched if they already exist. |
This is the result of running ```bash rm bindings/rust/{lib,build}.rs && cargo install [email protected] && ~/.cargo/bin/tree-sitter generate ``` and committing only the Rust changes. Removing bindings first gives a clean slate with slightly different results.
Thank you. I regenerated after removing first, which gives slightly different results. Didn't squash yet to keep it readable. Re: semver. The context for my PR is just that I'm trying to get this crate onto crates.io (with |
Actually, versioning and publishing should be handled by our workflows; we'd prefer it if there was no "rogue publishing" that can interfere with that. |
Publishing should be handled by our workflows. P.S. The CLI will help with versioning in the future. |
Do we have the secrets configured for this repository? I would add the actions then today |
Ideally they should be available org-wide, like the NPM token (as we eventually want to publish ALL THE PARSERS). |
Unfortunately, crates does not support team tokens and pypi has yet to approve the org. |
@ObserverOfTime Can you set up the token and the publish workflow for this repo then? |
Sure, but it would be published on my account. |
Can we use our github app? It's a bit annoying that we have to tie packages to personal accounts that may move on, orphaning the package. |
The app is for GitHub tokens, not registry tokens. |
For reference: https://doc.rust-lang.org/cargo/reference/publishing.html#cargo-owner . Multiple individuals (all fully entitled) can be made owners, alleviating the issue of orphaning. Teams can then be entitled to publish crate updates etc. |
Hey folks, is there a way I can help move this forward? |
Upstream base
tree-sitter
has seen some updates this nowincorporates.
It also bumps this crate's version. The scheme chosen is for the
Rust crate's version to be in lockstep with the
tree-sitter
dependency. Looking at the major tree-sitter libraries,
this seems to be the general style chosen. For example:
The commit also adjust the Rust code to be
compatible (the
&'static
change was just a lint,not a compile error).
cargo build
andcargo test
now pass.