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

Diff on rustdoc test failure does not work on Windows #82409

Closed
rylev opened this issue Feb 22, 2021 · 4 comments · Fixed by #82469
Closed

Diff on rustdoc test failure does not work on Windows #82409

rylev opened this issue Feb 22, 2021 · 4 comments · Fixed by #82469
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@rylev
Copy link
Member

rylev commented Feb 22, 2021

When running x .py test .\src\test\rustdoc on Linux and a failure happens, a really nice diff of the output vs rustdoc-nightly is produced which very clearly shows the issue. This does not work on Windows for multiple reasons.

One the call to diff fails:

info: generating a diff against nightly rustdoc
warning: no pager configured, falling back to `diff --color`
help: try configuring a git pager (e.g. `delta`) with `git config --global core.pager delta`
thread '[rustdoc] rustdoc\sidebar-link-generation.rs' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 2, kind: NotFound, message: "The system cannot find the file specified." }', src\tools\compiletest\src\runtest.rs:2467:55

Second, the output from rustdoc-nightly seems to exactly match that from the local compiler making it not possible to do manual diffs.

@rylev rylev added the C-bug Category: This is a bug. label Feb 22, 2021
@jyn514
Copy link
Member

jyn514 commented Feb 22, 2021

One the call to diff fails:

How do you diff directories recursively on Windows? On Linux I would be very surprised for diff not to be installed.

The output from rustdoc-nightly seems to exactly match that from the local compiler

Oh I just thought of something - do you have a rustup overide that defaults to your local toolchain? Right now compiletest assumes the default is nightly, I've been meaning to change it.

@rylev
Copy link
Member Author

rylev commented Feb 22, 2021

do you have a rustup overide that defaults to your local toolchain?

No, I only set overrides on specific projects (and rust-lang/rust is not one of them). My default is the stable compiler.

@jyn514 jyn514 added A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-testsuite Area: The testsuite used to check the correctness of rustc O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Feb 22, 2021
@mati865
Copy link
Contributor

mati865 commented Feb 23, 2021

Git for Windows provides diff:

$ which diff
/usr/bin/diff

Are you building Rust using Git Bash prompt?

@rylev
Copy link
Member Author

rylev commented Feb 23, 2021

I don't think it'd be a good idea to require testing rustdoc in the Git for Windows bash shell. I'd like for this to work in cmd.exe and PowerShell if possible.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 2, 2021
…k-Simulacrum

Use a crate to produce rustdoc tree comparisons instead of the `diff` command

It doesn't come with Windows, so bring [our own](https://github.com/notriddle/rust-unified-diff/).

Fixes rust-lang#82409

![image](https://user-images.githubusercontent.com/1593513/109230755-9a1d5700-7782-11eb-8359-353a506875ab.png)
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this issue Mar 3, 2021
…k-Simulacrum

Use a crate to produce rustdoc tree comparisons instead of the `diff` command

It doesn't come with Windows, so bring [our own](https://github.com/notriddle/rust-unified-diff/).

Fixes rust-lang#82409

![image](https://user-images.githubusercontent.com/1593513/109230755-9a1d5700-7782-11eb-8359-353a506875ab.png)
JohnTitor added a commit to JohnTitor/rust that referenced this issue Mar 3, 2021
…k-Simulacrum

Use a crate to produce rustdoc tree comparisons instead of the `diff` command

It doesn't come with Windows, so bring [our own](https://github.com/notriddle/rust-unified-diff/).

Fixes rust-lang#82409

![image](https://user-images.githubusercontent.com/1593513/109230755-9a1d5700-7782-11eb-8359-353a506875ab.png)
@bors bors closed this as completed in b29d9d5 Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows Operating system: Windows T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants