cargo
cargo copied to clipboard
feat: support `target.<triple>.rustdocflags` officially
What does this PR try to resolve?
CARGO_TARGET_<TRIPLE>_RUSTDOCFLAGS was accidentally accepted somehow,
so support both config and env officially,
given that removing env support would be a breaking change.
Fixes #13189
How should we test and review this PR?
Commit by commit.
Additional information
I leave target.<cfg>.rustdocflags for future possibilities,
as it might incur the same convergence issue target.<cfg>.rustflags has.
r? @epage
(rustbot has picked a reviewer for you, use r? to override)
Can you add a test for cargo test --doc, too, since it goes through a very different code path?
Added a new test target_triple_rustdocflags_works_through_cargo_test.
Let me know if there is anything missing.
When combined with -Zhost-config does this also support host.rustdocflags? (I've just found out we actually need to use this for docs.rs to fix issues with combining -Zhost-config and --config build.rustdocflags).
I didn't include that in this PR, but can probably do that if there is a use case.
:umbrella: The latest upstream changes (presumably #13409) made this pull request unmergeable. Please resolve the merge conflicts.
@bors r+
Seems reasonable. Fleshing this out isn't the required way to go (could also deprecate it) but I think its a reasonable to do. This does slightly expand our compatibility guarantees but its in such alignment with what we already do that I don't think its worth holding a straw vote on this. If someone disagrees, we can revert before March 21 and re-evaluate.
:pushpin: Commit 6131e991af7dfd14b7641c0b09664d8c81d9af8d has been approved by epage
It is now in the queue for this repository.
:hourglass: Testing commit 6131e991af7dfd14b7641c0b09664d8c81d9af8d with merge 3d47dd412e4c342ca5cb28cf9944ed9de9462b83...
:sunny: Test successful - checks-actions Approved by: epage Pushing 3d47dd412e4c342ca5cb28cf9944ed9de9462b83 to master...
When combined with
-Zhost-configdoes this also supporthost.rustdocflags? (I've just found out we actually need to use this for docs.rs to fix issues with combining-Zhost-configand--config build.rustdocflags).
@Nemo157 could you elaborate on this more and create a new issue, so we won't lose track of it?