From: Maurice Hieronymus <mhi@mailbox.org>
To: ojeda@kernel.org, alex.gaynor@gmail.com, boqun.feng@gmail.com,
gary@garyguo.net, bjorn3_gh@protonmail.com,
benno.lossin@proton.me, a.hindborg@kernel.org,
aliceryhl@google.com, tmgross@umich.edu,
rust-for-linux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, Maurice Hieronymus <mhi@mailbox.org>
Subject: [PATCH v2] scripts: generate_rust_analyzer: Add message to sysroot assertion
Date: Sun, 30 Nov 2025 20:15:35 +0100 [thread overview]
Message-ID: <20251130191535.77498-1-mhi@mailbox.org> (raw)
The assertion that checks whether sysroot lies within sysroot_src
currently fails without explaining why. Add an error message that
prints both paths to make diagnosing toolchain issues easier.
Signed-off-by: Maurice Hieronymus <mhi@mailbox.org>
---
Changes since v2:
- Rebase to current rust/for-next
- Send patch to all people received from scripts/get_maintainer.pl
scripts/generate_rust_analyzer.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index d2bc63cde8c6..06c220c9ceee 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -156,7 +156,13 @@ def main():
)
# Making sure that the `sysroot` and `sysroot_src` belong to the same toolchain.
- assert args.sysroot in args.sysroot_src.parents
+ assert args.sysroot in args.sysroot_src.parents, \
+ f"""
+ It seems like your sysroot and sysroot_src do not belong to the same toolchain.
+ The sysroot folder must be inside sysroot_src.
+ sysroot={args.sysroot}
+ sysroot_src={args.sysroot_src}
+ """
rust_project = {
"crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.exttree, args.cfgs),
base-commit: 8af7a50167833b6b22e30c008bbf95ab3ff1a5fb
--
2.50.1
next reply other threads:[~2025-11-30 19:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-30 19:15 Maurice Hieronymus [this message]
2025-11-30 23:50 ` [PATCH v2] scripts: generate_rust_analyzer: Add message to sysroot assertion Miguel Ojeda
2025-12-01 16:49 ` Maurice Hieronymus
2025-12-01 17:06 ` 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=20251130191535.77498-1-mhi@mailbox.org \
--to=mhi@mailbox.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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;
as well as URLs for NNTP newsgroup(s).