Skip to content

Teach bootstrap test/doc plumbing to handle an initial stdarch workspace subset#153951

Closed
mnmn-f wants to merge 1 commit intorust-lang:mainfrom
mnmn-f:codex/stdarch-bootstrap-step
Closed

Teach bootstrap test/doc plumbing to handle an initial stdarch workspace subset#153951
mnmn-f wants to merge 1 commit intorust-lang:mainfrom
mnmn-f:codex/stdarch-bootstrap-step

Conversation

@mnmn-f
Copy link

@mnmn-f mnmn-f commented Mar 16, 2026

Summary

This is an initial step toward porting the stdarch test suite into the main repo as part of the GSoC project.

It teaches bootstrap to recognize library/stdarch as an additional in-tree workspace and hooks a deterministic subset of its tests into the existing test/doc plumbing. Instead of adding new, standalone steps, this version integrates stdarch directly into the current x test / x doc flow.

The initial scope is restricted to:

  • core_arch
  • stdarch_examples

Zulip discussion: https://rust-lang.zulipchat.com/#narrow/channel/421156-gsoc/topic/Idea.3A.20Port.20.60std.3A.3Aarch.60.20test.20suite.20to.20.60rust-lang.2Frust.60

Motivation

Even though library/stdarch is already in-tree via the Josh subtree, bootstrap still treats the standard library as a single-workspace setup driven from library/Cargo.toml. This means stdarch crates aren't naturally discovered or routed during x test.

This patch provides a "bootstrap-native" way to bring these tests over. The goal is to start with a small, reviewable subset that doesn't mess with CI stability while laying the groundwork for more complex parts later.

What this changes

  • Updates workspace metadata collection to include library/stdarch/Cargo.toml.
  • Generalizes test::Crate and doc::Std so they can handle either the main library workspace or the stdarch workspace.
  • Routes paths like library/stdarch or library/stdarch/crates/core_arch to these existing steps.
  • Configures the root library/stdarch path to run core_arch and stdarch_examples by default.
  • Updates bootstrap tests and CLI snapshots (also switched these to use CI LLVM config so they don't break on local setups without CMake).

Why this subset?

I'm starting with core_arch and examples because they are deterministic and follow the basic upstream ci/run.sh flow.

I've deliberately left out intrinsic-test, stdarch-verify, and any fuzzing-related bits for now. Those have trickier tooling requirements and non-determinism concerns that are better handled once this basic integration is solid.

Design note

I originally tried adding dedicated stdarch bootstrap steps, but it felt a bit redundant.

Refactoring test::Crate / doc::Std to be workspace-aware seems like a much cleaner fit for bootstrap’s architecture. It avoids duplicating logic and makes it easier to pull in more of stdarch (or other sub-workspaces) in the future.

Tests

Verified with:

./x test bootstrap --test-args test_stdarch_workspace_metadata_is_loaded
./x test bootstrap --test-args test_test_stdarch
./x test bootstrap --test-args test_doc_stdarch
./x test bootstrap --test-args x_test_library
./x test bootstrap --test-args x_doc

@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc 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) labels Mar 16, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, clubby789, jieyouxu

@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from d4ee83e to 4122557 Compare March 16, 2026 11:46
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Am I missing something or is this way too naive?
EDIT: oh, just core_arch?

I think you are mentoring this GSoC project so maybe you have more context
r? @Kobzol

View changes since this review

@rustbot rustbot assigned Kobzol and unassigned jieyouxu Mar 16, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

Kobzol is not on the review rotation at the moment.
They may take a while to respond.

@mnmn-f
Copy link
Author

mnmn-f commented Mar 16, 2026

Thanks, that’s a fair point.

I kept this first step minimal on purpos, mostly just to get bootstrap to see library/stdarch as an in-tree workspace and give x test a small deterministic entrypoint like core_arch.

I added a dedicated test::Stdarch step since stdarch is outside the library/Cargo.toml workspace that the current test::Crate flow expects. But if it makes more sense to generalize the existing plumbing instead of adding a new step, I’m happy to go that route.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from 4122557 to 4408708 Compare March 16, 2026 13:27
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from 4408708 to b4a874c Compare March 16, 2026 13:44
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from b4a874c to f96a714 Compare March 16, 2026 14:14
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from f96a714 to c5b80e6 Compare March 16, 2026 15:33
@mnmn-f mnmn-f changed the title bootstrap: add initial support for x test library/stdarch Teach bootstrap test/doc plumbing to handle an initial stdarch workspace subset Mar 16, 2026
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from c5b80e6 to e72378e Compare March 16, 2026 15:48
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from e72378e to 816eccf Compare March 16, 2026 16:34
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from 816eccf to dbea72c Compare March 16, 2026 16:47
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from dbea72c to 02c8a87 Compare March 16, 2026 17:43
@rustbot
Copy link
Collaborator

rustbot commented Mar 16, 2026

stdarch is developed in its own repository. If possible, consider making this change to rust-lang/stdarch instead.

cc @Amanieu, @folkertdev, @sayantn

@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from 02c8a87 to a29bb5c Compare March 17, 2026 02:48
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from a29bb5c to 942618c Compare March 17, 2026 03:41
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch 5 times, most recently from 063f7d7 to 76b30ef Compare March 17, 2026 10:56
@rust-log-analyzer

This comment has been minimized.

@mnmn-f mnmn-f force-pushed the codex/stdarch-bootstrap-step branch from 76b30ef to 7678662 Compare March 17, 2026 12:50
@Kobzol
Copy link
Member

Kobzol commented Mar 17, 2026

I've deliberately left out intrinsic-test, stdarch-verify, and any fuzzing-related bits for now. Those have trickier tooling requirements and non-determinism concerns that are better handled once this basic integration is solid.

stdarch-verify is just three tests that can be easily executed with cargo test, and doesn't have any "tricky tooling requirements", as shown in #153957.

I don't understand what this PR does, and I don't know why we should be using a different workspace switch in the bootstrap steps, so I won't review this PR.

First, I'd like to start with the simplest stdarch test jobs, such as stdarch-verify, maybe followed by check-stdarch-gen and intrinsics-test (not sure how complicated is that one). I'd like to see some document that will succintly describe how does the current stdarch main test suite work, and some plan for integrating it within bootstrap. This should ideally not require any libstd nor stdarch changes, just bootstrap and CI changes.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-21-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
##[endgroup]
Executing "/scripts/stage_2_test_set2.sh"
+ /scripts/stage_2_test_set2.sh
+ '[' 1 == 1 ']'
+ echo 'PR_CI_JOB set; skipping tidy'
+ SKIP_TIDY='--skip tidy'
PR_CI_JOB set; skipping tidy
+ ../x.py --stage 2 test --skip tidy --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest
##[group]Building bootstrap
    Finished `dev` profile [unoptimized] target(s) in 0.04s
##[endgroup]
---
   --> library/std/src/lib.rs:655:9
    |
655 |   #[doc = concat!(
    |  _________^
656 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_prefix.md"),
657 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_other_architectures_std.md"),
658 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_examples.md"),
659 | | )]
    | |_^
    |
    = note: the link appears in this line:
            
            [`x86`]: crate::arch::x86
                     ^^^^^^^^^^^^^^^^
    = note: no item named `x86` in module `arch`
    = note: `#[warn(rustdoc::broken_intra_doc_links)]` on by default

warning: unresolved link to `crate::arch::x86_64`
   --> library/std/src/lib.rs:655:9
    |
655 |   #[doc = concat!(
    |  _________^
656 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_prefix.md"),
657 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_other_architectures_std.md"),
658 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_examples.md"),
659 | | )]
    | |_^
    |
    = note: the link appears in this line:
            
            [`x86_64`]: crate::arch::x86_64
                        ^^^^^^^^^^^^^^^^^^^
    = note: no item named `x86_64` in module `arch`

warning: unresolved link to `crate::arch::wasm32`
   --> library/std/src/lib.rs:655:9
    |
655 |   #[doc = concat!(
    |  _________^
656 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_prefix.md"),
657 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_other_architectures_std.md"),
658 | |     include_str!("../../stdarch/crates/core_arch/src/core_arch_docs_examples.md"),
659 | | )]
    | |_^
    |
    = note: the link appears in this line:
            
            [`wasm32`]: crate::arch::wasm32
                        ^^^^^^^^^^^^^^^^^^^
    = note: no item named `wasm32` in module `arch`

[RUSTC-TIMING] std test:false 6.107
    Checking rustc-std-workspace-std v1.99.0 (/checkout/library/rustc-std-workspace-std)
---
warning: `std` (lib doc) generated 3 warnings
    Finished `dist` profile [optimized] target(s) in 44.80s
error: warnings are denied by `build.warnings` configuration
Bootstrap failed while executing `--stage 2 test --skip tidy --skip tests --skip coverage-map --skip coverage-run --skip library --skip tidyselftest`
Command `/checkout/obj/build/aarch64-unknown-linux-gnu/stage0/bin/cargo doc -Zwarnings --target aarch64-unknown-linux-gnu -Zbinary-dep-depinfo -j 4 -Zroot-dir=/checkout -Zno-embed-metadata --locked --color=always --profile=dist -p alloc -p compiler_builtins -p core -p panic_abort -p panic_unwind -p proc_macro -p rustc-std-workspace-core -p std -p std_detect -p sysroot -p test -p unwind --features 'backtrace panic-unwind compiler-builtins-c' --manifest-path /checkout/library/sysroot/Cargo.toml --no-deps --target-dir /checkout/obj/build/aarch64-unknown-linux-gnu/stage1-std/aarch64-unknown-linux-gnu/doc -Zskip-rustdoc-fingerprint -Zrustdoc-map [workdir=/checkout]` failed with exit code 101
Created at: src/bootstrap/src/core/build_steps/doc.rs:924:21
Executed at: src/bootstrap/src/core/build_steps/doc.rs:957:22

Command has failed. Rerun with -v to see more details.
Build completed unsuccessfully in 0:29:18
  local time: Tue Mar 17 13:25:54 UTC 2026
  network time: Tue, 17 Mar 2026 13:25:55 GMT
##[error]Process completed with exit code 1.
##[group]Run echo "disk usage:"

@mnmn-f
Copy link
Author

mnmn-f commented Mar 17, 2026

Thanks for the feedback. I think I was grouping stdarch-verify too aggressively with the more complex tasks, and I see now that it’s a much better entry point.

Looking back, many of the errors I hit were likely because I tried to tackle the workspace plumbing before fully stabilizing the simplest existing jobs. I’m going to take a step back and draft a quick breakdown of the current stdarch test suite along with a staged integration plan. Starting with stdarch-verify will allow me to follow up with a much smaller, more focused PR for the bootstrap/CI side.

@mnmn-f mnmn-f closed this Mar 17, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants