#16197·meson

rust-project.json sysroot_src not alwas valid

Author: kloenkCreated Sep 8, 2026Updated Sep 8, 2026

Currently the rust-project.json sysroot_src value is set to os.path.join(sysroot, 'lib/rustlib/src/rust/library/'), but this does not always return a valid path. E.g. on a rustc provided by NixOS this path does not exist. The linux kernel uses a RUST_LIB_SRC environment variable to set the library source directory. Maybe meson could check for this variable as well, and only fallback to the current sysroot discovery mechanism when this variable is unset.