-
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
Fix -Zfeatures=itarget with certain host dependencies #8048
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Mar 27, 2020
2 tasks
@bors: r+ Nah this makes sense to me, thanks for digging in here! |
📌 Commit 86ee8ce has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Mar 27, 2020
☀️ Test successful - checks-azure |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Apr 2, 2020
Update cargo 8 commits in 8a0d4d9c9abc74fd670353094387d62028b40ae9..6e07d2dfb7fc87b1c9489de41da4dafa239daf03 2020-03-24 17:57:04 +0000 to 2020-03-31 03:22:39 +0000 - Fix man page typo for "Owner Options". (rust-lang/cargo#8057) - enable progress bar on all UNIX platforms (rust-lang/cargo#8054) - Squelch some rustdoc warnings. (rust-lang/cargo#8052) - Remove clippy tests. (rust-lang/cargo#8053) - Fix -Zfeatures=itarget with certain host dependencies (rust-lang/cargo#8048) - Checking for binary that is built as an implicit dependency of an integration test. (rust-lang/cargo#8020) - Use stabilized version of rustdoc's --crate-version (rust-lang/cargo#8039) - Remove the `git-checkout` subcommand. (rust-lang/cargo#8040)
Centril
added a commit
to Centril/rust
that referenced
this pull request
Apr 2, 2020
Update cargo 8 commits in 8a0d4d9c9abc74fd670353094387d62028b40ae9..6e07d2dfb7fc87b1c9489de41da4dafa239daf03 2020-03-24 17:57:04 +0000 to 2020-03-31 03:22:39 +0000 - Fix man page typo for "Owner Options". (rust-lang/cargo#8057) - enable progress bar on all UNIX platforms (rust-lang/cargo#8054) - Squelch some rustdoc warnings. (rust-lang/cargo#8052) - Remove clippy tests. (rust-lang/cargo#8053) - Fix -Zfeatures=itarget with certain host dependencies (rust-lang/cargo#8048) - Checking for binary that is built as an implicit dependency of an integration test. (rust-lang/cargo#8020) - Use stabilized version of rustdoc's --crate-version (rust-lang/cargo#8039) - Remove the `git-checkout` subcommand. (rust-lang/cargo#8040)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
In some cases,
-Zfeatures=itarget
can panic because an entry is missing in the activation map. This happens because the way "for_host" was tracked when building the activation map. Previously "for_host" was only set when-Zfeatures=host_dep
was specified. However, if you don't specifyhost_dep
, then "for_host" was always false.This is a problem because
itarget
needs to also be able to detect if something is enabled for the host or target. If you have a proc-macro ("for_host"), and it has a dependency with a[target]
specification that matched the host, then the activation map would fail to include it (because the "for_host" flag was not "sticky" and didn't get passed down).The solution is to always carry the "for_host" setting around while building the activation map. Only when inserting a feature into the map will it check if
opts.decouple_host_deps
is set. This allows it to handle the "for_host" setting correctly, even if thehost_dep
option isn't enabled.This was discovered at #7914 (comment) where a dependency on
hashbrown
would fail if you pass--target something_not_unix
because it has a unix-only dependency forlibc
.(Sorry, long-winded explanation. Please ask if that is confusing.)