Skip to content
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

ascent_macro: Fix minimal versions (by upgrading syn to v1.0.109, itertools to v0.12) #21

Closed
regexident opened this issue Dec 12, 2023 · 5 comments · Fixed by #27
Closed

Comments

@regexident
Copy link
Contributor

While a bump to >= v2.x would obviously be preferable I'd like to suggest bumping it at least to the highest v1.x version available for the time being.

Deleting Cargo.lock and running cargo minimal-versions check --workspace --all-features --ignore-private -v (crates.io) reveals that ascent_macro is using APIs from syn and itertools that are not available in their versions specified in Cargo.toml

Full terminal log
$ cargo minimal-versions check --workspace --all-features --ignore-private -v                                                                            
(base) 
info: modifying from <SNIP>/ascent/Cargo.toml
info: modifying from <SNIP>/ascent_base/Cargo.toml
info: modifying from <SNIP>/ascent_macro/Cargo.toml
info: running `rustup run nightly cargo update -Z minimal-versions`
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
    Updating crates.io index
info: running `~/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo hack check --workspace --all-features`
info: running `cargo check --all-features` on ascent (1/3)
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
   Compiling crossbeam-utils v0.8.7
   Compiling proc-macro2 v1.0.52
   Compiling memoffset v0.6.1
    Checking lazy_static v1.4.0
   Compiling unicode-ident v1.0.0
   Compiling libc v0.2.95
    Checking scopeguard v1.1.0
   Compiling crossbeam-epoch v0.9.5
   Compiling syn v1.0.0
   Compiling unicode-xid v0.2.0
   Compiling ahash v0.8.4
   Compiling indexmap v1.6.2
   Compiling paste v1.0.0
    Checking either v1.0.0
    Checking zerocopy v0.7.3
   Compiling hashbrown v0.9.1
    Checking smallvec v1.6.1
    Checking allocator-api2 v0.2.9
   Compiling fixedbitset v0.4.0
   Compiling heck v0.4.0
   Compiling itertools v0.10.0
    Checking lock_api v0.4.10
    Checking instant v0.1.0
    Checking segvec v0.1.0
    Checking sync-unsafe-cell v0.1.0
   Compiling ascent_base v0.5.0 (<SNIP>/ascent_base)
    Checking crossbeam-channel v0.5.0
   Compiling petgraph v0.6.0
    Checking crossbeam-deque v0.8.1
    Checking num_cpus v1.2.0
    Checking parking_lot_core v0.9.8
    Checking rayon-core v1.11.0
   Compiling quote v1.0.26
    Checking rayon v1.7.0
   Compiling proc-macro-error-attr v1.0.4
    Checking hashbrown v0.14.0
    Checking dashmap v5.5.0
   Compiling proc-macro-error v1.0.4
   Compiling derive-syn-parse v0.1.5
   Compiling duplicate v0.4.0
error[E0599]: no method named `get_ident` found for struct `syn::Path` in the current scope
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/derive-syn-parse-0.1.5/src/fields.rs:192:26
    |
192 |     let name = attr.path.get_ident()?.to_string();
    |                          ^^^^^^^^^ help: there is a method with a similar name: `is_ident`

error[E0599]: no method named `get_ident` found for struct `syn::Path` in the current scope
   --> ~/.cargo/registry/src/index.crates.io-6f17d22bba15001f/derive-syn-parse-0.1.5/src/variants.rs:154:26
    |
154 |     let name = attr.path.get_ident()?.to_string();
    |                          ^^^^^^^^^ help: there is a method with a similar name: `is_ident`

For more information about this error, try `rustc --explain E0599`.
error: could not compile `derive-syn-parse` (lib) due to 2 previous errors
warning: build failed, waiting for other jobs to finish...
error: process didn't exit successfully: `~/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo check --all-features --manifest-path ascent/Cargo.toml` (exit status: 101)
info: restoring <SNIP>/ascent/Cargo.toml
info: restoring <SNIP>/ascent_base/Cargo.toml
info: restoring <SNIP>/ascent_macro/Cargo.toml
error: process didn't exit successfully: `~/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo hack check --workspace --all-features` (exit status: 1)

Bumping syn and itertools from …

[dependencies]
syn = { version = "1.0", features = [
    "derive",
    "full",
    "extra-traits",
    "visit-mut",
] }
itertools = "0.10"
# ...

… to …

[dependencies]
syn = { version = "1.0.109", features = [
    "derive",
    "full",
    "extra-traits",
    "visit-mut",
] }
itertools = "0.12"
# ...

fixes it.

Full terminal log
$ cargo minimal-versions check --workspace --all-features --ignore-private -v                                                      (base) 
info: modifying from <SNIP>/ascent/ascent/Cargo.toml
info: modifying from <SNIP>/ascent/ascent_base/Cargo.toml
info: modifying from <SNIP>/ascent/ascent_macro/Cargo.toml
info: running `rustup run nightly cargo update -Z minimal-versions`
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
    Updating crates.io index
info: running `~/.rustup/toolchains/stable-x86_64-apple-darwin/bin/cargo hack check --workspace --all-features`
info: running `cargo check --all-features` on ascent (1/3)
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Blocking waiting for file lock on package cache
    Finished dev [unoptimized + debuginfo] target(s) in 0.68s

info: running `cargo check --all-features` on ascent_base (2/3)
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
    Finished dev [unoptimized + debuginfo] target(s) in 0.02s

info: running `cargo check --all-features` on ascent_macro (3/3)
warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"`
note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest
note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
info: restoring <SNIP>/ascent/ascent/Cargo.toml
info: restoring <SNIP>/ascent/ascent_base/Cargo.toml
info: restoring <SNIP>/ascent/ascent_macro/Cargo.toml
@regexident regexident changed the title ascent_macro: Upgrade syn to >= v1.0.109 ascent_macro: Fix minimal versions (by upgrading syn to v1.0.109, itertools to v0.12) Dec 12, 2023
@kmicinski
Copy link
Collaborator

Looks like there is some pending effort on this here (#18). I am not sure what the resolution is right now, however.

@regexident
Copy link
Contributor Author

#18, which I linked in OP, is about a possible migration to a future syn 2.x.

This issue is specifically about semver breakage that's happening today when depending on both, ascent v0.5.0, due to the dependencies in ascent's Cargo.toml using versions that don't yet contain features used by ascent. See "Full terminal log" for how to reproduce and what's broken.

@kmicinski
Copy link
Collaborator

Understood. I will try to look into this and get back to you. Arash has now graduated, I am not sure the degree to which he will maintain the repo in real-time since he's now got a full-time job. In that event, we can look into forking the repo into a version our group maintains. I will try to get back to you in the next weeek.

@regexident
Copy link
Contributor Author

Thanks @kmicinski!

I'm currently experimenting with migrating cargo-modules's custom-written and rather unwieldy recursive graph/tree filtering transformations towards individual and composable transformation phases consisting of succinct Datalog programs using ascent.

I currently have to pin these two dependencies in my project's own Cargo.toml to make things compile.


I'm not an experienced in Datalog implementations/theory (beyond having read a couple of articles and lectures), but would be happy to help maintain the Rust side of things if there is need for additional hands.

@s-arash
Copy link
Owner

s-arash commented Dec 14, 2023

Thanks @regexident for catching the issue. I'll try and make the suggested fix as soon as possible.

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 a pull request may close this issue.

3 participants