Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#114651 - tmfink:rustdoc-rustc-wrapper, r=GuillaumeGomez rustdoc: add `--test-builder-wrapper` arg to support wrappers such as RUSTC_WRAPPER when building doctests Currently, `rustdoc` builds test crates with `rustc` directly instead of using [`RUSTC_WRAPPER`](https://doc.rust-lang.org/cargo/reference/config.html#buildrustc-wrapper) (if any is set). This causes build issues in build systems that use `cargo` but tweak linking flags by setting the `RUSTC_WRAPPER` environment variable. This change is not meant to be final--it's only a minimal proof of concept. Please advise on the best way to proceed. Open questions: - [x] Does supporting the `rustc` wrappers make sense? - yes, `cargo-miri` for example needs a "hack" to workaround the issue - [X] What environment variable(s) should be read for the rustc wrapper? Should `rustdoc` [use the same names as `cargo`](https://doc.rust-lang.org/cargo/reference/config.html#buildrustc-wrapper)? - None, since `rustdoc` takes arguments - [X] What name should be used for a `rustdoc` CLI option? - `--test-builder-wrapper` - [X] Should a separate workspace wrapper (like `RUSTC_WORKSPACE_WRAPPER`) be supported? - `--test-builder-wrapper` can be passed multiple times to get multiple wrappers passed - [X] How/where should this be documented? It's not obvious to all users that `cargo doc` actually causes `rustdoc` to compile tests with rust - Added doc to `src/doc/rustdoc/src/command-line-arguments.md` per `@GuillaumeGomez`
- Loading branch information