Skip to content

rustdoc-gui: allow running on Windows #112562

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Jun 15, 2023
Merged

Conversation

klensy
Copy link
Contributor

@klensy klensy commented Jun 12, 2023

This adds few fixes to allow running python x.py test rustdoc-gui on Windows.

  • path to npm required to be npm.cmd on Windows (otherwise don't work for me)
  • properly parse node module version on Windows
  • properly provide path to browser-ui-test runner (fixed in Fix rustdoc-gui tests on Windows #112613)

r? @GuillaumeGomez

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jun 12, 2023
.find_map(|l| l.split(':').nth(1)?.strip_prefix("browser-ui-test@"))
.find_map(|l| l.rsplit(':').next()?.strip_prefix("browser-ui-test@"))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Consider windows path C:\\proj\\rust\\node_modules\\browser-ui-test:browser-ui-test@0.16.6: in that case split will find wrong part of string.

@klensy
Copy link
Contributor Author

klensy commented Jun 12, 2023

Some help required here:

"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error",

This on windows will be like C:\proj\rust\build\x86_64-pc-windows-msvc\test\rustdoc-gui\doc and later converted to C:/projust%08uild%C2%86_64-pc-windows-msvcestustdoc-guidoc, wrongly processing escapes. Can this be fixed on js side?

@GuillaumeGomez
Copy link
Member

Nice thanks! r=me once CI pass.

@GuillaumeGomez
Copy link
Member

Some help required here:

"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error",

This on windows will be like C:\proj\rust\build\x86_64-pc-windows-msvc\test\rustdoc-gui\doc and later converted to C:/projust%08uild%C2%86_64-pc-windows-msvcestustdoc-guidoc, wrongly processing escapes. Can this be fixed on js side?

Oh interesting. I need to check if it's something done wrong in src/tools/rustdoc-gui/tester.js or directly into browser-ui-test. I'll do that in the next hours.

@klensy
Copy link
Contributor Author

klensy commented Jun 12, 2023

Added little more info to error description when calling npm, previously error was silently skipped.

@klensy
Copy link
Contributor Author

klensy commented Jun 15, 2023

@rustbot ready #112613 merged

@GuillaumeGomez
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 15, 2023

📌 Commit 4e628a5 has been approved by GuillaumeGomez

It is now in the queue for this repository.

@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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 15, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 15, 2023
…iaskrgr

Rollup of 6 pull requests

Successful merges:

 - rust-lang#111212 (Add casting suggestion when assigning negative 2's complement bin or hex literal to a size compatible signed integer)
 - rust-lang#112304 (Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour)
 - rust-lang#112486 (Fix suggestion for E0404 not dealing with multiple generics)
 - rust-lang#112562 (rustdoc-gui: allow running on Windows)
 - rust-lang#112621 (Mention `env!` in `option_env!`'s docs)
 - rust-lang#112634 (add InlineConst check)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9fe4630 into rust-lang:master Jun 15, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 15, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

4 participants