Files
rust/src/tools/rustc-workspace-hack
Weihang Lo 6306fd3be4 Update cargo
8 commits in 2381cbdb4e9b07090f552d34a44a529b6e620e44..8c460b2237a6359a7e3335890db8da049bdd62fc
2022-12-23 12:19:27 +0000 to 2023-01-04 14:30:01 +0000
- test: revive nightly plugin tests to work (rust-lang/cargo#11534)
- Add note to release notes about rejecting multiple registries. (rust-lang/cargo#11531)
- Fix a typo `fresheness` -> `freshness` (rust-lang/cargo#11529)
- Reasons for rebuilding (rust-lang/cargo#11407)
- Asymmetric tokens (rust-lang/cargo#10771)
- Use proper git URL for GitHub repos (rust-lang/cargo#11517)
- Add `registry.default` example (rust-lang/cargo#11516)
- Support vendoring with different revs from same git repo (rust-lang/cargo#10690)

Also update license exceptions and permitted dependencies
for new cargo dependency "pasetors".

A new dependency `getrandom` is added into `rustc-workspace-hacks`,
since it requires feature `js`.
2023-01-04 15:58:52 +00:00
..
2023-01-04 15:58:52 +00:00
2018-12-25 21:08:33 -07:00
2022-08-27 21:36:08 -07:00

rustc-workspace-hack

This crate is a bit of a hack to make workspaces in rustc work a bit better. The rationale for this existence is a bit subtle, but the general idea is that we want commands like ./x.py build src/tools/{clippy,cargo} to share as many dependencies as possible.

Each invocation is a different invocation of Cargo, however. Each time Cargo runs a build it will re-resolve the dependency graph, notably selecting different features sometimes for each build.

For example, let's say there's a very deep dependency like winapi in each of these builds. For Cargo, winapi has 33 features enabled. In Clippy, however, winapi has 22 features enabled. This means that building Cargo and then the Clippy will actually build winapi twice, which in turn will build duplicates of everything that depends on winapi. This is bad!

The goal of this crate is to solve this problem and ensure that the resolved dependency graph for all of these tools is the same in the various subsets of each tool, notably enabling the same features of transitive dependencies.

All tools vendored here depend on the rustc-workspace-hack crate on crates.io. When on crates.io this crate is an empty crate that is just a noop. We override it, however, in this workspace to this crate here, which means we can control crates in the dependency graph for each of these tools.