lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DFTTQTYK1KNF.2N1PS08QIAID2@gmail.com>
Date: Wed, 21 Jan 2026 09:01:20 +0900
From: "Jesung Yang" <y.j3ms.n@...il.com>
To: "Tamir Duberstein" <tamird@...nel.org>, "Eliot Courtney"
 <ecourtney@...dia.com>, "Jesung Yang" <y.j3ms.n@...il.com>
Cc: "Miguel Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>,
 "Gary Guo" <gary@...yguo.net>, Björn Roy Baron
 <bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Andreas
 Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
 "Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>,
 "Nathan Chancellor" <nathan@...nel.org>, "Nicolas Schier" <nsc@...nel.org>,
 <rust-for-linux@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
 <linux-kbuild@...r.kernel.org>
Subject: Re: [PATCH 6/6] scripts: generate_rust_analyzer: move sysroot
 crates to sysroot_project

On Wed Jan 21, 2026 at 12:34 AM KST, Tamir Duberstein wrote:
> On Tue, Jan 20, 2026 at 3:55 AM Eliot Courtney <ecourtney@...dia.com> wrote:
>>
>> Use rust-analyzer's sysroot_project feature to properly configure
>> sysroot crates (core, alloc, std, proc_macro). This allows
>> rust-analyzer to correctly resolve items from the sysroot and
>> automatically add sysroot crate dependencies to all project crates.
>>
>> Some sysroot crates use #[path] directives to load files outside of
>> their directory but still in the sysroot. This is disallowed by
>> rust-analyzer, so the sysroot crate are not properly loaded. Loading them
>> using sysroot_project tells rust-analyzer to let them load anything inside
>> sysroot_src.
>>
>> The sysroot_project field was added to rust-analyzer in v0.3.2328
>> (~1.87.0) and is silently ignored by older versions. In that case,
>> rust-analyzer falls back to loading the sysroot via sysroot_src.
>> This basically works, but the advantage of using sysroot_project is
>> that we can make the set of features/cfgs more similar to what the
>> actual build uses.
>
> This is a very nice patch, and perhaps obviates the need for the
> versioning infrastructure in
> https://lore.kernel.org/all/20260109-ra-fix-primitive-v2-0-249852a4145a@gmail.com/.

I still think the versioning infrastructure is a prerequisite as we're
using the `sysroot_src` field here.

If we specify `sysroot_src` without `crate_attrs = ["no_std"]`,
rust-analyzer treats `std` as a dependency for all local crates by
default. Consequently, any rust-analyzer version lacking `crate_attrs`
support (which silently ignores `crate_attrs = ["no_std"]`) would
incorrectly assume an implicit `std` dependency for all kernel modules.
Having the versioning infrastructure first allows us to handle this
transition without breaking the user experience for those on older
toolchains.

Best regards,
Jesung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ