-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Avoid some extra downloads with new feature resolver. #8823
Conversation
r? @Eh2406 (rust_highfive has picked a reviewer for you, use r? to override) |
Seems reasonable and it is your area of expertise. |
This is just an interim solution, right? In the sense that once we default new crates to the new features in the new resolver, won't |
No, I intend to keep it mostly the way it is. I would like to transition so that all projects use the new feature resolver, but still in the "old" mode where features are unified (unless you set I'm fairly comfortable with that. All tests pass with the |
@bors: r+ Ok makes sense. I'm a little worried that we're trying to optimize the old default (what we have today) and the new default doesn't have the same avenue for optimization (it could be viewed as a regression in that regard?), but in some sense it is what it is! |
📌 Commit 3d5a908 has been approved by |
☀️ Test successful - checks-actions |
Update cargo 7 commits in becb4c282b8f37469efb8f5beda45a5501f9d367..d5556aeb8405b1fe696adb6e297ad7a1f2989b62 2020-10-28 16:41:55 +0000 to 2020-11-04 22:20:36 +0000 - Implement weak dependency features. (rust-lang/cargo#8818) - Avoid some extra downloads with new feature resolver. (rust-lang/cargo#8823) - fix: remove install command `$`, for copying friendly (rust-lang/cargo#8828) - Bump `anyhow` dependency to `1.0.34` in `crates-io` crate (rust-lang/cargo#8826) - Normalize SourceID in `cargo metadata`. (rust-lang/cargo#8824) - vendor: correct the path to cargo config (rust-lang/cargo#8822) - Make host_root return host.root(), not host.dest() (rust-lang/cargo#8819)
Update cargo 7 commits in becb4c282b8f37469efb8f5beda45a5501f9d367..d5556aeb8405b1fe696adb6e297ad7a1f2989b62 2020-10-28 16:41:55 +0000 to 2020-11-04 22:20:36 +0000 - Implement weak dependency features. (rust-lang/cargo#8818) - Avoid some extra downloads with new feature resolver. (rust-lang/cargo#8823) - fix: remove install command `$`, for copying friendly (rust-lang/cargo#8828) - Bump `anyhow` dependency to `1.0.34` in `crates-io` crate (rust-lang/cargo#8826) - Normalize SourceID in `cargo metadata`. (rust-lang/cargo#8824) - vendor: correct the path to cargo config (rust-lang/cargo#8822) - Make host_root return host.root(), not host.dest() (rust-lang/cargo#8819)
There are some edge cases with the new feature resolver where it can erroneously trigger a download of a package that is not needed. This is due to the call
is_proc_macro
which has to downloaded the manifest to check if it is a proc-macro. The main change here is to defer callingis_proc_macro
until after dependencies have been filtered. It also avoids callingis_proc_macro
if the new feature resolver is enabled, butdecouple_host_deps
andignore_inactive_targets
are disabled (such as with-Z weak-dep-features
), in which case it doesn't matter if it is a proc-macro or not.Fixes #8776