cargo: cross-compilation doctests warning should not be behind verbose flag
Main tracking issue: https://github.com/rust-lang/cargo/issues/7040
Problem
I just spent a lot longer than I’m willing to admit trying to work out why my doctests were not running. After working out I’d done everything correctly I finally tried --verbose and found the warning about cross-compilation not being supported.
cargo test completes successfully and I’ve not even known that the doctests have been skipped for months! Why is this warning hidden behind the verbose flag?
Steps
Create a src file with failing doc tests:
lib.rs
/// ```
/// panic("something')
/// ```
pub fn my_function() { }
Ensure you’re building for another target. For me, this was on an M1 mac with the following .cargo/config to make this a cross platform build:
[build]
target = "x86_64-apple-darwin"
Run cargo test --doc
Results in no output after the build output.
Version
cargo 1.69.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 1
- Comments: 19 (8 by maintainers)
Commits related to this issue
- as per issue/comment https://github.com/rust-lang/cargo/issues/12118#issuecomment-1541860834 added warning about skipping doctest on xcompiling even when not under verbose flag — committed to progressive-galib/cargo by progressive-galib 2 years ago
- Stabilize doctest-xcompile (#15462) This stabilizes the doctest-xcompile feature by unconditionally enabling it. Closes https://github.com/rust-lang/cargo/issues/7040 Closes https://github.com/rust-... — committed to rust-lang/cargo by ehuss 2 years ago
Just a friendly reminder. It would be great for collaboration if people always strive to provide reproducible steps and version information for their issues. That may increase the chance for anyone wanting to fix gets started sooner.
As it is labeled as
P-lowandS-needs-mentor, I’d suggest working on other issues if you’re interested in contributing Cargo.