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 x test --doc --stage 0 library/std #95993

Merged
merged 1 commit into from
Apr 16, 2022

Conversation

jyn514
Copy link
Member

@jyn514 jyn514 commented Apr 13, 2022

I managed to break this in #95449.
I am not quite sure why this is the correct fix, but it doesn't break doc --stage 0
and is strictly closer to the previous behavior.

Previously, rustdoc would error with strange issues because of the mismatched sysroot:

error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on
  --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5
   |
14 | use rustc_span::{sym, symbol::Ident, Span, Symbol};
   |     ^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so
           crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib

I managed to break this in rust-lang#95449.
I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0`
and is strictly closer to the previous behavior.

Previously, rustdoc would error with strange issues because of the mismatched sysroot:
```
error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on
  --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5
   |
14 | use rustc_span::{sym, symbol::Ident, Span, Symbol};
   |     ^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so
           crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib
```
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 13, 2022
@Mark-Simulacrum
Copy link
Member

Going to approve to get this unbroken, but I think there's two action items here: we should get these running in mingw-check or some other builder if they're too slow to verify they work in CI, and I suspect there's a missing --target argument to rustdoc which causes this when testing, probably because cross-compiling doctests is unusual. Something to look into at least.

@Mark-Simulacrum
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 13, 2022

📌 Commit 69de213 has been approved by Mark-Simulacrum

@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 Apr 13, 2022
@jyn514
Copy link
Member Author

jyn514 commented Apr 13, 2022

we should get these running in mingw-check or some other builder if they're too slow to verify they work in CI

👍 I can work on that sometime this week.

I suspect there's a missing --target argument to rustdoc which causes this when testing, probably because cross-compiling doctests is unusual

Note that none of this involved cross-compiling - I think the --target special-casing is related to build scripts and proc-macros. I don't quite understand why the rustc shim only passes the sysroot when it's present ... maybe it makes sense to unconditionally pass the sysroot, regardless of --test or --target or anything else? I'll try that locally and see what it breaks. Sorry for the mess here.

@Mark-Simulacrum
Copy link
Member

We always pass --target to cargo, and it should always pass it down to rustc/rustdoc (I would expect) for non-host compiles. (The target is the same as the "native" triple most of the time, but it is still passed).

The detection is used so that crates like build scripts link against the previous stages sysroot (e.g., beta or stage0) which is the "native" sysroot since std might not be available for the sysroot we would otherwise try to pass. (This is my recollection. It might be slightly off.)

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 14, 2022
…Simulacrum

Fix `x test --doc --stage 0 library/std`

I managed to break this in rust-lang#95449.
I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0`
and is strictly closer to the previous behavior.

Previously, rustdoc would error with strange issues because of the mismatched sysroot:
```
error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on
  --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5
   |
14 | use rustc_span::{sym, symbol::Ident, Span, Symbol};
   |     ^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so
           crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib
```
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Apr 15, 2022
…Simulacrum

Fix `x test --doc --stage 0 library/std`

I managed to break this in rust-lang#95449.
I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0`
and is strictly closer to the previous behavior.

Previously, rustdoc would error with strange issues because of the mismatched sysroot:
```
error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on
  --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5
   |
14 | use rustc_span::{sym, symbol::Ident, Span, Symbol};
   |     ^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so
           crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib
```
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 15, 2022
…Simulacrum

Fix `x test --doc --stage 0 library/std`

I managed to break this in rust-lang#95449.
I am not quite sure why this is the correct fix, but it doesn't break `doc --stage 0`
and is strictly closer to the previous behavior.

Previously, rustdoc would error with strange issues because of the mismatched sysroot:
```
error[E0460]: found possibly newer version of crate `std` which `rustc_span` depends on
  --> /home/jnelson/rust-lang/rust/compiler/rustc_lint_defs/src/lib.rs:14:5
   |
14 | use rustc_span::{sym, symbol::Ident, Span, Symbol};
   |     ^^^^^^^^^^
   |
   = note: perhaps that crate needs to be recompiled?
   = note: the following crate versions were found:
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.rlib
           crate `std`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-ff9290e971253a38.so
           crate `rustc_span`: /home/jnelson/rust-lang/rust/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_span-ed11dce30c1766f9.rlib
```
@jyn514
Copy link
Member Author

jyn514 commented Apr 16, 2022

@bors p=1 - this is breaking various things for local development

@bors
Copy link
Contributor

bors commented Apr 16, 2022

@jyn514: 🔑 Insufficient privileges: not in try users

@Mark-Simulacrum
Copy link
Member

@bors p=1

@bors
Copy link
Contributor

bors commented Apr 16, 2022

⌛ Testing commit 69de213 with merge 2fa9789...

@bors
Copy link
Contributor

bors commented Apr 16, 2022

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing 2fa9789 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 16, 2022
@bors bors merged commit 2fa9789 into rust-lang:master Apr 16, 2022
@rustbot rustbot added this to the 1.62.0 milestone Apr 16, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (2fa9789): comparison url.

Summary:

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 0 5 0
mean2 N/A N/A N/A -1.1% N/A
max N/A N/A N/A -1.2% N/A

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@jyn514 jyn514 deleted the fix-stage0-doctests branch April 16, 2022 21:11
@b-ncMN b-ncMN mentioned this pull request Jun 30, 2022
b-ncMN added a commit to b-ncMN/rust that referenced this pull request Jun 30, 2022
This reverts the temporary fix implemented by rust-lang#95993 since a permanent fix has been implemented by rust-lang/cargo#10594
bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 4, 2022
…Mark-Simulacrum

Revert rust-lang#95993 fix

This reverts the temporary fix implemented by rust-lang#95993 since a permanent fix has been implemented by rust-lang/cargo#10594

Fixes rust-lang#98728
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants