Platform-specific-ness is carried via deps#9982
Platform-specific-ness is carried via deps#9982illicitonion wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
r? @ehuss (rust-highfive has picked a reviewer for you, use r? to override) |
edac5d7 to
dbc34b9
Compare
If e.g. an optional feature is only enabled on certain platforms, meaning a transitive dependency is only enabled on certain platforms, currently that information can't be worked out from the output of `cargo metadata`. With this change, when a dependency is configured for a specific platform, its dependencies are by default also configured for that specific platform, unless they explicitly have a different platform attached to them. This makes it easier to translate crates.io packages for building with non-cargo build systems, because this platform-specific behaviour of feature resolution is now observable in `cargo metadata`, rather than requiring those systems to track and re-implement feature resolution themselves with regard to platforms. Fixes rust-lang#9863.
dbc34b9 to
5bb7b2f
Compare
|
What happens if a dependency is target-specific by one path through the dependency tree, but not target-specific by another path through the dependency tree? |
Currently not the correct thing! I've locally added a test that it should either represent that as one unified platform: "dep_kinds": [
{
"kind": null,
"target": null
}
]or noting that there were multiple platforms that led to this dep: "dep_kinds": [
{
"kind": null,
"target": "x86_64-apple-darwin"
},
{
"kind": null,
"target": null
}
]Working on updating the code - thanks for the feedback! |
|
@rustbot label +S-waiting-on-author -S-waiting-on-review |
|
Error: The feature Please let |
|
After chatting with @ehuss (thanks!) we ascertained:
Closing this for now in favour of working out how to express resolver v2 output from |
Enable triagebot's relabel functionality ### What does this PR try to resolve? This fixes the following failure that rustbot currently posts whenever someone tries to use "<b>`@</b><b>rustbot</b>` label" in this repository. > **Error**: The feature `relabel` is not enabled in this repository. > To enable it add its section in the `triagebot.toml` in the root of the repository. Unauthenticated relabel has been enabled in rust-lang/rust for nearly 4 years. People overwhelmingly use it in good faith. <br> ### How should we test and review this PR? Compare against https://github.com/rust-lang/rust/blob/1.66.0/triagebot.toml. Also skim through the 7 pages of labels on https://github.com/rust-lang/cargo/labels, whether it makes sense the ones I decided to allow arbitrary GitHub users to apply. <br> ### Additional information Attempted uses of "<b>`@</b><b>rustbot</b>` label", that failed, but this PR would allow: - #10343 (comment) - #10243 (comment) - #9982 (comment) - #9128 (comment) - #9067 (comment) - #8441 (comment) - #11432 (comment) - #8841 (comment) - #10820 (comment) - #10572 (comment) - #9114 (comment) - #8980 (comment) - #9064 (comment) - #8726 (comment) - #8089 (comment)
If e.g. an optional feature is only enabled on certain platforms,
meaning a transitive dependency is only enabled on certain platforms,
currently that information can't be worked out from the output of
cargo metadata.With this change, when a dependency is configured for a specific
platform, its dependencies are by default also configured for that
specific platform, unless they explicitly have a different platform
attached to them.
This makes it easier to translate crates.io packages for building with
non-cargo build systems, because this platform-specific behaviour of
feature resolution is now observable in
cargo metadata, rather thanrequiring those systems to track and re-implement feature resolution
themselves with regard to platforms.
Fixes #9863.