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 another ICE in rustdoc scrape_examples #90611

Merged
merged 4 commits into from
Nov 27, 2021

Conversation

fee1-dead
Copy link
Member

This has occurred to me when documenting a crate with the arguments. Not sure what could have caused it.

r? @willcrichton

@fee1-dead fee1-dead added A-rustdoc-scrape-examples Area: The (unstable) rustdoc scrape-examples feature described in RFC 3123 C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. labels Nov 5, 2021
@jyn514
Copy link
Member

jyn514 commented Nov 5, 2021

@fee1-dead can you please add a test for this?

@jyn514 jyn514 self-assigned this Nov 5, 2021
@willcrichton
Copy link
Contributor

Thanks @fee1-dead !!

One request. Can you add a trace! call for these two early returns? Just like I'm introducing in this other PR: https://github.com/rust-lang/rust/pull/90583/files#diff-77f9ef3a3f7e3637167a2856739a2fbb33946a33c1bccb328119dfaaa801a02dR187

@jyn514 jyn514 added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 5, 2021
@fee1-dead
Copy link
Member Author

fee1-dead commented Nov 5, 2021

I found the percent_encoding crate was causing it. I was able to reproduce with the file, but I don't know the root cause of the ICE, so I'm just going to use the file as a ui test.

The file is available to download from here

@fee1-dead fee1-dead added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 5, 2021
@apiraino apiraino added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Nov 11, 2021
@camelid
Copy link
Member

camelid commented Nov 17, 2021

Please try to make the test case an MCVE too. I don't think we should have a 500 line test case if we can avoid it.

@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 Nov 23, 2021
@jyn514
Copy link
Member

jyn514 commented Nov 26, 2021

@fee1-dead if you like, I know that https://github.com/chengniansun/perses is a tool for trying to reduce test cases, it may or may not be easier than trying to reduce this manually.

@fee1-dead
Copy link
Member Author

Thanks @jyn514! Perses is a very powerful tool and it reduced it to use core; which shocked me.

@jyn514
Copy link
Member

jyn514 commented Nov 26, 2021

Hmm, that doesn't actually give me a lot of confidence that we know how this crash happens ... but I guess it's not super important as long as it's fixed and we have a test it won't regress.

@bors r=jyn514,willcrichton

@bors
Copy link
Contributor

bors commented Nov 26, 2021

📌 Commit 9c14d82 has been approved by jyn514,willcrichton

@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 Nov 26, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 27, 2021
…askrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#90611 (Fix another ICE in rustdoc scrape_examples)
 - rust-lang#91197 (rustdoc: Rename `Type::ResolvedPath` to `Type::Path` and don't re-export it)
 - rust-lang#91223 (Fix headings indent)
 - rust-lang#91240 (Saner formatting for UTF8_CHAR_WIDTH table)
 - rust-lang#91248 (Bump compiler-builtins to 0.1.53)
 - rust-lang#91252 (Fix bug where submodules wouldn't be updated when running x.py from a subdirectory)
 - rust-lang#91259 (Remove `--display-doctest-warnings`)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 10743f0 into rust-lang:master Nov 27, 2021
@rustbot rustbot added this to the 1.58.0 milestone Nov 27, 2021
@fee1-dead fee1-dead deleted the rustdoc-ice-fix branch November 27, 2021 04:53
@petrochenkov
Copy link
Contributor

@fee1-dead
The added test writes the t.calls file right to the root of the repository (at least if you run x.py from it).

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        t.calls

All test outputs should be limited to the build directory.

@fee1-dead fee1-dead restored the rustdoc-ice-fix branch November 28, 2021 15:25
@@ -0,0 +1,4 @@
// compile-flags: -Z unstable-options --scrape-examples-output-path t.calls --scrape-examples-target-crate foobar
Copy link
Member

Choose a reason for hiding this comment

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

I think you can just remove output-path here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't think so, it will error if either of the two options are unset. Perhaps it should point to build/tmp/?

Copy link
Member

Choose a reason for hiding this comment

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

it will error if either of the two options are unset.

well that's odd ... @willcrichton is there a reason you made that a hard error instead of giving it a default value?

anyway, in the meantime, try {{build-base}}/t.calls: https://rustc-dev-guide.rust-lang.org/tests/adding.html#input-normalization

Copy link
Contributor

Choose a reason for hiding this comment

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

There isn't an obvious default value IMO. Eg doing {crate_name}.calls isn't desirable due to the many conflicting crate names in a workspace.

Copy link
Member

Choose a reason for hiding this comment

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

We could do {crate_name}-{crate_type} maybe. I don't think it has to be amazing, just some reasonable default to match --output-format json.

Copy link
Member

Choose a reason for hiding this comment

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

Any tool that cares about conflicts should be using output-path like you suggested.

@jyn514
Copy link
Member

jyn514 commented Nov 28, 2021

All test outputs should be limited to the build directory.

Maybe it would be useful to write a tidy check for this?

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Nov 28, 2021
Change output path to {{build-base}} for rustdoc scrape_examples ui test

See rust-lang#90611 (comment)

r? `@jyn514`

cc `@petrochenkov`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-scrape-examples Area: The (unstable) rustdoc scrape-examples feature described in RFC 3123 C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ requires-nightly This issue requires a nightly compiler in some way. 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.

8 participants