-
Notifications
You must be signed in to change notification settings - Fork 286
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
cargo: Define dependencies on the workspace level #667
Conversation
✅ Deploy Preview for aya-rs-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Reviewed 11 of 11 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @vadorovsky)
Cargo.toml
line 43 at r1 (raw file):
] [workspace.dependencies]
if one of these becomes unused, will anything inform us?
Cargo.toml
line 47 at r1 (raw file):
assert_matches = "1.5.0" async-io = { version = "1.3" } aya = { path = "aya", version = "0.11.0", features=["async_tokio"] }
is it necessary to list features here? seems to me like we just want versions here since each user crate should specify used features for itself
Cargo.toml
line 77 at r1 (raw file):
testing_logger = "0.1.1" thiserror = "1" tokio = { version = "1.24.0" }
this should be default-features = false, i think? i'm not sure how features work in workspace dependencies, perhaps they are ignored?
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.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @vadorovsky)
Cargo.toml
line 77 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
this should be default-features = false, i think? i'm not sure how features work in workspace dependencies, perhaps they are ignored?
yeah, this is causing cargo to log warnings:
warning: /home/tamird/src/aya/aya-obj/Cargo.toml: `default-features` is ignored for thiserror, since `default-features` was not specified for `workspace.dependencies.thiserror`, this could become a hard error in the future
warning: /home/tamird/src/aya/test/integration-test/Cargo.toml: `default-features` is ignored for tokio, since `default-features` was not specified for `workspace.dependencies.tokio`, this could become a hard error in the future
2ee2935
to
202c688
Compare
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.
Reviewable status: 9 of 11 files reviewed, 3 unresolved discussions (waiting on @tamird)
Cargo.toml
line 43 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
if one of these becomes unused, will anything inform us?
I checked and cargo-udeps doesn't inform about unused workspace dependencies. :/ I will keep thinking about the solution.
Cargo.toml
line 47 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
is it necessary to list features here? seems to me like we just want versions here since each user crate should specify used features for itself
It's not, we can always list features in user crates.
My idea was to define them here if we know that we are going to use those features in all crates and keep only single feature lists which differ in user crates. To not repeat the feature list over everywhere when not necessary.
Cargo.toml
line 77 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
yeah, this is causing cargo to log warnings:
warning: /home/tamird/src/aya/aya-obj/Cargo.toml: `default-features` is ignored for thiserror, since `default-features` was not specified for `workspace.dependencies.thiserror`, this could become a hard error in the future warning: /home/tamird/src/aya/test/integration-test/Cargo.toml: `default-features` is ignored for tokio, since `default-features` was not specified for `workspace.dependencies.tokio`, this could become a hard error in the future
Done.
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.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: 9 of 11 files reviewed, 2 unresolved discussions (waiting on @vadorovsky)
Cargo.toml
line 43 at r1 (raw file):
Previously, vadorovsky wrote…
I checked and cargo-udeps doesn't inform about unused workspace dependencies. :/ I will keep thinking about the solution.
Does cargo machete do any better? https://blog.benj.me/2022/04/27/cargo-machete/
Cargo.toml
line 47 at r1 (raw file):
Previously, vadorovsky wrote…
It's not, we can always list features in user crates.
My idea was to define them here if we know that we are going to use those features in all crates and keep only single feature lists which differ in user crates. To not repeat the feature list over everywhere when not necessary.
I think it'd be better to mark everything here default-features = false
and let downstream crates request the features they want. Otherwise you risk introducing unintended features (and dependencies) downstream.
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.
Reviewable status: 9 of 11 files reviewed, 2 unresolved discussions (waiting on @tamird)
Cargo.toml
line 43 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
Does cargo machete do any better? https://blog.benj.me/2022/04/27/cargo-machete/
It doesn't :(
Cargo.toml
line 47 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
I think it'd be better to mark everything here
default-features = false
and let downstream crates request the features they want. Otherwise you risk introducing unintended features (and dependencies) downstream.
Good point
202c688
to
7a51127
Compare
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.
Reviewed 1 of 2 files at r2, 6 of 6 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @vadorovsky)
Cargo.toml
line 43 at r1 (raw file):
Previously, vadorovsky wrote…
It doesn't :(
Maybe the best we can do is add a comment here?
7a51127
to
1912dbe
Compare
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @tamird)
Cargo.toml
line 43 at r1 (raw file):
Previously, tamird (Tamir Duberstein) wrote…
Maybe the best we can do is add a comment here?
Done. I will also think about contributing either to cargo-udeps or cargo-machete.
1912dbe
to
39c4dbe
Compare
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.
Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @vadorovsky)
e1f6e5c
to
c8dbb96
Compare
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.
Reviewed 1 of 1 files at r6, 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @vadorovsky)
This way we will avoid version mismatches and make differences in features across our crates clearer.
c8dbb96
to
96fa08b
Compare
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.
Reviewed 3 of 3 files at r8, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @vadorovsky)
This way we will avoid version mismatches and make differences in features across our crates clearer.
This change is