-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Add --doctest-compilation-args
option to add compilation flags to doctest compilation
#128780
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
05731af
Add `--doctest-compilation-args` option to allow passing arguments to…
GuillaumeGomez 2bd8690
Add regression test for `--doctest-compilation-args`
GuillaumeGomez d3c970a
Add explanations about `--doctest-compilation-args` in rustdoc book
GuillaumeGomez 24fafe7
Update `run-make/rustdoc-default-output` test
GuillaumeGomez cbb3df4
Split arguments from `--doctest-compilation-args` like a shell would
GuillaumeGomez 55653a5
Add explanations on how arguments are split
GuillaumeGomez bc03e40
Move test into the `tests.rs` file
GuillaumeGomez 2d914be
Add test to ensure passing `--doctest_compilation_args` multiple time…
GuillaumeGomez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does not match shell -- in shell, you cannot do any escaping inside
'
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting! Gonna change this behaviour then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a fan of us having a re-implementation of shell word splitting in the repo. We'll inevitably get it wrong in subtle ways. I think we should, if at all possible, avoid having to do word splitting.
If some word splitting is needed, then given that RUSTFLAGS can get by without any quote handling, it might be better to just remain consistent with that. Or alternatively, if the flag is only meant to be set by machines, we could use the format used by CARGO_ENCODED_RUSTFLAGS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I'm gonna keep the current behaviour. It's not exactly like a shell would do, but it's fully described in the book and in any case it's unstable until further notice, so if users are unhappy with this format, nothing prevents us from changing it in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you land this on nightly with completely non-standard behavior (as seems to be the case right now), there's a chance that it's going to be hard to change later. We don't have to make the final call now, but the implementation should at least do something that plausibly could be the final version, and I would say right now that is not the case.
Also, please make sure this is explicitly listed in the tracking issue so that this is discussed before stabilization. Where is that tracking issue, anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's #134172. Adding it into the first comment as well.