From: Matthias Goergens <matthias.goergens@gmail.com>
To: Miguel Ojeda <ojeda@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
Nicolas Schier <nsc@kernel.org>,
Alice Ryhl <aliceryhl@google.com>, Gary Guo <gary@garyguo.net>,
rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org
Subject: Re: [PATCH v2 5/6] kbuild: rust: warn if the out-of-tree compiler differs from the kernel one
Date: Sun, 4 Oct 2026 16:47:58 +0800 [thread overview]
Message-ID: <20261004084758.40138-1-matthias.goergens@gmail.com> (raw)
In-Reply-To: <20240902165535.1101978-6-ojeda@kernel.org>
Hi Miguel,
When you applied the rest of this series you held this patch back "to
give people more time to look at it". Nicolas reviewed and Alice
tested the series at the time, but nobody commented on this patch, and
it never went in. Here is a case from the field where it would have
helped.
Arch Linux users building an out-of-tree Rust module with DKMS (the
bcachefs module, in this case) hit E0514 against the headers package:
crate `core` compiled by rustc 1.98.1 (48a229cea 2026-09-01) (Arch Linux rust 1:1.98.1-2): /usr/lib/modules/6.18.53-1-lts/build/rust/libcore.rmeta
= help: please recompile that crate using this compiler (rustc 1.98.1 (48a229cea 2026-09-01) (Arch Linux rust 1:1.98.1-1)) (consider running `cargo clean` first)
Both are 1.98.1 from the same commit, in two package releases: the
linux-lts headers were built with the second while users still had the
first. (Arch has since rebuilt its kernels.) The advice to recompile
`core` and run `cargo clean` does not apply to a headers package, and
the forum thread spent several posts on repository settings before the
cause was clear:
https://bbs.archlinux.org/viewtopic.php?id=314993
The check in this patch compares `rustc --version`, which includes the
distribution's description, so it fires in exactly this case. I
rebased it onto current mainline (the only conflict is the pahole
check added since; I put the Rust check after the C one) and tried it
the other way round, with the Arch 7.2.8.arch1-1 headers (now in the
Arch Linux Archive) and the newer rustc:
warning: the Rust compiler differs from the one used to build the kernel
The kernel was built by: rustc 1.98.1 (48a229cea 2026-09-01) (Arch Linux rust 1:1.98.1-1)
You are using: rustc 1.98.1 (48a229cea 2026-09-01) (Arch Linux rust 1:1.98.1-2)
RUSTC [M] rust_oot.o
error[E0514]: found crate `core` compiled by an incompatible version of rustc
With a matching rustc it prints nothing. If you would like to take it
now, I can send the rebased version.
Thanks,
Matthias
next prev parent reply other threads:[~2026-10-04 8:48 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-02 16:55 [PATCH v2 0/6] `RUSTC_VERSION` and re-config/re-build support on compiler change Miguel Ojeda
2024-09-02 16:55 ` [PATCH v2 1/6] kbuild: rust: add `CONFIG_RUSTC_VERSION` Miguel Ojeda
2024-09-05 1:08 ` Masahiro Yamada
2024-09-05 20:46 ` Miguel Ojeda
2024-09-02 16:55 ` [PATCH v2 2/6] kbuild: rust: re-run Kconfig if the version text changes Miguel Ojeda
2024-09-02 16:55 ` [PATCH v2 3/6] kbuild: rust: rebuild " Miguel Ojeda
2024-09-02 16:55 ` [PATCH v2 4/6] kbuild: rust: replace proc macros dependency on `core.o` with the version text Miguel Ojeda
2024-09-02 16:55 ` [PATCH v2 5/6] kbuild: rust: warn if the out-of-tree compiler differs from the kernel one Miguel Ojeda
2026-10-04 8:47 ` Matthias Goergens [this message]
2024-09-02 16:55 ` [PATCH v2 6/6] docs: rust: include other expressions in conditional compilation section Miguel Ojeda
2024-09-03 11:35 ` [PATCH v2 0/6] `RUSTC_VERSION` and re-config/re-build support on compiler change Alice Ryhl
2024-09-03 11:36 ` Miguel Ojeda
2024-09-04 19:32 ` Nicolas Schier
2024-09-04 21:15 ` Miguel Ojeda
2024-09-04 21:15 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261004084758.40138-1-matthias.goergens@gmail.com \
--to=matthias.goergens@gmail.com \
--cc=aliceryhl@google.com \
--cc=gary@garyguo.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox