-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove duplicate dependencies for rustc itself #75704
Comments
Cargo.lock can appear deceptive because many of these dependencies ultimately are rooted in e.g. RLS. It's not quite a duplicate per se, but I recently audited all the instances of depending on the byteorder crate, for example, and
smallvec 0.6.13 is actually a similar story as this but actually much more snarled. Its dependency chain looks like
After my PR there, measureme should actually be ready to cut a release which will simplify its position in the dependency graph substantially, but much of the work is going to be in basically reviewing and refactoring RLS. I predict it will actually be easier to remove some non-duplicates. |
Note that tokio is in theory removable from RLS. RLS has relatively modest IPC requirements and should be fine with blocking JSON over stdio. However, this might require writing somewhat more code, as IIRC there are no ready-made libraries for blocking IPC. |
I think that could still be easier than recursively updating the community dependencies of That said, it's possible paritytech/jsonrpc#485 will resolve fully soon and |
jsonrpc was updated to use a more recent tokio and so now rls pulls in tokio 0.2! some losses have happened though, e.g.
#84498 also will pull a few deps out of the tree more-or-less permanently. Getting |
Also relevant is that, as far as achieving actual goals like "reducing build/test times for rustc" goes, not all deps are in the root Cargo.lock anymore, as other deps can wind up being built/tested. e.g. Cranelift pulled in its own version of byteorder which I factored out in bytecodealliance/wasmtime#2857, but there's probably others. So "just whatever is duplicated in Cargo.lock" is not our only concern, though it might be more relevant to pursue that in depth in a separate issue. |
The rustc_codegen_cranelift |
Yeah, I don't think Cranelift is particularly heavy, and once that's rebased and the update propagates, it will be even lighter. Just more of a general note that there's wins (and dependencies) to be found deeper in the tree. |
Current status with Duplicatesblock-buffer v0.7.3 └── sha-1 v0.8.2 [build-dependencies] └── pest_meta v2.1.3block-buffer v0.10.2 cargo-platform v0.1.2 (L:\ThirdParty\rust\src\tools\cargo\crates\cargo-platform) cargo-platform v0.1.2 cfg-if v0.1.10 cfg-if v1.0.0 clap v2.34.0 clap v3.0.13 digest v0.8.1 digest v0.10.2 (*) env_logger v0.7.1 (*) env_logger v0.8.4 (*) env_logger v0.9.0 (*) futures v0.1.31 futures v0.3.19 (*) generic-array v0.12.4 generic-array v0.14.4 getrandom v0.1.14 (*) getrandom v0.2.0 (*) hashbrown v0.11.2 hashbrown v0.12.0 hex v0.3.2 hex v0.4.2 humantime v1.3.0 humantime v2.0.1 idna v0.1.5 idna v0.2.0 itertools v0.9.0 itertools v0.10.1 measureme v9.1.2 (*) measureme v10.0.0 (*) percent-encoding v1.0.1 percent-encoding v2.1.0 quick-error v1.2.3 quick-error v2.0.0 rand v0.7.3 (*) rand v0.8.4 rand_chacha v0.2.2 rand_chacha v0.3.0 rand_core v0.5.1 (*) rand_core v0.6.2 (*) rand_xoshiro v0.4.0 rand_xoshiro v0.6.0 rustc_tools_util v0.2.0 (L:\ThirdParty\rust\src\tools\clippy\rustc_tools_util) rustc_tools_util v0.2.0 rustfix v0.5.1 (*) rustfix v0.6.0 (*) sha-1 v0.8.2 (*) sha-1 v0.10.0 (*) strsim v0.8.0 strsim v0.10.0 term v0.6.1 (*) term v0.7.0 (*) textwrap v0.11.0 textwrap v0.14.2 url v1.7.2 (*) url v2.2.2 (*) yaml-rust v0.3.5 yaml-rust v0.4.4 |
@rustbot claim |
I think just updating with |
@rustbot claim |
…trieb Remove duplicate dependencies for rustc Removed several duplicates for rustc: rust-lang#75704 Several duplicates still exist, but an external library would have to be updated first. These are the duplicate dependencies still outstanding: ``` annotate-snippets v0.9.1 annotate-snippets v0.10.1 bitflags v1.3.2 bitflags v2.4.1 cargo_metadata v0.15.4 cargo_metadata v0.18.0 darling v0.14.4 darling v0.20.3 darling_core v0.14.4 darling_core v0.20.3 darling_macro v0.14.4 darling_macro v0.20.3 regex-automata v0.1.10 regex-automata v0.2.0 regex-automata v0.4.3 regex-syntax v0.6.29 regex-syntax v0.7.2 regex-syntax v0.8.2 self_cell v0.10.3 self_cell v1.0.2 syn v1.0.109 syn v2.0.32 toml v0.5.11 toml v0.7.5 ``` It should not be hard to consolidate these remaining duplicate dependencies, but it will take time as it would be pull requests for external crates. r? `@jyn514`
…trieb Remove duplicate dependencies for rustc Removed several duplicates for rustc: rust-lang#75704 Several duplicates still exist, but an external library would have to be updated first. These are the duplicate dependencies still outstanding: ``` annotate-snippets v0.9.1 annotate-snippets v0.10.1 bitflags v1.3.2 bitflags v2.4.1 cargo_metadata v0.15.4 cargo_metadata v0.18.0 darling v0.14.4 darling v0.20.3 darling_core v0.14.4 darling_core v0.20.3 darling_macro v0.14.4 darling_macro v0.20.3 regex-automata v0.1.10 regex-automata v0.2.0 regex-automata v0.4.3 regex-syntax v0.6.29 regex-syntax v0.7.2 regex-syntax v0.8.2 self_cell v0.10.3 self_cell v1.0.2 syn v1.0.109 syn v2.0.32 toml v0.5.11 toml v0.7.5 ``` It should not be hard to consolidate these remaining duplicate dependencies, but it will take time as it would be pull requests for external crates. r? `@jyn514`
…trieb Remove duplicate dependencies for rustc Removed several duplicates for rustc: rust-lang#75704 Several duplicates still exist, but an external library would have to be updated first. These are the duplicate dependencies still outstanding: ``` annotate-snippets v0.9.1 annotate-snippets v0.10.1 bitflags v1.3.2 bitflags v2.4.1 cargo_metadata v0.15.4 cargo_metadata v0.18.0 darling v0.14.4 darling v0.20.3 darling_core v0.14.4 darling_core v0.20.3 darling_macro v0.14.4 darling_macro v0.20.3 regex-automata v0.1.10 regex-automata v0.2.0 regex-automata v0.4.3 regex-syntax v0.6.29 regex-syntax v0.7.2 regex-syntax v0.8.2 self_cell v0.10.3 self_cell v1.0.2 syn v1.0.109 syn v2.0.32 toml v0.5.11 toml v0.7.5 ``` It should not be hard to consolidate these remaining duplicate dependencies, but it will take time as it would be pull requests for external crates. r? ``@jyn514``
Some things that immediately look promising to remove:
smallvec 0.6.13
, fromrustc_workspace_hack
(can be upgraded)semver 0.9
, used for the rustc_ crates where cargo uses 0.10env_logger 0.6
, used in rustfmt (can be upgraded)These duplicates were collected with
cargo tree -d
in the top-level directory of the rust code base.Duplicates
The text was updated successfully, but these errors were encountered: