rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scripts: generate_rust_analyzer: Add message to sysroot assertion
@ 2025-11-23 11:00 Maurice Hieronymus
  0 siblings, 0 replies; only message in thread
From: Maurice Hieronymus @ 2025-11-23 11:00 UTC (permalink / raw)
  To: ojeda, alex.gaynor; +Cc: rust-for-linux, linux-kernel, Maurice Hieronymus

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>
---
 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 fc27f0cca752..b2fc6e8aa8ba 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -193,7 +193,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, args.core_edition),

base-commit: 494de8f67b1e586b0190eb7f835e97c97f6b81b1
-- 
2.50.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-23 11:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23 11:00 [PATCH] scripts: generate_rust_analyzer: Add message to sysroot assertion Maurice Hieronymus

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).