-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Tracking Issue for rustdoc --doctest-build-arg
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
Comments
… 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`
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`
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 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 That said, I don't think this feature on its own is bad. Thank you for working on a fix!! |
…ing, r=GuillaumeGomez rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg` Tracking issue: rust-lang#134172. Context: rust-lang#137096 (comment) Yeets the ad hoc shell-like lexer for 'nested' program arguments. No FCP necessary since the flag is unstable. I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically. **Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo. I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'. r? GuillaumeGomez r? notriddle
…ing, r=GuillaumeGomez rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg` Tracking issue: rust-lang#134172. Context: rust-lang#137096 (comment) Yeets the ad hoc shell-like lexer for 'nested' program arguments. No FCP necessary since the flag is unstable. I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically. **Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo. I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'. r? GuillaumeGomez r? notriddle
…ing, r=GuillaumeGomez rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg` Tracking issue: rust-lang#134172. Context: rust-lang#137096 (comment) Yeets the ad hoc shell-like lexer for 'nested' program arguments. No FCP necessary since the flag is unstable. I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically. **Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc ``@argfile`)`` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo. I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'. r? GuillaumeGomez r? notriddle
Rollup merge of rust-lang#139863 - fmease:simp-doctest-build-arg-passing, r=GuillaumeGomez rustdoc: Replace unstable flag `--doctest-compilation-args` with a simpler one: `--doctest-build-arg` Tracking issue: rust-lang#134172. Context: rust-lang#137096 (comment) Yeets the ad hoc shell-like lexer for 'nested' program arguments. No FCP necessary since the flag is unstable. I've chosen to replace `compilation` with `build` because it's shorter (you now need to pass it multiple times in order to pass many arguments to the doctest compiler, so it matters a bit) and since I prefer it esthetically. **Issue**: Even though we don't process the argument passed to `--doctest-build-arg`, we end up passing it via an argument file (`rustc `@argfile`)` which delimits arguments by line break (LF or CRLF, [via](https://doc.rust-lang.org/rustc/command-line-arguments.html#path-load-command-line-flags-from-a-path)) meaning ultimately the arguments still get split which is unfortunate. Still, I think this change is an improvement over the status quo. I'll update the tracking issue if/once this PR merges. I'll also add the (CR)LF issue to 'unresolved question'. r? GuillaumeGomez r? notriddle
--doctest-compilation-args
command line option--doctest-build-arg
command line option
A command line option to pass program arguments to the underlying compiler building doctests.
Original issue motivating this feature: #67533.
Steps
Unresolved Questions
--doctest-build-arg
, we end up passing it via an argument file (rustc @argfile
) which delimits arguments by line break (LF or CRLF, via) meaning ultimately the arguments still get split which is unfortunate. Is there are good way to resolve this (obvious but intrusive solution: smh signal torustc
not to split inside the argsfile)?Implementation History
--doctest-compilation-args
option to add compilation flags to doctest compilation #128780--doctest-compilation-args
with a simpler one:--doctest-build-arg
#139863The text was updated successfully, but these errors were encountered: