Skip to content

bootstrap: add bootstrap step to run intrinsic-test in CI#156356

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xonx4l:port-intrinsic-test
Jun 22, 2026
Merged

bootstrap: add bootstrap step to run intrinsic-test in CI#156356
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
xonx4l:port-intrinsic-test

Conversation

@xonx4l

@xonx4l xonx4l commented May 9, 2026

Copy link
Copy Markdown
Contributor

View all comments

This PR ports library/stdarch/crates/intrinsic-test crate into the bootstrap test runner as a step, so that we can run the intrinsic-test suite via x.py test.

Changes -:
Ports intrinsic-test from the stdarch crate into the bootstrap system as a new test step so it runs inside the existing
x86_64-gnu and aarch64-gnu CI jobs .
Added intrinsic-test in src/bootstrap/src/core/build_steps/test.rs .
Registers intrinsic-test as a bootstrap tool in tool.rs .
Installs clang, lld, and Intel SDE in the respective Dockerfiles.

r? @Kobzol

try-job: x86_64-gnu

@rustbot rustbot added A-CI Area: Our Github Actions CI 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 May 9, 2026
@rustbot

rustbot commented May 9, 2026

Copy link
Copy Markdown
Collaborator

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

@rustbot rustbot added the T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. label May 9, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment on lines +916 to +918
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("library/stdarch/crates/intrinsic-test")
}

@folkertdev folkertdev May 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the intrinsic tests should also run when any of the source in core_arch changes (unless I'm misinterpreting what this function does).

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No you are not misinterpreting :) . You're so right I have added the core_arch path so it triggers . Thanks for the review.

Comment on lines +27 to +30
RUN curl -L http://ci-mirrors.rust-lang.org/sde-external-10.8.0-2026-03-15-lin.tar.xz -o /tmp/sde.tar.xz \
&& mkdir -p /intel-sde \
&& tar -xJf /tmp/sde.tar.xz --strip-components=1 -C /intel-sde \
&& rm /tmp/sde.tar.xz

@folkertdev folkertdev May 10, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this doesn't need an instant fix, but we bump the version of this tool occasionally, so ideally we'd sync that version between the repositories.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, noted.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@Kobzol Kobzol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

I wonder what to do about the required dependencies. GCC/Clang is fine, but the SDE emulator seems problematic. We have a lot of CI jobs that will run the intrinsics test and I don't think it is great if we install it on all of them. Of course it is also not great if it is required when running tests locally.

I think that we should make this test be non-default for now, and run it explicitly on selected CI jobs.

View changes since this review

Comment thread src/bootstrap/src/core/build_steps/test.rs
Comment thread src/bootstrap/src/core/build_steps/test.rs Outdated
Comment thread src/bootstrap/src/core/build_steps/test.rs Outdated

let crates_link = out_dir.join("crates");
if !crates_link.exists() {
std::os::unix::fs::symlink(builder.src.join("library/stdarch/crates"), &crates_link)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This won't work on non-Linux OSes. Why do we need this symlink?

There are existing functions in bootstrap to create symlinks, see symlink_dir.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we need symlink because the generated Cargo.toml files depend on core_arch via a relative path. We generate into the build directory to avoid writing into the submodule so that path doesn't exist there. The symlink points back at the real stdarch crates so it resolves.

Comment thread src/bootstrap/src/core/build_steps/test.rs Outdated
Comment thread src/bootstrap/src/core/build_steps/test.rs Outdated
Comment thread src/bootstrap/src/core/build_steps/tool.rs Outdated
@xonx4l

xonx4l commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Thank you!

I wonder what to do about the required dependencies. GCC/Clang is fine, but the SDE emulator seems problematic. We have a lot of CI jobs that will run the intrinsics test and I don't think it is great if we install it on all of them. Of course it is also not great if it is required when running tests locally.

I think that we should make this test be non-default for now, and run it explicitly on selected CI jobs.

View changes since this review

Yes , non-default and run it explicitly on selected CI jobs is better way to handle instead on every CI jobs .

@rust-log-analyzer

This comment has been minimized.

@xonx4l
xonx4l force-pushed the port-intrinsic-test branch from 9383a8f to f10bf02 Compare May 29, 2026 13:22
@Kobzol

Kobzol commented May 30, 2026

Copy link
Copy Markdown
Member

Let's run this test explicitly in the ‎x86_64-gnu CI job, as a start. The Dockerfile will need to run something like x test intrinsic-test.

@xonx4l

xonx4l commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Let's run this test explicitly in the ‎x86_64-gnu CI job, as a start. The Dockerfile will need to run something like x test intrinsic-test.

@Kobzol As I added the x86_64-gnu Dockerfile invocation you suggested and ran ./x test library/stdarch/crates/intrinsic-test locally . It failed giving this error.

warning: hidden lifetime parameters in types are deprecated
--> library/stdarch/crates/intrinsic-test/src/common/indentation.rs:20:37
|
20 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
| ----------^^^^^^^^^
| |
| expected lifetime parameter
|
= note: -W elided-lifetimes-in-paths implied by -W rust-2018-idioms
= help: to override -W rust-2018-idioms add #[allow(elided_lifetimes_in_paths)]
help: indicate the anonymous lifetime
|
20 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
| ++++

error: intrinsic-test (bin "intrinsic-test") generated 1 warning
error: warnings are denied by build.warnings configuration
Build completed unsuccessfully in 0:00:07

@Kobzol

Kobzol commented Jun 1, 2026

Copy link
Copy Markdown
Member

You can just fix the warning, the change will be later synced back to stdarch.

@rust-bors

This comment has been minimized.

@Kobzol

Kobzol commented Jun 21, 2026

Copy link
Copy Markdown
Member

Looks like it works! Thank you! Let's try.

@bors r=kobzol,folkertdev

@rust-bors

rust-bors Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9b6ab66 has been approved by kobzol,folkertdev

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 Jun 21, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jun 21, 2026
bootstrap: add bootstrap step to run intrinsic-test in CI



This PR ports `library/stdarch/crates/intrinsic-test` crate into the bootstrap test runner as a step, so that we can run the  intrinsic-test suite via x.py test.

Changes -:
Ports `intrinsic-test` from the stdarch crate into the bootstrap system as a new  test step so it runs inside the existing
`x86_64-gnu` and `aarch64-gnu` CI jobs .
Added `intrinsic-test` in `src/bootstrap/src/core/build_steps/test.rs` .
Registers `intrinsic-test` as a bootstrap tool  in `tool.rs` .
Installs `clang`, `lld`, and Intel SDE in the respective Dockerfiles.

r? @Kobzol

try-job: x86_64-gnu
@rust-bors rust-bors Bot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 21, 2026
@rust-bors

rust-bors Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 5697a1f failed: CI. Failed job:

@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

A job failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  IMAGE: aarch64-gnu-debug
##[endgroup]
    Updating crates.io index
error: failed to get `adler2` as a dependency of package `miniz_oxide v0.8.8`
    ... which satisfies dependency `miniz_oxide = "^0.8.5"` of package `flate2 v1.1.9`
    ... which satisfies dependency `flate2 = "^1.1.9"` of package `citool v0.1.0 (/home/runner/work/rust/rust/src/ci/citool)`

Caused by:
  failed to load source for dependency `adler2`

Caused by:
  unable to update registry `crates-io`

Caused by:
  download of ad/le/adler2 failed

Caused by:
  curl failed

Caused by:

@Kobzol

Kobzol commented Jun 21, 2026

Copy link
Copy Markdown
Member

@bors retry

@rust-bors rust-bors Bot 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 Jun 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jun 21, 2026
…ol,folkertdev

bootstrap: add bootstrap step to run intrinsic-test in CI

This PR ports `library/stdarch/crates/intrinsic-test` crate into the bootstrap test runner as a step, so that we can run the  intrinsic-test suite via x.py test.

Changes -:
Ports `intrinsic-test` from the stdarch crate into the bootstrap system as a new  test step so it runs inside the existing
`x86_64-gnu` and `aarch64-gnu` CI jobs .
Added `intrinsic-test` in `src/bootstrap/src/core/build_steps/test.rs` .
Registers `intrinsic-test` as a bootstrap tool  in `tool.rs` .
Installs `clang`, `lld`, and Intel SDE in the respective Dockerfiles.

r? @Kobzol

try-job: x86_64-gnu
rust-bors Bot pushed a commit that referenced this pull request Jun 21, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #156356 (bootstrap: add bootstrap step to run intrinsic-test in CI)
 - #157711 (Move proc-macro dlopen from proc-macro-srv to rustc_metadata)
 - #157836 (rebuild LLVM when `bootstrap.toml` config changes)
 - #158214 (Don't try to remove assignments in SimplifyComparisonIntegral)
 - #158226 (miri subtree update)
 - #158108 (Update actions/download-artifact action to v8.0.1)
 - #158150 (Update backtrace submodule to pick up AIX related fixes.)
 - #158178 (Use the target checking infrastructure for the diagnostic attributes)
 - #158195 (Add me to some rotation groups)
@rust-bors
rust-bors Bot merged commit f8f1189 into rust-lang:main Jun 22, 2026
14 of 15 checks passed
@rustbot rustbot added this to the 1.98.0 milestone Jun 22, 2026
rust-timer added a commit that referenced this pull request Jun 22, 2026
Rollup merge of #156356 - xonx4l:port-intrinsic-test, r=kobzol,folkertdev

bootstrap: add bootstrap step to run intrinsic-test in CI

This PR ports `library/stdarch/crates/intrinsic-test` crate into the bootstrap test runner as a step, so that we can run the  intrinsic-test suite via x.py test.

Changes -:
Ports `intrinsic-test` from the stdarch crate into the bootstrap system as a new  test step so it runs inside the existing
`x86_64-gnu` and `aarch64-gnu` CI jobs .
Added `intrinsic-test` in `src/bootstrap/src/core/build_steps/test.rs` .
Registers `intrinsic-test` as a bootstrap tool  in `tool.rs` .
Installs `clang`, `lld`, and Intel SDE in the respective Dockerfiles.

r? @Kobzol

try-job: x86_64-gnu
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request Jun 22, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156356 (bootstrap: add bootstrap step to run intrinsic-test in CI)
 - rust-lang/rust#157711 (Move proc-macro dlopen from proc-macro-srv to rustc_metadata)
 - rust-lang/rust#157836 (rebuild LLVM when `bootstrap.toml` config changes)
 - rust-lang/rust#158214 (Don't try to remove assignments in SimplifyComparisonIntegral)
 - rust-lang/rust#158226 (miri subtree update)
 - rust-lang/rust#158108 (Update actions/download-artifact action to v8.0.1)
 - rust-lang/rust#158150 (Update backtrace submodule to pick up AIX related fixes.)
 - rust-lang/rust#158178 (Use the target checking infrastructure for the diagnostic attributes)
 - rust-lang/rust#158195 (Add me to some rotation groups)
pull Bot pushed a commit to p-avital/rust-analyzer that referenced this pull request Jun 22, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#156356 (bootstrap: add bootstrap step to run intrinsic-test in CI)
 - rust-lang/rust#157711 (Move proc-macro dlopen from proc-macro-srv to rustc_metadata)
 - rust-lang/rust#157836 (rebuild LLVM when `bootstrap.toml` config changes)
 - rust-lang/rust#158214 (Don't try to remove assignments in SimplifyComparisonIntegral)
 - rust-lang/rust#158226 (miri subtree update)
 - rust-lang/rust#158108 (Update actions/download-artifact action to v8.0.1)
 - rust-lang/rust#158150 (Update backtrace submodule to pick up AIX related fixes.)
 - rust-lang/rust#158178 (Use the target checking infrastructure for the diagnostic attributes)
 - rust-lang/rust#158195 (Add me to some rotation groups)
// intrinsic-test shells out to `cargo` and `rustfmt` make bootstrap's
// managed binaries findable by prepending their dirs to PATH.
let rustfmt_path = builder.config.initial_rustfmt.clone().unwrap_or_else(|| {
eprintln!("intrinsic-test: rustfmt is required but not available on this channel");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going to break on beta/stable channels (as it says) -- is the intent to not run this test in CI on those channels? I'll drop it temporarily but we should land something on main that avoids breaking CI (as seen here - #159072 (comment)).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch. I think we can simply print a warning and then skip the test (just return) from this function. @xonx4l Can you please send a PR that does that? Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Okay got it , OTW. Thanks @Mark-Simulacrum for the catch!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Here opened the PR -: #159265 .

@cuviper

cuviper commented Jul 14, 2026

Copy link
Copy Markdown
Member

I wonder what to do about the required dependencies. GCC/Clang is fine, but the SDE emulator seems problematic. We have a lot of CI jobs that will run the intrinsics test and I don't think it is great if we install it on all of them. Of course it is also not great if it is required when running tests locally.
I think that we should make this test be non-default for now, and run it explicitly on selected CI jobs.

Yes , non-default and run it explicitly on selected CI jobs is better way to handle instead on every CI jobs .

I just ran into a failure while locally running ./x test library:

  could not execute process `/intel-sde/sde64 [...]`

I think this test command would be the typical recommendation for standard library contributors, so do we need to do something more explicit to exclude intrinsic-test by default?

@Kobzol

Kobzol commented Jul 14, 2026

Copy link
Copy Markdown
Member

Oh, I didn't realize that this would trigger during x test library, that is indeed unfortunate.

@xonx4l, could you please change should_run to run.alias("intrinsic-test"), to avoid triggering this test when people use x test library? Thanks! The CI jobs will also have to be modified, unless we land #159011 first.

@cuviper

cuviper commented Jul 14, 2026

Copy link
Copy Markdown
Member

That other PR is going to make all ./x test include intrinsic-test? (and thus require /intel-sde?)

@Kobzol

Kobzol commented Jul 14, 2026

Copy link
Copy Markdown
Member

Yes, that's the plan. But it will be executed only at the very end, and I don't know anyone who actually runs the whole x test pipeline locally, I think we discussed this on Zulip some time ago and even the most patient people admitted that they Ctrl+C the tests after some time 😆

But if you think it's problematic, we can always just skip running the test if SDE isn't available.

@Kobzol

Kobzol commented Jul 14, 2026

Copy link
Copy Markdown
Member

Actually, I think it would be indeed better to follow a scheme that we already use elsewhere in bootstrap.

  1. Allow configuring build.sde path, to avoid hardcoding it, and make it be opt in
  2. If you run x test intrinsic-test and SDE is not configured, produce a loud error
  3. If you run just x test and SDE is not configured, print a warning and skip the test

What do you think?

@cuviper

cuviper commented Jul 14, 2026

Copy link
Copy Markdown
Member

I don't know anyone who actually runs the whole x test pipeline locally

It's not exactly local, but I do run that in our Fedora/RHEL rpmbuild, and I don't think it's feasible to get SDE in there.

The opt-in build.sde sounds like a much better way to go!

@cuviper

cuviper commented Jul 14, 2026

Copy link
Copy Markdown
Member

I do also run ./x test locally though -- I guess I'm more patient than most (and missed that zulip thread).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants