-
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
Error message for transitive artifact dependencies with targets the package doesn't directly interact with #11643
Conversation
r? @ehuss (rustbot has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really neat and complete! Love to see people putting more doc comments during development! Thank you!
Just some picky styling issues left. Let me know if you disagree or have a better idea :)
I suggest that this doesn't entirely fix #11260. I would expect artifact dependencies to work, not generate an error message. |
Oops that's my fault. I though it was just target spec not found but it turns out not. Cargo should learn all targets required by artifact dependencies, probably after unit graph is created. Thanks Eric for calling out and sorry for the wrong pointer, @jofas 😞. |
Me too 😅
No worries. In the issue it sounded like getting all the necessary targets for building transitive artifact dependencies isn't trivial and I assumed a change like that required some more procedural overhead than a simple PR (does cargo have RFCs as well?). With some more hints on where I need to look in order to add the required targets for transitive artifact dependencies to |
cargo/src/cargo/core/compiler/build_context/target_info.rs Lines 919 to 925 in 99b1369
AFAICT, if we make this function recursive and call it for each dependency, we should get all the necessary targets for transitive dependencies, no? I haven't found a way yet to get the |
I am afraid it won't work, or requests for too many targets then it really needs. We should also consider optional dependencies and the feature resolution. I believe Cargo doesn't need every disabled target platform toolchain to exist on the host machine. |
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
…+ incorporated changes into corresponding test
Will that really be a problem? Sure, creating |
r? @weihanglo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bors r+ |
Error message for transitive artifact dependencies with targets the package doesn't directly interact with Address #11260. Produces an error message like described by `@weihanglo` [here](#11260 (comment)): ``` error: could not find specification for target "x86_64-windows-msvc" Dependency `bar v0.1.0` requires to build for target "x86_64-windows-msvc". ``` Note that this is not a complete fix for #11260.
💔 Test failed - checks-actions |
I posted #11766 to fix the issue with CI failing. |
@bors retry |
☀️ Test successful - checks-actions |
Great, please let me know if you find anything I could help with. |
10 commits in 9d5b32f503fc099c4064298465add14d4bce11e6..9880b408a3af50c08fab3dbf4aa2a972df71e951 2023-02-22 23:04:16 +0000 to 2023-02-28 19:39:39 +0000 - bump jobserver to respect `--jobserver-auth=fifo:PATH` (rust-lang/cargo#11767) - Addition of support for -F as an alias for --features (rust-lang/cargo#11774) - Added documentation for the configuration discovery of `cargo install` to the man pages (rust-lang/cargo#11763) - Fix Cargo removing the sparse+ prefix from sparse URLs in .crates.toml (rust-lang/cargo#11756) - Fix warning with tempfile (rust-lang/cargo#11771) - Error message for transitive artifact dependencies with targets the package doesn't directly interact with (rust-lang/cargo#11643) - Fix tests with nondeterministic ordering (rust-lang/cargo#11766) - Make some blocking tests non-blocking (rust-lang/cargo#11650) - Suggest cargo add when installing library crate (rust-lang/cargo#11410) - chore: bump is-terminal to 0.4.4 (rust-lang/cargo#11759)
Update cargo 10 commits in 9d5b32f503fc099c4064298465add14d4bce11e6..9880b408a3af50c08fab3dbf4aa2a972df71e951 2023-02-22 23:04:16 +0000 to 2023-02-28 19:39:39 +0000 - bump jobserver to respect `--jobserver-auth=fifo:PATH` (rust-lang/cargo#11767) - Addition of support for -F as an alias for --features (rust-lang/cargo#11774) - Added documentation for the configuration discovery of `cargo install` to the man pages (rust-lang/cargo#11763) - Fix Cargo removing the sparse+ prefix from sparse URLs in .crates.toml (rust-lang/cargo#11756) - Fix warning with tempfile (rust-lang/cargo#11771) - Error message for transitive artifact dependencies with targets the package doesn't directly interact with (rust-lang/cargo#11643) - Fix tests with nondeterministic ordering (rust-lang/cargo#11766) - Make some blocking tests non-blocking (rust-lang/cargo#11650) - Suggest cargo add when installing library crate (rust-lang/cargo#11410) - chore: bump is-terminal to 0.4.4 (rust-lang/cargo#11759) r? `@ghost`
Address #11260. Produces an error message like described by @weihanglo here:
Note that this is not a complete fix for #11260.