[WIP] Use workspace dependencies and try to unify duplicates #512
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main motivation is trying to resolve many heavy duplicated dependencies e.g.
tokio,sqlx-core,sqlx-postgres,serde_core,axum, unfortunately it didn't seem to really work, what is really odd is that they all (exceptaxum) seem to be using the same version and subset of each other's features which contradicts my mental modal of cargo.I merged all
[dependencies], and then tries to mergeI experimented with different things:
tokiowithout features to the workspace dependencies and then added the features explicitly to the dependencies in the crate, which seems better and probably should be done for all dependencies (and would avoid unnecessary features of dependencies when only using some of the crates in the workspace), see: Poor interaction between workspace dependencies and default-features rust-lang/cargo#12162 (comment)tokio.features = ["all"]which seems unnecessary by roughly guessing the features and seeing the errors and it seemed to work first try, but now that I think about it it's probably just using the shared tokio dependency and is probably missing some featuresconsole-subscriberto0.5.0removed the duplicatedaxumdependency and massively reduced compile time from ~1m to ~37slibrqbit-sha1-wrapper.default-features = falsefor it to pick the default backend and compile, not sure how it worked before(P.S. I also sorted the dependencies but with vim
:sortwhich doesn't match cargo notion of sorting with things likecargo addbecause of the order of some special characters like-and_)