Skip to content
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

Fix rustdoc --test-builder argument parsing #80924

Merged
merged 3 commits into from
Jan 13, 2021

Conversation

teryror
Copy link
Contributor

@teryror teryror commented Jan 11, 2021

My suggested fix to issue #80893. I can actually hook Miri in there now.

I also fixed what I believe to be a typo in the option's help text.

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jyn514 (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 11, 2021
@jyn514 jyn514 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 12, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 12, 2021

Can you add a test for the fixed behavior so this doesn't regress again? It would go in src/test/rustdoc, see https://rustc-dev-guide.rust-lang.org/rustdoc-internals.html#dotting-is-and-crossing-ts for instructions. I'm not sure what to use as the test builder - maybe true or false or something?

@jyn514 jyn514 added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 12, 2021
src/librustdoc/lib.rs Outdated Show resolved Hide resolved
@teryror
Copy link
Contributor Author

teryror commented Jan 12, 2021

There you go. I hope I did that right, I don't rebase very often.

@jyn514
Copy link
Member

jyn514 commented Jan 12, 2021

@teryror I think you forgot to add the regression test to git.

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
@jyn514
Copy link
Member

jyn514 commented Jan 12, 2021

r=me with CI passing (feel free to ping me if I forget). Thanks for fixing this!

@jyn514
Copy link
Member

jyn514 commented Jan 12, 2021

@bors r+

@bors
Copy link
Contributor

bors commented Jan 12, 2021

📌 Commit f3c8f29 has been approved by jyn514

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 12, 2021
@teryror
Copy link
Contributor Author

teryror commented Jan 12, 2021

Hooray!

Glad to be of service. Also, sorry about the brain farts earlier :D

@jyn514
Copy link
Member

jyn514 commented Jan 12, 2021

No problem! That's what review is for anyway :)

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 13, 2021
Rollup of 10 pull requests

Successful merges:

 - rust-lang#78901 (diagnostics: Note capturing closures can't be coerced to fns)
 - rust-lang#79588 (Provide more information for HRTB lifetime errors involving closures)
 - rust-lang#80232 (Remove redundant def_id lookups)
 - rust-lang#80662 (Added support for i386-unknown-linux-gnu and i486-unknown-linux-gnu)
 - rust-lang#80736 (use Once instead of Mutex to manage capture resolution)
 - rust-lang#80796 (Update to LLVM 11.0.1)
 - rust-lang#80859 (Fix --pretty=expanded with --remap-path-prefix)
 - rust-lang#80922 (Revert "Auto merge of rust-lang#76896 - spastorino:codegen-inline-fns2)
 - rust-lang#80924 (Fix rustdoc --test-builder argument parsing)
 - rust-lang#80935 (Rename `rustc_middle::lint::LevelSource` to `LevelAndSource`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit c64d3f0 into rust-lang:master Jan 13, 2021
@rustbot rustbot added this to the 1.51.0 milestone Jan 13, 2021
@teryror teryror deleted the issue-80893-fix branch January 13, 2021 08:08
@@ -0,0 +1,6 @@
// compile-flags: --test -Z unstable-options --test-builder true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustdoc passes the source code the the builder through stdin. If true happens to terminate before that, the rustdoc will be terminated by SIGPIPE. This makes the test quite flaky, e.g., #79705 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use cat instead ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe wc if the output would end up in the test log.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cat: unrecognized option '--crate-type'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, in shell : will work, but I think this goes through process::Command.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can always just use --test-builder rustc.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, in shell : will work, but I think this goes through process::Command.

No, :, if it works, is just an alias for true. It would have the same problem. We need something that will actually read the input.

You can always just use --test-builder rustc.

Haha lol, why didn't I think of that. Of course that wouldn't test that the argument actually has any effect but the current test doesn't check that anyway. So +1.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I opened #81197 fixing this.

@jyn514 jyn514 mentioned this pull request Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants