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

syn 1.x and 2.x both used in sea-query #706

Closed
sartak opened this issue Sep 16, 2023 · 2 comments · Fixed by #707 or #763
Closed

syn 1.x and 2.x both used in sea-query #706

sartak opened this issue Sep 16, 2023 · 2 comments · Fixed by #707 or #763

Comments

@sartak
Copy link

sartak commented Sep 16, 2023

Description

I'm shipping a crate that uses sea-query, but getting a warning that multiple versions of syn are being pulled in.

I'm sure it wouldn't be trivial to upgrade sea-query-derive to syn 2.x, but it would make downstream compile times faster, (possibly) binaries smaller, and reduce warnings that are not feasibly fixable.

Steps to Reproduce

  1. cargo new --lib foo
  2. cd foo
  3. add #![warn(clippy::cargo)] to the top of src/lib.rs
  4. cargo add sea-query
  5. cargo clippy

Expected Behavior

Adding sea-query to my project is clippy::cargo-clean.

Actual Behavior

Adding sea-query to my project generates a new clippy::cargo warning;

warning: multiple versions for dependency `syn`: 1.0.109, 2.0.35
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#multiple_crate_versions

Reproduces How Often

Every time.

Versions

λ cargo tree | grep sea-
└── sea-query v0.30.1
    └── sea-query-derive v0.4.0 (proc-macro)

Additional Information

sea-query-derive depends on syn 1.x here:

syn = { version = "1", default-features = false, features = ["parsing", "proc-macro", "derive", "printing"] }

where syn 2.x is pulled in via inherent and thiserror.

@tyt2y3
Copy link
Member

tyt2y3 commented Sep 16, 2023

Thanks for raising this.

Yeah, SeaORM went through an exercise of upgrading to syn2. It was an involving process, and it left us just there without touching SeaQuery. Contribution is of course welcome.

However, I would like to point out this is an ecosystem problem. Unless every crate in a dependency tree upgrades to syn2, it will be pretty hard to avoid having two syn.

@lillianrubyrose
Copy link

I wouldn't mind taking a look at this in my spare time. Need more proc macro practice anyway

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