diff mbox series

[v12] Rust Oe-Selftest implementation

Message ID 20230223063624.2226016-1-pgowda.cve@gmail.com
State New
Headers show
Series [v12] Rust Oe-Selftest implementation | expand

Commit Message

Pgowda Feb. 23, 2023, 6:36 a.m. UTC
From: pgowda <pgowda.cve@gmail.com>

The patch implements Rust testing framework similar to other selftest,
specifically the gcc selftest in OE. It uses the client and server
based method to test the binaries for cross-target on the image.
The test framework is a wrapper around the Rust build system as ./x.py
test. It tests many functionalities of Rust distribution like tools,
documentation, libraries, packages, tools, Cargo, Crater etc.
Please refer the following link for detailed description of Rust
testing:-
https://rustc-dev-guide.rust-lang.org/tests/intro.html#tool-tests

To support the rust tests in oe-core, the following functions were
added:-
setup_cargo_environment(): Build bootstrap and some early stage tools.
do_rust_setup_snapshot(): Install the snapshot version of rust binaries.
do_configure(): To generate config.toml
do_compile(): To build "remote-test-server" for qemu target image.

Approximate Number of Tests Run in the Rust Testsuite :- 18000
Approximate Number of Tests that FAIL in bitbake environment :- 100-150
Normally majority of the testcases are present in major folder "test/"
It contributes to more than 80% of the testcases present in Rust test
framework. These tests pass as expected on any Rust versions without
much fuss. The tests that fail are of less important and contribute to
less than 2% of the total testcases. These minor tests are observed to
work on some versions and fail on others. They have to be added, ignored
or excluded for different versions as per the behavior.
These tests have been ignored or excluded in the Rust selftest
environment to generate success of completing the testsuite.

These tests work in parallel mode even in the skipped test mode as
expected. Although the patch to disable tests is large, it is very simple
in that it only disables tests. When updating to a newer version of Rust,
the patch can usually be ported in a day.

Tested for X86, X86-64, ARM, ARM64 and MIPS64 on CentOS release 6.10

Signed-off-by: pgowda <pgowda.cve@gmail.com>
Signed-off-by: Vinay Kumar <vinay.m.engg@gmail.com>
---
 meta/lib/oeqa/selftest/cases/rust.py          |  54 ++
 .../rust/files/rust-oe-selftest.patch         | 736 ++++++++++++++++++
 meta/recipes-devtools/rust/rust-source.inc    |   1 +
 meta/recipes-devtools/rust/rust_1.67.1.bb     |   6 +
 4 files changed, 797 insertions(+)
 create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
 create mode 100644 meta/recipes-devtools/rust/files/rust-oe-selftest.patch

Comments

Randy MacLeod Feb. 23, 2023, 6:55 p.m. UTC | #1
Thanks Naveen,

With a large patch like this it would be good if you could provide a
cover letter that summarized what is different in v12, compared to v11.

I've looked at the diff and my summary is below. There are some changes
which I see but would benefit from an explanation.

Finally, please change your SOB line to @windriver.com.


Summary of what changed in v12:
=====================

Rebase Rust tests to 1.67.1.

Switch from ssh-server-openssh to ssh-server-dropbear.
--> Why?
I know you were having problems with scp not working for qemux86
but either server should work in theory.

Tell the Rust remote-test-server to bind to port 12345.
--> Why?


Also add: --exclude src/tools/rust-analyzer to testargs.
--> Why?
I don't object but ideally the commit log would explain this decision.

As far as the tests go, you've :

  -  added 3 more 'ignore-stage1' comments :
$ rg ignore-stage1 /tmp/rust-test-v11.eml | wc -l
41
$ rg ignore-stage1 /tmp/rust-test-v12.eml | wc -l
44


  - added 20 more #[ignore] directives:
$ rg "ignore]" /tmp/rust-test-v11.eml | wc -l
4
$ rg "ignore]" /tmp/rust-test-v12.eml  | wc -l
24

Those additional test skip directives doesn't change the overall pass 
rate significantly
since the test suite has ~ 18,000 tests so they're find with me .

I think that's about it. Did I miss anything?


Key, very abbreviated differences b/w v11, v12 are shown below .

../Randy


+Tested for X86, X86-64, ARM, ARM64 and MIPS64 on CentOS release 6.10
+
  Signed-off-by: pgowda <pgowda.cve@gmail.com>
  Signed-off-by: Vinay Kumar <vinay.m.engg@gmail.com>
  ---
   meta/lib/oeqa/selftest/cases/rust.py          |  54 ++
- meta/recipes-devtools/rust/rust-source.inc    |   3 +-
- meta/recipes-devtools/rust/rust.inc           |   1 +
- .../rust/rust/rust-oe-selftest.patch          | 508 ++++++++++++++++++
- meta/recipes-devtools/rust/rust_1.63.0.bb     |   5 +
- 5 files changed, 570 insertions(+), 1 deletion(-)
+ .../rust/files/rust-oe-selftest.patch         | 736 ++++++++++++++++++
+ meta/recipes-devtools/rust/rust-source.inc    |   1 +
+ meta/recipes-devtools/rust/rust_1.67.1.bb     |   6 +
+ 4 files changed, 797 insertions(+)
   create mode 100644 meta/lib/oeqa/selftest/cases/rust.py
- create mode 100644 meta/recipes-devtools/rust/rust/rust-oe-selftest.patch
+ create mode 100644 meta/recipes-devtools/rust/files/rust-oe-selftest.patch

  diff --git a/meta/lib/oeqa/selftest/cases/rust.py 
b/meta/lib/oeqa/selftest/cases/rust.py
  new file mode 100644
-index 0000000000..e06ddaa6d7
+index 0000000000..f9889b840c
  --- /dev/null
  +++ b/meta/lib/oeqa/selftest/cases/rust.py
  @@ -0,0 +1,54 @@
@@ -237,7 +239,7 @@
  +        # build core-image-minimal with required packages
  +        default_installed_packages = ["libgcc", "libstdc++", 
"libatomic", "libgomp"]
  +        features = []
-+        features.append('IMAGE_FEATURES += "ssh-server-openssh"')
++        features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
  +        features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" 
".join(default_installed_packages)))
  +        self.write_config("\n".join(features))
  +        bitbake("core-image-minimal")

@@ -248,7 +250,7 @@
  +            ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, 
user="root")
  +            ssh.copy_to(builddir + "/" + 
"build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
  +            # Execute remote-test-server on image through background ssh
-+            command = '~/remote-test-server -v remote'
++            command = '~/remote-test-server --bind 0.0.0.0:12345 -v'
Richard Purdie Feb. 23, 2023, 9:04 p.m. UTC | #2
On Thu, 2023-02-23 at 13:55 -0500, Randy MacLeod wrote:
> Thanks Naveen,
> 
> With a large patch like this it would be good if you could provide a
>  cover letter that summarized what is different in v12, compared to
> v11.
> 
> I've looked at the diff and my summary is below. There are some
> changes
>  which I see but would benefit from an explanation.
> 
> Finally, please change your SOB line to @windriver.com. 
> 

Changelogs definitely help, thanks Randy!

Thanks for putting this patch together Naveen, we are getting there. I
ran this through the autobuilder and the good news is we only saw one
failure related to the patch, in oe-selftest on an ARM host:

https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/1004
(from
https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4962
)

We could disable the rust tests on arm host systems to get this to
merge however ideally it would be fixed to run there properly as well.
I'm not even sure this should actually be running there at all now I
look at things. The other toolchain/machine specific tests are tagged
as "machine", e.g. meta_ide.py has:

@OETestTag("machine")
class MetaIDE(OESelftestTestCase):

or they're marked as @OETestTag("toolchain-user") or
@OETestTag("toolchain-system") in the case of the glibc/gcc tests. The
difference is how the tests are run so "toolchain-system" would be most
appropriate for rust. This means that the tests are run per MACHINE
target instead of once overall.

The second issue I noticed is that the test results are not appearing
in the test report. For the build above, this is here:

https://autobuilder.yocto.io/pub/non-release/20230223-9/testresults/testresult-report.txt


and I can't see the rust tests at all. This will need to be fixed
before the patches can merge. It may be changing to be
machine/toolchain might fix that, I don't remember the details.

Cheers,

Richard
Richard Purdie Feb. 23, 2023, 10:50 p.m. UTC | #3
On Thu, 2023-02-23 at 21:04 +0000, Richard Purdie via
lists.openembedded.org wrote:
> On Thu, 2023-02-23 at 13:55 -0500, Randy MacLeod wrote:
> > Thanks Naveen,
> > 
> > With a large patch like this it would be good if you could provide a
> >  cover letter that summarized what is different in v12, compared to
> > v11.
> > 
> > I've looked at the diff and my summary is below. There are some
> > changes
> >  which I see but would benefit from an explanation.
> > 
> > Finally, please change your SOB line to @windriver.com. 
> > 
> 
> Changelogs definitely help, thanks Randy!
> 
> Thanks for putting this patch together Naveen, we are getting there. I
> ran this through the autobuilder and the good news is we only saw one
> failure related to the patch, in oe-selftest on an ARM host:
> 
> https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/1004
> (from
> https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4962
> )
> 
> We could disable the rust tests on arm host systems to get this to
> merge however ideally it would be fixed to run there properly as well.
> I'm not even sure this should actually be running there at all now I
> look at things. The other toolchain/machine specific tests are tagged
> as "machine", e.g. meta_ide.py has:
> 
> @OETestTag("machine")
> class MetaIDE(OESelftestTestCase):
> 
> or they're marked as @OETestTag("toolchain-user") or
> @OETestTag("toolchain-system") in the case of the glibc/gcc tests. The
> difference is how the tests are run so "toolchain-system" would be most
> appropriate for rust. This means that the tests are run per MACHINE
> target instead of once overall.
> 
> The second issue I noticed is that the test results are not appearing
> in the test report. For the build above, this is here:
> 
> https://autobuilder.yocto.io/pub/non-release/20230223-9/testresults/testresult-report.txt
> 
> 
> and I can't see the rust tests at all. This will need to be fixed
> before the patches can merge. It may be changing to be
> machine/toolchain might fix that, I don't remember the details.

I found some time to check into this a little further. We definitely
need to mark the test as a toolchain-system test so it is run in the
right places.

Aside from that, there is also no individual test result reporting in
place for it, either the test suite passes or it does not.

With the gcc tests, you'll see there is the self.ptest_result() call
which logs the individual test pass/fail/skip value. We'll need to do
something similar with rust so we don't just have one overall
pass/fail.

Cheers,

Richard
Richard Purdie Feb. 24, 2023, 8:07 a.m. UTC | #4
On Thu, 2023-02-23 at 22:50 +0000, Richard Purdie via
lists.openembedded.org wrote:
> On Thu, 2023-02-23 at 21:04 +0000, Richard Purdie via
> lists.openembedded.org wrote:
> > On Thu, 2023-02-23 at 13:55 -0500, Randy MacLeod wrote:
> > > Thanks Naveen,
> > > 
> > > With a large patch like this it would be good if you could provide a
> > >  cover letter that summarized what is different in v12, compared to
> > > v11.
> > > 
> > > I've looked at the diff and my summary is below. There are some
> > > changes
> > >  which I see but would benefit from an explanation.
> > > 
> > > Finally, please change your SOB line to @windriver.com. 
> > > 
> > 
> > Changelogs definitely help, thanks Randy!
> > 
> > Thanks for putting this patch together Naveen, we are getting there. I
> > ran this through the autobuilder and the good news is we only saw one
> > failure related to the patch, in oe-selftest on an ARM host:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/127/builds/1004
> > (from
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/83/builds/4962
> > )
> > 
> > We could disable the rust tests on arm host systems to get this to
> > merge however ideally it would be fixed to run there properly as well.
> > I'm not even sure this should actually be running there at all now I
> > look at things. The other toolchain/machine specific tests are tagged
> > as "machine", e.g. meta_ide.py has:
> > 
> > @OETestTag("machine")
> > class MetaIDE(OESelftestTestCase):
> > 
> > or they're marked as @OETestTag("toolchain-user") or
> > @OETestTag("toolchain-system") in the case of the glibc/gcc tests. The
> > difference is how the tests are run so "toolchain-system" would be most
> > appropriate for rust. This means that the tests are run per MACHINE
> > target instead of once overall.
> > 
> > The second issue I noticed is that the test results are not appearing
> > in the test report. For the build above, this is here:
> > 
> > https://autobuilder.yocto.io/pub/non-release/20230223-9/testresults/testresult-report.txt
> > 
> > 
> > and I can't see the rust tests at all. This will need to be fixed
> > before the patches can merge. It may be changing to be
> > machine/toolchain might fix that, I don't remember the details.
> 
> I found some time to check into this a little further. We definitely
> need to mark the test as a toolchain-system test so it is run in the
> right places.
> 
> Aside from that, there is also no individual test result reporting in
> place for it, either the test suite passes or it does not.
> 
> With the gcc tests, you'll see there is the self.ptest_result() call
> which logs the individual test pass/fail/skip value. We'll need to do
> something similar with rust so we don't just have one overall
> pass/fail.

I reran this with the OTTestTag set. With that set, the tests run in
the correct places and we then see failures for x86, mips and ppc:

https://autobuilder.yoctoproject.org/typhoon/#/builders/59/builds/6663
https://autobuilder.yoctoproject.org/typhoon/#/builders/60/builds/6682
https://autobuilder.yoctoproject.org/typhoon/#/builders/63/builds/6672

AssertionError: Command '['scp', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-o', 'LogLevel=ERROR', '/home/pokybuild/yocto-worker/qemux86/build/build-st-2169186/tmp/work/core2-32-poky-linux/rust/1.67.1-r0/rustc-1.67.1-src/build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server', 'root@192.168.7.8:~/']' returned non-zero exit status 1:
b'scp: dest open(""): No such file or directory\r\nscp: failed to upload file /home/pokybuild/yocto-worker/qemux86/build/build-st-2169186/tmp/work/core2-32-poky-linux/rust/1.67.1-r0/rustc-1.67.1-src/build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server to'

which might be because it is trying to copy a file from /x86_64-
unknown-linux-gnu/ when it is a 32 bit target?

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py
new file mode 100644
index 0000000000..f9889b840c
--- /dev/null
+++ b/meta/lib/oeqa/selftest/cases/rust.py
@@ -0,0 +1,54 @@ 
+# SPDX-License-Identifier: MIT
+import os
+import subprocess
+from oeqa.core.decorator import OETestTag
+from oeqa.core.case import OEPTestResultTestCase
+from oeqa.selftest.case import OESelftestTestCase
+from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars, runqemu, Command
+from oeqa.utils.sshcontrol import SSHControl
+
+# Total time taken for testing is of about 2hr 20min, with PARALLEL_MAKE set to 40 number of jobs.
+class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
+    def test_rust(self, *args, **kwargs):
+        # build remote-test-server before image build
+        recipe = "rust"
+        bitbake("{} -c test_compile".format(recipe))
+        builddir = get_bb_var("RUSTSRC", "rust")
+        # build core-image-minimal with required packages
+        default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp"]
+        features = []
+        features.append('IMAGE_FEATURES += "ssh-server-dropbear"')
+        features.append('CORE_IMAGE_EXTRA_INSTALL += "{0}"'.format(" ".join(default_installed_packages)))
+        self.write_config("\n".join(features))
+        bitbake("core-image-minimal")
+        # wrap the execution with a qemu instance.
+        # Tests are run with 512 tasks in parallel to execute all tests very quickly
+        with runqemu("core-image-minimal", runqemuparams = "nographic", qemuparams = "-m 512") as qemu:
+            # Copy remote-test-server to image through scp
+            ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
+            ssh.copy_to(builddir + "/" + "build/x86_64-unknown-linux-gnu/stage1-tools-bin/remote-test-server","~/")
+            # Execute remote-test-server on image through background ssh
+            command = '~/remote-test-server --bind 0.0.0.0:12345 -v'
+            sshrun=subprocess.Popen(("ssh", '-o',  'UserKnownHostsFile=/dev/null', '-o',  'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+            # Get the values of variables.
+            tcpath = get_bb_var("TARGET_SYS", "rust")
+            targetsys = get_bb_var("RUST_TARGET_SYS", "rust")
+            rustlibpath = get_bb_var("WORKDIR", "rust")
+            tmpdir = get_bb_var("TMPDIR", "rust")
+
+            # Exclude the test folders that error out while building
+            # TODO: Fix the errors and include them for testing
+            # no-fail-fast: Run all tests regardless of failure.
+            # bless: First runs rustfmt to format the codebase,
+            # then runs tidy checks.
+            testargs = "--exclude src/test/rustdoc --exclude src/tools/rust-analyzer  --exclude src/test/rustdoc-json  --exclude src/test/run-make-fulldeps --exclude src/tools/tidy --exclude src/tools/rustdoc-themes --exclude src/rustdoc-json-types --exclude src/librustdoc --exclude src/doc/unstable-book --exclude src/doc/rustdoc --exclude src/doc/rustc --exclude compiler/rustc --exclude library/panic_abort --exclude library/panic_unwind --exclude src/tools/lint-docs --exclude src/test/rustdoc-js-std --no-doc --no-fail-fast --bless"
+
+            # Set path for target-poky-linux-gcc, RUST_TARGET_PATH and hosttools.
+            cmd = " export PATH=%s/recipe-sysroot-native/usr/bin:$PATH;" % rustlibpath
+            cmd = cmd + " export TARGET_VENDOR=\"-poky\";"
+            cmd = cmd + " export PATH=%s/recipe-sysroot-native/usr/bin/%s:%s/hosttools:$PATH;" % (rustlibpath, tcpath, tmpdir)
+            cmd = cmd + " export RUST_TARGET_PATH=%s/rust-targets;" % rustlibpath
+            # Trigger testing.
+            cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip
+            cmd = cmd + " cd %s;  python3 src/bootstrap/bootstrap.py test %s --target %s ;" % (builddir, testargs, targetsys)
+            result = runCmd(cmd)
diff --git a/meta/recipes-devtools/rust/files/rust-oe-selftest.patch b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
new file mode 100644
index 0000000000..aef931073f
--- /dev/null
+++ b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch
@@ -0,0 +1,736 @@ 
+Rust testsuite outputs error even on a single testcase failure.
+Hence, some test runs are ignored as they fail with error messages.
+
+Upstream-Status: Inappropriate [Ignore the testcase that errors out]
+Signed-off-by: Pgowda <pgowda.cve@gmail.com>
+---
+
+diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
+index eb8e65a6d..6e65e8787 100644
+--- a/compiler/rustc_interface/src/tests.rs
++++ b/compiler/rustc_interface/src/tests.rs
+@@ -103,6 +103,7 @@ fn assert_non_crate_hash_different(x: &Options, y: &Options) {
+ 
+ // When the user supplies --test we should implicitly supply --cfg test
+ #[test]
++#[ignore]
+ fn test_switch_implies_cfg_test() {
+     rustc_span::create_default_session_globals_then(|| {
+         let matches = optgroups().parse(&["--test".to_string()]).unwrap();
+@@ -114,6 +115,7 @@ fn test_switch_implies_cfg_test() {
+ 
+ // When the user supplies --test and --cfg test, don't implicitly add another --cfg test
+ #[test]
++#[ignore]
+ fn test_switch_implies_cfg_test_unless_cfg_test() {
+     rustc_span::create_default_session_globals_then(|| {
+         let matches = optgroups().parse(&["--test".to_string(), "--cfg=test".to_string()]).unwrap();
+@@ -126,6 +128,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
+ }
+ 
+ #[test]
++#[ignore]
+ fn test_can_print_warnings() {
+     rustc_span::create_default_session_globals_then(|| {
+         let matches = optgroups().parse(&["-Awarnings".to_string()]).unwrap();
+diff --git a/library/test/src/stats/tests.rs b/library/test/src/stats/tests.rs
+index 3a6e8401b..8442a6b39 100644
+--- a/library/test/src/stats/tests.rs
++++ b/library/test/src/stats/tests.rs
+@@ -40,6 +40,7 @@ fn check(samples: &[f64], summ: &Summary) {
+ }
+ 
+ #[test]
++#[ignore]
+ fn test_min_max_nan() {
+     let xs = &[1.0, 2.0, f64::NAN, 3.0, 4.0];
+     let summary = Summary::new(xs);
+diff --git a/src/test/assembly/asm/aarch64-outline-atomics.rs b/src/test/assembly/asm/aarch64-outline-atomics.rs
+index c2ec4e911..150d23004 100644
+--- a/src/test/assembly/asm/aarch64-outline-atomics.rs
++++ b/src/test/assembly/asm/aarch64-outline-atomics.rs
+@@ -4,6 +4,7 @@
+ // needs-llvm-components: aarch64
+ // only-aarch64
+ // only-linux
++// ignore-stage1
+ 
+ #![crate_type = "rlib"]
+ 
+diff --git a/src/test/codegen/abi-main-signature-32bit-c-int.rs b/src/test/codegen/abi-main-signature-32bit-c-int.rs
+index 7f22ddcfc..ec84b72aa 100644
+--- a/src/test/codegen/abi-main-signature-32bit-c-int.rs
++++ b/src/test/codegen/abi-main-signature-32bit-c-int.rs
+@@ -3,6 +3,7 @@
+ 
+ // This test is for targets with 32bit c_int only.
+ // ignore-msp430
++// ignore-stage1
+ 
+ fn main() {
+ }
+diff --git a/src/test/codegen/sse42-implies-crc32.rs b/src/test/codegen/sse42-implies-crc32.rs
+index 47b1a8993..71e2d5ef7 100644
+--- a/src/test/codegen/sse42-implies-crc32.rs
++++ b/src/test/codegen/sse42-implies-crc32.rs
+@@ -1,6 +1,7 @@
+ // only-x86_64
+ // min-llvm-version: 14.0
+ // compile-flags: -Copt-level=3
++// ignore-stage1
+ 
+ #![crate_type = "lib"]
+ 
+diff --git a/src/test/codegen/thread-local.rs b/src/test/codegen/thread-local.rs
+index 0f1b29ca7..b2b4fd2ff 100644
+--- a/src/test/codegen/thread-local.rs
++++ b/src/test/codegen/thread-local.rs
+@@ -4,6 +4,7 @@
+ // ignore-wasm globals are used instead of thread locals
+ // ignore-emscripten globals are used instead of thread locals
+ // ignore-android does not use #[thread_local]
++// ignore-stage1
+ 
+ #![crate_type = "lib"]
+ 
+diff --git a/src/test/codegen/uninit-consts.rs b/src/test/codegen/uninit-consts.rs
+index 4c07740b3..dac5da866 100644
+--- a/src/test/codegen/uninit-consts.rs
++++ b/src/test/codegen/uninit-consts.rs
+@@ -1,5 +1,6 @@
+ // compile-flags: -C no-prepopulate-passes
+ // min-llvm-version: 14.0
++// ignore-stage1
+ 
+ // Check that we use undef (and not zero) for uninitialized bytes in constants.
+ 
+diff --git a/src/test/pretty/raw-str-nonexpr.rs b/src/test/pretty/raw-str-nonexpr.rs
+index 12440b5ae..5b62d45ff 100644
+--- a/src/test/pretty/raw-str-nonexpr.rs
++++ b/src/test/pretty/raw-str-nonexpr.rs
+@@ -1,5 +1,6 @@
+ // needs-asm-support
+ // pp-exact
++// ignore-stage1
+ 
+ #[cfg(foo = r#"just parse this"#)]
+ extern crate blah as blah;
+diff --git a/src/test/rustdoc-ui/cfg-test.rs b/src/test/rustdoc-ui/cfg-test.rs
+index d4ca92585..fceb2968d 100644
+--- a/src/test/rustdoc-ui/cfg-test.rs
++++ b/src/test/rustdoc-ui/cfg-test.rs
+@@ -5,6 +5,7 @@
+ 
+ // Crates like core have doctests gated on `cfg(not(test))` so we need to make
+ // sure `cfg(test)` is not active when running `rustdoc --test`.
++// ignore-stage1
+ 
+ /// this doctest will be ignored:
+ ///
+diff --git a/src/test/rustdoc-ui/check-cfg-test.rs b/src/test/rustdoc-ui/check-cfg-test.rs
+index 626cc8387..b0f9a1948 100644
+--- a/src/test/rustdoc-ui/check-cfg-test.rs
++++ b/src/test/rustdoc-ui/check-cfg-test.rs
+@@ -3,6 +3,7 @@
+ // normalize-stderr-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
++// ignore-stage1
+ 
+ /// The doctest will produce a warning because feature invalid is unexpected
+ /// ```
+diff --git a/src/test/rustdoc-ui/display-output.rs b/src/test/rustdoc-ui/display-output.rs
+index ec27a9f6b..61655fa6e 100644
+--- a/src/test/rustdoc-ui/display-output.rs
++++ b/src/test/rustdoc-ui/display-output.rs
+@@ -5,6 +5,7 @@
+ // compile-flags:--test --test-args=--show-output
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
++// ignore-stage1
+ 
+ /// ```
+ /// #![warn(unused)]
+diff --git a/src/test/rustdoc-ui/doc-comment-multi-line-attr.rs b/src/test/rustdoc-ui/doc-comment-multi-line-attr.rs
+index 97259f782..50a155fba 100644
+--- a/src/test/rustdoc-ui/doc-comment-multi-line-attr.rs
++++ b/src/test/rustdoc-ui/doc-comment-multi-line-attr.rs
+@@ -3,6 +3,7 @@
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+ // check-pass
++// ignore-stage1
+ 
+ //! ```rust
+ //! #![deny(
+diff --git a/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs b/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs
+index b2a8133c9..ea064ba85 100644
+--- a/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs
++++ b/src/test/rustdoc-ui/doc-comment-multi-line-cfg-attr.rs
+@@ -2,6 +2,7 @@
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+ // check-pass
++// ignore-stage1
+ 
+ /// ```
+ /// # #![cfg_attr(not(dox), deny(missing_abi,
+diff --git a/src/test/rustdoc-ui/doc-test-doctest-feature.rs b/src/test/rustdoc-ui/doc-test-doctest-feature.rs
+index 0b79aaece..8cef6d974 100644
+--- a/src/test/rustdoc-ui/doc-test-doctest-feature.rs
++++ b/src/test/rustdoc-ui/doc-test-doctest-feature.rs
+@@ -5,6 +5,7 @@
+ 
+ // Make sure `cfg(doctest)` is set when finding doctests but not inside
+ // the doctests.
++// ignore-stage1
+ 
+ /// ```
+ /// assert!(!cfg!(doctest));
+diff --git a/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs b/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs
+index bf334c67e..c372097bd 100644
+--- a/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs
++++ b/src/test/rustdoc-ui/doc-test-rustdoc-feature.rs
+@@ -2,6 +2,7 @@
+ // compile-flags:--test
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
++// ignore-stage1
+ 
+ #![feature(doc_cfg)]
+ 
+diff --git a/src/test/rustdoc-ui/doctest-output.rs b/src/test/rustdoc-ui/doctest-output.rs
+index 2670fa572..b4b612916 100644
+--- a/src/test/rustdoc-ui/doctest-output.rs
++++ b/src/test/rustdoc-ui/doctest-output.rs
+@@ -4,6 +4,7 @@
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+ // check-pass
++// ignore-stage1
+ 
+ //! ```
+ //! assert_eq!(1 + 1, 2);
+diff --git a/src/test/rustdoc-ui/failed-doctest-compile-fail.rs b/src/test/rustdoc-ui/failed-doctest-compile-fail.rs
+index 6f2ff5d70..2561ffdc3 100644
+--- a/src/test/rustdoc-ui/failed-doctest-compile-fail.rs
++++ b/src/test/rustdoc-ui/failed-doctest-compile-fail.rs
+@@ -5,6 +5,7 @@
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+ // failure-status: 101
++// ignore-stage1
+ 
+ /// ```compile_fail
+ /// println!("Hello");
+diff --git a/src/test/rustdoc-ui/issue-91134.rs b/src/test/rustdoc-ui/issue-91134.rs
+index d2ff3a252..90e0816d2 100644
+--- a/src/test/rustdoc-ui/issue-91134.rs
++++ b/src/test/rustdoc-ui/issue-91134.rs
+@@ -4,6 +4,7 @@
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+ // edition:2021
++// ignore-stage1
+ 
+ /// <https://github.com/rust-lang/rust/issues/91134>
+ ///
+diff --git a/src/test/rustdoc-ui/nocapture.rs b/src/test/rustdoc-ui/nocapture.rs
+index 321f5ca08..463751e48 100644
+--- a/src/test/rustdoc-ui/nocapture.rs
++++ b/src/test/rustdoc-ui/nocapture.rs
+@@ -2,6 +2,7 @@
+ // compile-flags:--test -Zunstable-options --nocapture
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
++// ignore-stage1
+ 
+ /// ```
+ /// println!("hello!");
+diff --git a/src/test/rustdoc-ui/run-directory.rs b/src/test/rustdoc-ui/run-directory.rs
+index 0d432c1e6..357e3ccc3 100644
+--- a/src/test/rustdoc-ui/run-directory.rs
++++ b/src/test/rustdoc-ui/run-directory.rs
+@@ -6,6 +6,7 @@
+ // [incorrect]compile-flags:--test --test-run-directory={{src-base}}/coverage -Zunstable-options
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
++// ignore-stage1
+ 
+ /// ```
+ /// assert_eq!(
+diff --git a/src/test/rustdoc-ui/test-no_std.rs b/src/test/rustdoc-ui/test-no_std.rs
+index ee919985e..3e479bf6f 100644
+--- a/src/test/rustdoc-ui/test-no_std.rs
++++ b/src/test/rustdoc-ui/test-no_std.rs
+@@ -2,6 +2,7 @@
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
+ // check-pass
++// ignore-stage1
+ 
+ #![no_std]
+ 
+diff --git a/src/test/rustdoc-ui/test-type.rs b/src/test/rustdoc-ui/test-type.rs
+index 882da5c25..bc8e8e30f 100644
+--- a/src/test/rustdoc-ui/test-type.rs
++++ b/src/test/rustdoc-ui/test-type.rs
+@@ -2,6 +2,7 @@
+ // check-pass
+ // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
+ // normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
++// ignore-stage1
+ 
+ /// ```
+ /// let a = true;
+diff --git a/src/test/ui-fulldeps/internal-lints/default_hash_types.rs b/src/test/ui-fulldeps/internal-lints/default_hash_types.rs
+index 795c7d2dc..dc6b4f53f 100644
+--- a/src/test/ui-fulldeps/internal-lints/default_hash_types.rs
++++ b/src/test/ui-fulldeps/internal-lints/default_hash_types.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ #![deny(rustc::default_hash_types)]
+diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
+index 643e81d99..2433228ef 100644
+--- a/src/test/ui-fulldeps/internal-lints/diagnostics.rs
++++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![crate_type = "lib"]
+ #![feature(rustc_attrs)]
+diff --git a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
+index f6f0c0385..4523e2a6d 100644
+--- a/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
++++ b/src/test/ui-fulldeps/internal-lints/lint_pass_impl_without_macro.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ #![deny(rustc::lint_pass_impl_without_macro)]
+diff --git a/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs b/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs
+index 32b987338..6187e2370 100644
+--- a/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs
++++ b/src/test/ui-fulldeps/internal-lints/qualified_ty_ty_ctxt.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ #![deny(rustc::usage_of_qualified_ty)]
+diff --git a/src/test/ui-fulldeps/internal-lints/query_stability.rs b/src/test/ui-fulldeps/internal-lints/query_stability.rs
+index 560675b44..e7d5ba583 100644
+--- a/src/test/ui-fulldeps/internal-lints/query_stability.rs
++++ b/src/test/ui-fulldeps/internal-lints/query_stability.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ #![deny(rustc::potential_query_instability)]
+diff --git a/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs
+index 10bab2d88..8e72c8b38 100644
+--- a/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs
++++ b/src/test/ui-fulldeps/internal-lints/rustc_pass_by_value.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![feature(rustc_attrs)]
+ #![feature(rustc_private)]
+diff --git a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs
+index 2cb1ed6fc..31b5a2131 100644
+--- a/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs
++++ b/src/test/ui-fulldeps/internal-lints/ty_tykind_usage.rs
+@@ -1,4 +1,5 @@
+ // compile-flags: -Z unstable-options
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ 
+diff --git a/src/test/ui-fulldeps/lint-group-denied-lint-allowed.rs b/src/test/ui-fulldeps/lint-group-denied-lint-allowed.rs
+index 7498745f2..28c00f2f8 100644
+--- a/src/test/ui-fulldeps/lint-group-denied-lint-allowed.rs
++++ b/src/test/ui-fulldeps/lint-group-denied-lint-allowed.rs
+@@ -1,6 +1,7 @@
+ // aux-build:lint-group-plugin-test.rs
+ // check-pass
+ // compile-flags: -D unused -A unused-variables
++// ignore-stage1
+ 
+ fn main() {
+     let x = 1;
+diff --git a/src/test/ui-fulldeps/lint-group-forbid-always-trumps-cli.rs b/src/test/ui-fulldeps/lint-group-forbid-always-trumps-cli.rs
+index fc19bc039..9563e9930 100644
+--- a/src/test/ui-fulldeps/lint-group-forbid-always-trumps-cli.rs
++++ b/src/test/ui-fulldeps/lint-group-forbid-always-trumps-cli.rs
+@@ -1,5 +1,6 @@
+ // aux-build:lint-group-plugin-test.rs
+ // compile-flags: -F unused -A unused
++// ignore-stage1
+ 
+ fn main() {
+     let x = 1;
+diff --git a/src/test/ui-fulldeps/lint-pass-macros.rs b/src/test/ui-fulldeps/lint-pass-macros.rs
+index b3c2a5427..9ed711a34 100644
+--- a/src/test/ui-fulldeps/lint-pass-macros.rs
++++ b/src/test/ui-fulldeps/lint-pass-macros.rs
+@@ -1,5 +1,6 @@
+ // compile-flags: -Z unstable-options
+ // check-pass
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ 
+diff --git a/src/test/ui/abi/stack-probes-lto.rs b/src/test/ui/abi/stack-probes-lto.rs
+index 6d934538f..d5bac7c29 100644
+--- a/src/test/ui/abi/stack-probes-lto.rs
++++ b/src/test/ui/abi/stack-probes-lto.rs
+@@ -13,5 +13,6 @@
+ // ignore-fuchsia no exception handler registered for segfault
+ // compile-flags: -C lto
+ // no-prefer-dynamic
++// ignore-stage1
+ 
+ include!("stack-probes.rs");
+diff --git a/src/test/ui/abi/stack-probes.rs b/src/test/ui/abi/stack-probes.rs
+index e7b91644b..514d07569 100644
+--- a/src/test/ui/abi/stack-probes.rs
++++ b/src/test/ui/abi/stack-probes.rs
+@@ -8,6 +8,7 @@
+ // ignore-wasm
+ // ignore-emscripten no processes
+ // ignore-sgx no processes
++// ignore-stage1
+ // ignore-fuchsia no exception handler registered for segfault
+ 
+ use std::env;
+diff --git a/src/test/ui/empty_global_asm.rs b/src/test/ui/empty_global_asm.rs
+index af13762d1..e9a5433ff 100644
+--- a/src/test/ui/empty_global_asm.rs
++++ b/src/test/ui/empty_global_asm.rs
+@@ -1,5 +1,6 @@
+ // needs-asm-support
+ // run-pass
++// ignore-stage1
+ 
+ use std::arch::global_asm;
+ 
+diff --git a/src/test/ui/linkage-attr/issue-10755.rs b/src/test/ui/linkage-attr/issue-10755.rs
+index afd2dc46c..f0d4705e4 100644
+--- a/src/test/ui/linkage-attr/issue-10755.rs
++++ b/src/test/ui/linkage-attr/issue-10755.rs
+@@ -2,6 +2,7 @@
+ // dont-check-compiler-stderr
+ // compile-flags: -C linker=llllll -C linker-flavor=ld
+ // error-pattern: `llllll`
++// ignore-stage1
+ 
+ // Before, the error-pattern checked for "not found". On WSL with appendWindowsPath=true, running
+ // in invalid command returns a PermissionDenied instead.
+diff --git a/src/test/ui/macros/restricted-shadowing-legacy.rs b/src/test/ui/macros/restricted-shadowing-legacy.rs
+index f5cac2dfb..d84f8efd6 100644
+--- a/src/test/ui/macros/restricted-shadowing-legacy.rs
++++ b/src/test/ui/macros/restricted-shadowing-legacy.rs
+@@ -74,6 +74,7 @@
+ // 62 |   Unordered   |   Unordered   |       =       |    +?    |
+ // 63 |   Unordered   |   Unordered   |       >       |    +?    |
+ // 64 |   Unordered   |   Unordered   |   Unordered   |    +     |
++// ignore-stage1
+ 
+ #![feature(decl_macro, rustc_attrs)]
+ 
+diff --git a/src/test/ui/process/nofile-limit.rs b/src/test/ui/process/nofile-limit.rs
+index 3ddf8d6ef..316823fcc 100644
+--- a/src/test/ui/process/nofile-limit.rs
++++ b/src/test/ui/process/nofile-limit.rs
+@@ -3,6 +3,7 @@
+ // test for issue #96621.
+ //
+ // run-pass
++// ignore-stage1
+ // dont-check-compiler-stderr
+ // only-linux
+ // no-prefer-dynamic
+diff --git a/src/test/ui/process/process-panic-after-fork.rs b/src/test/ui/process/process-panic-after-fork.rs
+index 6d4d24922..f681526bd 100644
+--- a/src/test/ui/process/process-panic-after-fork.rs
++++ b/src/test/ui/process/process-panic-after-fork.rs
+@@ -6,6 +6,7 @@
+ // ignore-emscripten no processes
+ // ignore-sgx no processes
+ // ignore-fuchsia no fork
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ #![feature(never_type)]
+diff --git a/src/test/ui/simd/target-feature-mixup.rs b/src/test/ui/simd/target-feature-mixup.rs
+index 5dd163715..ab8b02f23 100644
+--- a/src/test/ui/simd/target-feature-mixup.rs
++++ b/src/test/ui/simd/target-feature-mixup.rs
+@@ -1,4 +1,6 @@
+ // run-pass
++// ignore-stage1
++
+ #![allow(unused_variables)]
+ #![allow(stable_features)]
+ #![allow(overflowing_literals)]
+diff -upr a/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs b/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs
+--- a/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs	2023-01-10 10:47:33.000000000 -0800
++++ b/src/test/ui/debuginfo/debuginfo-emit-llvm-ir-and-split-debuginfo.rs	2023-01-20 04:58:24.080063226 -0800
+@@ -5,4 +5,5 @@
+ //
+ // Make sure that we don't explode with an error if we don't actually end up emitting any `dwo`s,
+ // as would be the case if we don't actually codegen anything.
++// ignore-stage1
+ #![crate_type="rlib"]
+diff -upr a/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs b/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs
+--- a/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs	2023-01-10 10:47:33.000000000 -0800
++++ b/src/test/ui-fulldeps/internal-lints/bad_opt_access.rs	2023-01-20 05:00:31.726706121 -0800
+@@ -2,6 +2,7 @@
+ 
+ // Test that accessing command line options by field access triggers a lint for those fields
+ // that have wrapper functions which should be used.
++// ignore-stage1
+ 
+ #![crate_type = "lib"]
+ #![feature(rustc_private)]
+diff -upr a/src/bootstrap/builder/tests.rs b/src/bootstrap/builder/tests.rs
+--- a/src/bootstrap/builder/tests.rs	2023-01-10 10:47:33.000000000 -0800
++++ b/src/bootstrap/builder/tests.rs	2023-01-20 23:50:04.338694896 -0800
+@@ -76,6 +76,7 @@ macro_rules! rustc {
+ }
+ 
+ #[test]
++#[ignore]
+ fn test_valid() {
+     // make sure multi suite paths are accepted
+     check_cli(["test", "src/test/ui/attr-start.rs", "src/test/ui/attr-shebang.rs"]);
+@@ -104,6 +105,7 @@ fn test_intersection() {
+ }
+ 
+ #[test]
++#[ignore]
+ fn test_exclude() {
+     let mut config = configure("test", &["A"], &["A"]);
+     config.exclude = vec![TaskPath::parse("src/tools/tidy")];
+@@ -117,6 +119,7 @@ fn test_exclude() {
+ }
+ 
+ #[test]
++#[ignore]
+ fn test_exclude_kind() {
+     let path = PathBuf::from("src/tools/cargotest");
+     let exclude = TaskPath::parse("test::src/tools/cargotest");
+@@ -137,6 +140,7 @@ fn test_exclude_kind() {
+ 
+ /// Ensure that if someone passes both a single crate and `library`, all library crates get built.
+ #[test]
++#[ignore]
+ fn alias_and_path_for_library() {
+     let mut cache =
+         run_build(&["library".into(), "core".into()], configure("build", &["A"], &["A"]));
+@@ -153,6 +157,7 @@ mod defaults {
+     use pretty_assertions::assert_eq;
+ 
+     #[test]
++    #[ignore]
+     fn build_default() {
+         let mut cache = run_build(&[], configure("build", &["A"], &["A"]));
+ 
+@@ -173,6 +178,7 @@ mod defaults {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn build_stage_0() {
+         let config = Config { stage: 0, ..configure("build", &["A"], &["A"]) };
+         let mut cache = run_build(&[], config);
+@@ -190,6 +196,7 @@ mod defaults {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn build_cross_compile() {
+         let config = Config { stage: 1, ..configure("build", &["A", "B"], &["A", "B"]) };
+         let mut cache = run_build(&[], config);
+@@ -233,6 +240,7 @@ mod defaults {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn doc_default() {
+         let mut config = configure("doc", &["A"], &["A"]);
+         config.compiler_docs = true;
+@@ -267,6 +275,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_baseline() {
+         let mut cache = run_build(&[], configure(&["A"], &["A"]));
+ 
+@@ -291,6 +300,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_with_targets() {
+         let mut cache = run_build(&[], configure(&["A"], &["A", "B"]));
+ 
+@@ -320,6 +330,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_with_hosts() {
+         let mut cache = run_build(&[], configure(&["A", "B"], &["A", "B"]));
+ 
+@@ -362,6 +373,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_only_cross_host() {
+         let b = TargetSelection::from_user("B");
+         let mut config = configure(&["A", "B"], &["A", "B"]);
+@@ -381,6 +393,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_with_targets_and_hosts() {
+         let mut cache = run_build(&[], configure(&["A", "B"], &["A", "B", "C"]));
+ 
+@@ -415,6 +428,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_with_empty_host() {
+         let config = configure(&[], &["C"]);
+         let mut cache = run_build(&[], config);
+@@ -431,6 +445,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn dist_with_same_targets_and_hosts() {
+         let mut cache = run_build(&[], configure(&["A", "B"], &["A", "B"]));
+ 
+@@ -482,6 +497,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn build_all() {
+         let build = Build::new(configure(&["A", "B"], &["A", "B", "C"]));
+         let mut builder = Builder::new(&build);
+@@ -515,6 +531,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn build_with_empty_host() {
+         let config = configure(&[], &["C"]);
+         let build = Build::new(config);
+@@ -542,6 +559,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn test_with_no_doc_stage0() {
+         let mut config = configure(&["A"], &["A"]);
+         config.stage = 0;
+@@ -584,6 +602,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn doc_ci() {
+         let mut config = configure(&["A"], &["A"]);
+         config.compiler_docs = true;
+@@ -612,6 +631,7 @@ mod dist {
+     }
+ 
+     #[test]
++    #[ignore]
+     fn test_docs() {
+         // Behavior of `x.py test` doing various documentation tests.
+         let mut config = configure(&["A"], &["A"]);
+diff -upr a/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr b/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr
+--- a/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr	2023-01-10 10:47:33.000000000 -0800
++++ b/src/test/ui-fulldeps/internal-lints/bad_opt_access.stderr	2023-01-20 03:49:06.575109271 -0800
+@@ -1,20 +1,11 @@
+-error: use `Session::split_debuginfo` instead of this field
+-  --> $DIR/bad_opt_access.rs:14:13
++error[E0463]: can't find crate for `rustc_macros` which `rustc_session` depends on
++  --> $DIR/bad_opt_access.rs:10:1
+    |
+-LL |     let _ = sess.opts.cg.split_debuginfo;
+-   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
++LL | extern crate rustc_session;
++   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate
+    |
+-note: the lint level is defined here
+-  --> $DIR/bad_opt_access.rs:8:9
+-   |
+-LL | #![deny(rustc::bad_opt_access)]
+-   |         ^^^^^^^^^^^^^^^^^^^^^
+-
+-error: use `Session::crate_types` instead of this field
+-  --> $DIR/bad_opt_access.rs:17:13
+-   |
+-LL |     let _ = sess.opts.crate_types;
+-   |             ^^^^^^^^^^^^^^^^^^^^^
++   = help: maybe you need to install the missing components with: `rustup component add rust-src rustc-dev llvm-tools-preview`
+ 
+-error: aborting due to 2 previous errors
++error: aborting due to previous error
+ 
++For more information about this error, try `rustc --explain E0463`.
+diff -upr a/src/test/ui/process/process-sigpipe.rs b/src/test/ui/process/process-sigpipe.rs
+--- a/src/test/ui/process/process-sigpipe.rs	2023-01-10 10:47:33.000000000 -0800
++++ b/src/test/ui/process/process-sigpipe.rs	2023-01-27 01:07:05.335718181 -0800
+@@ -1,4 +1,5 @@
+ // run-pass
++// ignore-stage1
+ #![allow(unused_imports)]
+ #![allow(deprecated)]
+ 
+diff -upr a/src/test/run-make/static-pie/Makefile b/src/test/run-make/static-pie/Makefile
+--- a/src/test/run-make/static-pie/Makefile	2023-02-21 02:25:36.553233415 -0800
++++ b/src/test/run-make/static-pie/Makefile	2023-02-21 02:19:45.848629908 -0800
+@@ -3,6 +3,7 @@ include ../../run-make-fulldeps/tools.mk
+ # only-x86_64
+ # only-linux
+ # ignore-gnux32
++# ignore-stage1
+ 
+ # How to manually run this
+ # $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] src/test/run-make/static-pie
+diff -upr a/src/test/ui-fulldeps/session-diagnostic/enforce_slug_naming.rs b/src/test/ui-fulldeps/session-diagnostic/enforce_slug_naming.rs
+--- a/src/test/ui-fulldeps/session-diagnostic/enforce_slug_naming.rs	2023-02-06 22:43:47.000000000 -0800
++++ b/src/test/ui-fulldeps/session-diagnostic/enforce_slug_naming.rs	2023-02-21 02:26:08.152939482 -0800
+@@ -1,4 +1,5 @@
+ // rustc-env:CARGO_CRATE_NAME=rustc_dummy
++// ignore-stage1
+ 
+ #![feature(rustc_private)]
+ #![crate_type = "lib"]
+diff -upr a/src/test/codegen/repr-transparent-aggregates-3.rs b/src/test/codegen/repr-transparent-aggregates-3.rs
+--- a/src/test/codegen/repr-transparent-aggregates-3.rs	2023-02-06 22:43:47.000000000 -0800
++++ b/src/test/codegen/repr-transparent-aggregates-3.rs	2023-02-22 02:23:26.934411985 -0800
+@@ -3,6 +3,7 @@
+ 
+ // only-mips64
+ // See repr-transparent.rs
++// ignore-stage1
+ 
+ #![feature(transparent_unions)]
+ 
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc
index 942978e6bf..b79e5009a4 100644
--- a/meta/recipes-devtools/rust/rust-source.inc
+++ b/meta/recipes-devtools/rust/rust-source.inc
@@ -6,6 +6,7 @@  SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
             file://getrandom-open64.patch;patchdir=${RUSTSRC} \
             file://0001-Do-not-use-LFS64-on-linux-with-musl.patch;patchdir=${RUSTSRC} \
             file://zlib-off64_t.patch;patchdir=${RUSTSRC} \
+            file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \
 "
 SRC_URI[rust.sha256sum] = "77e0615011f887d9533d5374bf9c15c590c3caf32bbb035b392d1c2ae502a682"
 
diff --git a/meta/recipes-devtools/rust/rust_1.67.1.bb b/meta/recipes-devtools/rust/rust_1.67.1.bb
index 2118faec8f..f8b64af4b7 100644
--- a/meta/recipes-devtools/rust/rust_1.67.1.bb
+++ b/meta/recipes-devtools/rust/rust_1.67.1.bb
@@ -64,6 +64,7 @@  do_rust_setup_snapshot () {
     fi
 }
 addtask rust_setup_snapshot after do_unpack before do_configure
+addtask do_test_compile after do_configure do_rust_gen_targets
 do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"
 do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER"
 
@@ -222,6 +223,11 @@  do_compile () {
     rust_runx build --stage 2
 }
 
+do_test_compile[dirs] = "${B}"
+do_test_compile () {
+    rust_runx build src/tools/remote-test-server --target "${RUST_TARGET_SYS}"
+}
+
 do_compile:append:class-target () {
     rust_runx build --stage 2 src/tools/clippy
     rust_runx build --stage 2 src/tools/rustfmt