]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
scripts: generate_rust_analyzer: remove sysroot assertion
authorOnur Özkan <work@onurozkan.dev>
Wed, 24 Dec 2025 13:53:43 +0000 (16:53 +0300)
committerMiguel Ojeda <ojeda@kernel.org>
Sun, 18 Jan 2026 19:24:15 +0000 (20:24 +0100)
With nixpkgs's rustc, rust-src component is not bundled
with the compiler by default and is instead provided from
a separate store path, so this assumption does not hold.

The assertion assumes these paths are in the same location
which causes `make LLVM=1 rust-analyzer` to fail on NixOS.

Link: https://rust-for-linux.zulipchat.com/#narrow/stream/x/topic/x/near/565284250
Signed-off-by: Onur Özkan <work@onurozkan.dev>
Reviewed-by: Gary Guo <gary@garyguo.net>
Fixes: fe992163575b ("rust: Support latest version of `rust-analyzer`")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251224135343.32476-1-work@onurozkan.dev
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
scripts/generate_rust_analyzer.py

index 6061bd6e2ebdfcfe75210c5a53a8751a5e87a8c3..14c74dfee703a932bed6f4339f3013c18f5d878f 100755 (executable)
@@ -213,9 +213,6 @@ def main():
         level=logging.INFO if args.verbose else logging.WARNING
     )
 
-    # Making sure that the `sysroot` and `sysroot_src` belong to the same toolchain.
-    assert args.sysroot in args.sysroot_src.parents
-
     rust_project = {
         "crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.exttree, args.cfgs, args.core_edition),
         "sysroot": str(args.sysroot),