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
pest_generator 2.5.6 does not compile #849
Comments
Maybe the issue stems from Cargo and the way it resolves dependencies: somehow |
@J-Loudet I tried to force
So, that's a bit obscure, but I guess that's the culprit why Cargo mixes up 2.5.6 and 2.6.0... Anyway, @J-Loudet you can try forcing 2.5.6 for the moment: |
@tomtau thanks for the pointers, this seems indeed the way to go! 👍 I am closing this issue as it is not directly related to pest. |
@J-Loudet will it be resolved? I also meet this issue. |
Hi @liukun4515, we ended up doing what @tomtau suggested: we tweaked our internal dependencies to "help" Cargo resolve compatible versions of From our understanding, the root problem is that Cargo assumes that packages are following SemVer which does not seem to be what pest did: version 2.6 introduces non backward compatible changes with 2.5.6. As a side note, I am not part of |
Hi @liukun4515, we put a warning in the release notes: https://github.com/pest-parser/pest/releases/tag/v2.6.0 |
Does anyone one know about a way to pinpoint transitive dependency (on pest) if I want to use 3rd party library which fails to compile due to this issue? I was trying it use |
Would it be possible to re-release version without braking change as a latest patch for 2.5 so that cargo resolves to the version without the breaking change witch which downstream dependencies could compile? It seems to me that pinning the transitive dependencies is next to impossible with cargo. |
@turboMaCk can you try adding |
Thanks @tomtau this is exactly what I was looking for but did not know how to do. |
@tomtau Forcing the pest version to 2.5.6 fixes the issue for json5, but it would be really great if future breaking versions of pest followed SemVer conventions and bumped the major version. Pest is the second most popular parsing solution for Rust, so breaking changes affect the entire Rust ecosystem. |
@jlyonsmith yes, I plan to find a middle-ground between allowing new features and not breaking semver in these Cargo version resolution mixup situations (2.5 also had semver breaking changes, but they didn't affect interdependencies as much as 2.6) |
this is to address potential semver issues due to Cargo dependency intermixing, see: pest-parser#849 So, for existing users who depend on 2.X in the dependency tree, 2.7.0 pest-meta should work with 2.5.6 and below pest-generator etc. People who need the new grammar features can do so by specifying the `grammar-extras` feature in Cargo.toml: ``` ... pest_derive = {version = "2.7", features = ["grammar-extras"]} ```
@jlyonsmith @turboMaCk @J-Loudet @liukun4515 I'm exploring this solution: #871 but it seems there's no way to test it without publishing the crate. |
* feature-guard the new grammar features with "grammar-extras" this is to address potential semver issues due to Cargo dependency intermixing, see: #849 So, for existing users who depend on 2.X in the dependency tree, 2.7.0 pest-meta should work with 2.5.6 and below pest-generator etc. People who need the new grammar features can do so by specifying the `grammar-extras` feature in Cargo.toml: ``` ... pest_derive = {version = "2.7", features = ["grammar-extras"]} ```
@jlyonsmith @turboMaCk @J-Loudet @liukun4515 2.7.0 was published and it seems to work ok when mixed with the pest_generator 2.5.6 under default features, so I yanked 2.6.X crates. You can try if it works for you now when you remove |
Thanks @tomtau I can confirm this works as expected in my project. |
update dependencies and more importantly pest to a version that fixes the compatibility with handlebars dependency pest-parser/pest#849 (comment)
update dependencies and more importantly pest to a version that fixes the compatibility with handlebars dependency pest-parser/pest#849 (comment)
Sorry @tomtau I got distracted. I can confirm that 2.7.0 works for my project also. Thanks for the fix. |
Describe the bug
We depend on json5 in our project which, in turn, depends on
pest
.A fresh
cargo build
, i.e. after acargo clean
, fails because of a non-exhaustive pattern onpest_meta::optimizer::OptimizedExpr::NodeTag(_, _)
.To Reproduce
cd /tmp && git clone https://github.com/eclipse-zenoh/zenoh-flow.git --depth 1
cd zenoh-flow && cargo build
Expected behavior
We would expect
pest_generator
to compile.Additional context
The
json5
crate includespest
as following:The full error is as following:
The text was updated successfully, but these errors were encountered: