Skip to content

Tracking Issue for rustdoc --doctest-compilation-args command line option #134172

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

Open
3 tasks
GuillaumeGomez opened this issue Dec 11, 2024 · 1 comment
Open
3 tasks
Labels
A-CLI Area: Command-line interface (CLI) to the compiler A-doctests Area: Documentation tests, run by rustdoc C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Dec 11, 2024

Steps

Original issue

Unresolved Questions

  • Should argument parsing be closer to what already exists for RUSTFLAGS (whitespace splitting and nothing else) or should it be closer to how shell parses input (take into account escaped characters and quote characters)? Or should we offer two options, one that works like RUSTFLAGS for human users and one that works like CARGO_ENCODED_RUSTLFAGS for tool usage?
@GuillaumeGomez GuillaumeGomez added C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 11, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Dec 21, 2024
… r=rustdoc

Add `--doctest-compilation-args` option to add compilation flags to doctest compilation

Fixes rust-lang#67533.
Tracking issue: rust-lang#134172

It's been something I meant to take a look at for a long time and actually completely forgot... The idea is to allow to give more control over how doctests are compiled to users. To do so, this PR adds a new `--doctest-compilation-args` option which provides extra compilation flags.

r? `@notriddle`
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Dec 21, 2024
Rollup merge of rust-lang#128780 - GuillaumeGomez:rustflags-doctests, r=rustdoc

Add `--doctest-compilation-args` option to add compilation flags to doctest compilation

Fixes rust-lang#67533.
Tracking issue: rust-lang#134172

It's been something I meant to take a look at for a long time and actually completely forgot... The idea is to allow to give more control over how doctests are compiled to users. To do so, this PR adds a new `--doctest-compilation-args` option which provides extra compilation flags.

r? `@notriddle`
@weihanglo
Copy link
Member

Considering all linked issues (#67533, #66623, rust-lang/cargo#13697, rust-lang/miri#3869) are actually Cargo-related, I wonder how to integrate this flag to help Cargo users. Cargo doesn't parse RUSTFLAGS so it may not know if --cap-lints=warn is there and pass to --doctest-compilation-args accordingly.

Also, the feature seems to open a door way bigger than what #67533 was looking for. It accepts arbitrary rustc flags. Mind sharing why propagating -cap-lints isn't under consideration? Maybe there are other use cases for arbitrary flags I am missing. We all know that once we provide more stuff to users, we might have no chance to take it back 😓.

That said, I don't think this feature on its own is bad. Thank you for working on a fix!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: Command-line interface (CLI) to the compiler A-doctests Area: Documentation tests, run by rustdoc C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
Status: No status
Development

No branches or pull requests

3 participants