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

x.py test --stage 0 src/test/ui should give an error #77711

Closed
jyn514 opened this issue Oct 8, 2020 · 2 comments · Fixed by #77776
Closed

x.py test --stage 0 src/test/ui should give an error #77711

jyn514 opened this issue Oct 8, 2020 · 2 comments · Fixed by #77776
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-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Comments

@jyn514
Copy link
Member

jyn514 commented Oct 8, 2020

Consider someone working with the standard library and running a UI test for the first time. Their workflow up until now has been

x.py test --stage 0 library/std

This is correct: it builds the standard library once and the compiler zero times. Any changes they make will be reflected in the tests.
Now assume for some reason they have to run a UI test; maybe they change a rustc_on_unimplemented diagnostic so the .stderr files need to change. They've been using --stage 0 so far, and they really don't want to build the compiler, so they try the same thing on the new test suite:

x.py test --stage 0 src/test/ui

This is incorrect: it builds neither the standard library nor the compiler and runs tests on beta instead.
Unfortunately, the errors this gives are incomprehensible: they say things like

-    LL | impl<T: Copy> Foo<T> {
-       |       ^^^^^^
+    LL | impl<T: std::marker::Copy> Foo<T> {
+       |       ^^^^^^^^^^^^^^^^^^^

which give absolutely no indication that you're running the wrong version of the compiler (maybe you'd even think it's caused by your change!)

Instead, x.py should give an error like this:

$ x.py test --stage 0 src/test/ui
error: `--stage 0` is not meaningful for compiletest test suites
help: use `--stage 1` instead
note: if you're sure you want to do this, please open an issue as to why. In the meantime, you can override this with `COMPILETEST_FORCE_STAGE_0=1`.
@jyn514 jyn514 added A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) C-feature-request Category: A feature request, i.e: not implemented / a PR. A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself labels Oct 8, 2020
@jyn514
Copy link
Member Author

jyn514 commented Oct 8, 2020

@Mark-Simulacrum
Copy link
Member

I think it should use the new std but a beta compiler, though regardless it won't work. Error message seems good!

JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 13, 2020
 Give an error when running `x.py test --stage 0 src/test/ui`

The error can be overridden with `COMPILETEST_FORCE_STAGE0=1`. In practice I don't know why anyone would do this.

r? @Mark-Simulacrum

Closes rust-lang#77711
JohnTitor added a commit to JohnTitor/rust that referenced this issue Oct 13, 2020
 Give an error when running `x.py test --stage 0 src/test/ui`

The error can be overridden with `COMPILETEST_FORCE_STAGE0=1`. In practice I don't know why anyone would do this.

r? @Mark-Simulacrum

Closes rust-lang#77711
@bors bors closed this as completed in fe7e794 Oct 14, 2020
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-feature-request Category: A feature request, i.e: not implemented / a PR. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants