Retroactive MCP for the Rust for Linux Ecosystem Test Job #874
Labels
major-change
A proposal to make a major change to rustc
T-compiler
Add this label so rfcbot knows to poll the compiler team
to-announce
Announce this issue on triage meeting
Uh oh!
There was an error while loading. Please reload this page.
Proposal
Retroactive MCP for the
x86_64-rust-for-linux
ecosystem test job as per Adding ecosystem/integration test jobs/components to rust-lang/rust CI. This was co-authored with @Darksonn and @ojeda.Test job/component rationale
Rust for Linux (RfL) is the project adding support for the Rust language to the Linux kernel.
It is an ecosystem integration test where a stage 1 sysroot is built to try to compile several Rust for Linux drivers and examples to detect significant breakages/changes that would be observed by RfL.
All.
Rust and Rust for Linux hope to avoid unintentional changes to Rust that break the kernel. In other words, apart from intentional changes on Rust's side, upcoming Rust versions should generally be able to build the Linux kernel.
It needs to block in order to ensure that the Linux kernel is buildable (at least, the basic subset/configuration being tested so far). Nevertheless, sometimes breakage may need to be fixed on either side (Rust or Linux), or the CI may need to be disabled.
N/A. This job is already blocking Full Merge CI.
Test job/component maintainers
@alex
@bjorn3
@dakr
@Darksonn
@dingxiangfei2009
@fbq
@maurer
@metaspace
@nbdd0121
@ojeda
@tgross35
@vincenzopalazzo
@y86-dev
You can also contact RfL maintainers through the triagebot ping group
Understood.
CI infrastructure considerations
N/A. Already in Full Merge CI.
Features and implementation details
Yes. Linux is in regular contact with the Rust project about which unstable features are used. New features are only added after communication with the Rust project.
Yes, Linux currently uses a set of unstable features (including language, compiler,
rustdoc
, etc.). See https://rust-for-linux.com/unstable-features and Rust-for-Linux/linux#2.However, Rust and Rust for Linux are working towards stabilizing those features (or otherwise finding alternative approaches). See the related Rust flagship goals of 2024H2 and 2025H1.
In particular, at the time of writing (mid 2025), only a couple unstable language features remain in use. It is expected that they become stable after blockers are resolved. There may be new language unstable features in the future that could become useful for Linux (e.g. native pin-init, field projections, features to help with the orphan rules, features to help writing a custom
alloc
that is on par with the standard library one...).On the other hand, there are still a fair amount of unstable compiler flags and other features in use in certain configurations, including building
core
manually (by calling directlyrustc
on it) as well as a customcompiler-builtins
and a custom target specification file (target.json
) for x86. It is expected that many of them will become stable, but it is also likely that Linux will need new compiler unstable features (flags) in the future, as more architectures, configurations, sanitizers, hardware, new compiler features, etc. are supported.Linux uses
RUSTC_BOOTSTRAP
so that it can be built with stable releases of Rust, including toolchains provided by Linux distributions.Failure protocol: what to do if the job/component breaks/fails?
Understood.
Through github handles listed previously, and through the triagebot ping group
x86_64-rust-for-linux
CI job can be run on a PR throughtry-job: x86_64-rust-for-linux
.Documentation/rust/quick-start.rst
file in the Linux kernel repository. Ping the RfL maintainers for help.N/A
Comment out the
x86_64-rust-for-linux
test job insrc/ci/github-actions/jobs.yml
, and ping the RfL maintainers on the PR.If a PR breaks the Rust for Linux CI job, then:
know (through
@rustbot ping rfl
) and retry.temporarily (comment out the
image: x86_64-rust-for-linux
job insrc/ci/github-actions/jobs.yml
).what will the kernel need to change.
the
image: x86_64-rust-for-linux
job insrc/ci/github-actions/jobs.yml
).new Linux kernel commit hash with the needed changes done, and apply it to
the PR, which would confirm the changes work (update the
LINUX_VERSION
environment variable in
src/ci/docker/scripts/rfl-build.sh
).then the RfL maintainers will make them for you.
Dependencies, build/test environments and reliability
The Linux kernel is built using Kbuild (
make
).The job depends on the Linux kernel source code, which can be obtained from GitHub or git.kernel.org. A mirror is not needed. The RfL maintainers can provide patched kernels when a workaround is needed on the Linux side (see above).
Cloning the Linux kernel source code could fail due to network errors. Nevertheless, at the moment the clone comes from GitHub.
It depends on
make
and various tools to build C code. The shell script sets this up.Mentors or Reviewers
Anyone from compiler.
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.You can read more about Major Change Proposals on forge.
The text was updated successfully, but these errors were encountered: