Skip to content

Don't emit shared files when scraping examples from dependencies in Rustdoc - #92146

Merged
bors merged 1 commit into
rust-lang:masterfrom
willcrichton:example-analyzer
Dec 23, 2021
Merged

Don't emit shared files when scraping examples from dependencies in Rustdoc#92146
bors merged 1 commit into
rust-lang:masterfrom
willcrichton:example-analyzer

Conversation

@willcrichton

Copy link
Copy Markdown
Contributor

This PR fixes#91605. The issue is that Context::init gets called when scraping dependencies. By default, just calling init calls into write_shared and build_index which register the scraped crate into a list that later gets used for the Rustdoc sidebar. The fix is to ensure that write_shared is not called when scraping.

r? @jyn514

@rustbotrustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Dec 21, 2021
@rust-highfiverust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 21, 2021
@jyn514

Copy link
Copy Markdown
Member

This seems kind of hacky ... eventually I'd like to separate actually generating the HTML from creating the Context. But this is reasonable as a short term fix.

r=me if you don't feel like refactoring half of rustdoc 😁

@bors delegate=willcrichton

@bors

bors commented Dec 21, 2021

Copy link
Copy Markdown
Collaborator

✌️ @willcrichton can now approve this pull request

@jyn514jyn514 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 Dec 21, 2021
@willcrichton

Copy link
Copy Markdown
ContributorAuthor

@bors r=jyn514

@bors

bors commented Dec 21, 2021

Copy link
Copy Markdown
Collaborator

📌 Commit b7de797 has been approved by jyn514

@borsbors 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 Dec 21, 2021
@bors

bors commented Dec 21, 2021

Copy link
Copy Markdown
Collaborator

⌛ Testing commit b7de797 with merge 695c53cca37057a9e61db16840932e68adf7acf6...

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-mingw-1 failed! Check out the build log: (web)(plain)

Click to see the possible cause of the failure (guessed by this bot)

failures:
---- process::tests::test_interior_nul_in_arg_is_error stdout ----
thread 'process::tests::test_interior_nul_in_arg_is_error' panicked at 'assertion failed: `(left == right)`
left: `NotFound`,
right: `InvalidInput`', library\std\src\process\tests.rs:309:19
---- process::tests::test_interior_nul_in_args_is_error stdout ----
thread 'process::tests::test_interior_nul_in_args_is_error' panicked at 'assertion failed: `(left == right)`
left: `NotFound`,
left: `NotFound`,
right: `InvalidInput`', library\std\src\process\tests.rs:317:19
---- process::tests::test_interior_nul_in_current_dir_is_error stdout ----
thread 'process::tests::test_interior_nul_in_current_dir_is_error' panicked at 'assertion failed: `(left == right)`
left: `NotFound`,
left: `NotFound`,
right: `InvalidInput`', library\std\src\process\tests.rs:325:19
---- sys::windows::process::tests::windows_exe_resolver stdout ----
---- sys::windows::process::tests::windows_exe_resolver stdout ----
thread 'sys::windows::process::tests::windows_exe_resolver' panicked at 'assertion failed: resolve_exe(OsStr::new(\"rustc\"), child_paths).is_ok()', library\std\src\sys\windows\process\tests.rs:174:5
failures:
process::tests::test_interior_nul_in_arg_is_error
process::tests::test_interior_nul_in_args_is_error
process::tests::test_interior_nul_in_args_is_error
process::tests::test_interior_nul_in_current_dir_is_error
sys::windows::process::tests::windows_exe_resolver
test result: FAILED. 879 passed; 4 failed; 3 ignored; 0 measured; 0 filtered out; finished in 13.90s
error: test failed, to rerun pass '-p std --lib'
command did not execute successfully: "\\\\?\\D:\\a\\rust\\rust\\build\\x86_64-pc-windows-gnu\\stage0\\bin\\cargo.exe" "test" "--target" "x86_64-pc-windows-gnu" "-Zbinary-dep-depinfo" "-j" "8" "--release" "--locked" "--color" "always" "--features" "panic-unwind backtrace profiler compiler-builtins-c" "--manifest-path" "D:\\a\\rust\\rust\\library/test/Cargo.toml" "-p" "std" "--"
Build completed unsuccessfully in 0:52:02
Build completed unsuccessfully in 0:52:02
make: *** [Makefile:80: ci-mingw-subset-1] Error 1

@bors

bors commented Dec 22, 2021

Copy link
Copy Markdown
Collaborator

💔 Test failed - checks-actions

@borsbors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Dec 22, 2021
@ehuss

Copy link
Copy Markdown
Contributor

@bors retry

Windows test_interior_nul issue

@borsbors 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-review Status: Awaiting review from the assignee but also interested parties. labels Dec 22, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 23, 2021
…askrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#88858 (Allow reverse iteration of lowercase'd/uppercase'd chars)
- rust-lang#91544 (Fix duplicate derive clone suggestion)
- rust-lang#92026 (Add some JSDoc comments to rustdoc JS)
- rust-lang#92117 (kmc-solid: Add `std::sys::solid::fs::File::read_buf`)
- rust-lang#92139 (Change Backtrace::enabled atomic from SeqCst to Relaxed)
- rust-lang#92146 (Don't emit shared files when scraping examples from dependencies in Rustdoc)
- rust-lang#92208 (Quote bat script command line)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 051d91a into rust-lang:masterDec 23, 2021
@rustbotrustbot added this to the 1.59.0 milestone Dec 23, 2021
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-rustdocRelevant 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.

rustdoc-scrape-examples creates dead links and suppresses --no-deps

7 participants

@willcrichton@jyn514@bors@rust-log-analyzer@ehuss@rust-highfive@rustbot