From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93AC5883F for ; Wed, 21 Jan 2026 00:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768953689; cv=none; b=ZKVkTO/qnn4GqGMFOHAcqfvmWUvTBB2MDk47YVALVwK6VMxBZxiNCHfUm1U+DNIr38/ckcfVZ+ca5YaN8NUdUcwI+FwQxPw6n9djoQqCYYVlj+1GI3IJe15dmWIgRu7W2Wl3e4y9UaGAVSctADWb9IMrxeVMnLaVh1ZOSaTPUDk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768953689; c=relaxed/simple; bh=yRdJQmpTWwZj8gimb94j0TPF7S8boNAdmVxrjjDF1sk=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=kXXT9mi7nwTyMnDMh/MCeRX5CIf7B/l0vSKYfTQiyWBaPV7Cl/U6BnUTa4i4ApNgbNL1c5iQtX3/7RCiqjFlpeLX1sfYGHcdgdryu1Qkzb/xPLtd0ZgWCqShITax0GvScFaT9xOe2cPkY+dBJ1x7aZ3ulXwRGYBD50+FBzu0UGU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=aj7cv7B0; arc=none smtp.client-ip=209.85.214.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="aj7cv7B0" Received: by mail-pl1-f194.google.com with SMTP id d9443c01a7336-2a0d6f647e2so57955795ad.1 for ; Tue, 20 Jan 2026 16:01:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768953687; x=1769558487; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=yRdJQmpTWwZj8gimb94j0TPF7S8boNAdmVxrjjDF1sk=; b=aj7cv7B0RiXLew4GU9ErUHbAz1sreeIe7dPcnwtstuOM9qQjMu5fRgQ9EBmLP+F7XH 2/xff9vM+4JNgTXv5ZMsuD+uPxhPj/ErW4Ajd9N95PqsztfiZ3SdXF6ZEnPyyRbYIeM6 bP/Ia+qWB6fHsKu0WHMLddGXW+Ze84HnwWeT6oG11XMQ72f5dcFkjSVtsyTz2mFb12yk aXYa0qmtm+jy6LHB7K4CmLGVwaAEiFOaNhVyhouuyeFrg0Zq3/1cG83yiEJbj90rkp+W 5+Z6tVM7GN7Xv8sQN1Y6rEBEVApAnvQAqwJ+1C+nEMcjMZycdvE01iQ71Cm2dPukq9qK PV+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768953687; x=1769558487; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=yRdJQmpTWwZj8gimb94j0TPF7S8boNAdmVxrjjDF1sk=; b=wDTar6U6Ays9E2+NHCsqvCKtuN3Fkjy3d+1bCg8bI3VbWj5uBgg1MZGT/9QxLv+rOb qcLVPV3BQo6Ai+MWmA6YTrZpll9idP0IhzUqEo6rKIbStEkHiGNxs4RDpOFMDLdxCb/7 EsPng5MQmWEcK3yfBLbb3rPw+skYLpnlkwTICW/JVRpjkpBETC5lMLo5RP+iHDWI9fGD S8ILoJMUHo6kTqv10JRxvZxxoDW5Yj7ZM3yIoJiRK9QqVSTellIBmLCeLwQiSLwrPokh wOP9Tny0CZgq/IXjR5EKGBFHY79oMJ+MPbgMQXeMP5oHn0KbD9hzUZPdbiRR+cv0o+kP Z7Uw== X-Forwarded-Encrypted: i=1; AJvYcCVwvN+gP96D/censA0RH1MNpT9pLCq/cI0Ujzeqj4Aka9lI3nBCBHwkrHwRNtSgJijtfBkG8zfyf8Yv1QY=@vger.kernel.org X-Gm-Message-State: AOJu0YxfPYIJqSwEIq4j/tftKpXUfDT0Eg/u/4VxUPrblb/0kEpf8NhV pSRvYMZgHKe41GPIjAuCV7/xLJC01XP/tpoYzlr1mTNdRkL2naGSEusO X-Gm-Gg: AZuq6aK7ER1tcDzHVZde+/9mRn8YpirSO7aJluYl2jtnKVLAVsVYQ4XzptD35k2YL9i A6k1KMp9FRozlaoQauCSVHmwhGByDzFuxGY28xr7plXGeHNppPDt9OG834XUdhu1v6fivNvvS7Q BALKgtamE5IjEaIae7Ys4+zxaBMaFs5DQdkeOQYxOGr7y3MBAPJjMfIObuujmn5hWUQ/gyVLRro v7JSMFpZZYNfKuS1Y9dkxsJAU2aOSxejXxi1qy9341QyGd5xjRyFhu4e8xOGS+wEkwmyRNwQrIX NskWWx20RMgfL8f3j0YN+AgQPmZOUPpY6VokjnsYgsTeyUph4Bwa/qj74QvByw9zyt3XTPaVmL+ KQo16oKuq+q4y53kmZs/SabthBYPCOSQfNupg63gelWVCADKzcMyOWNY+rRh1sMFVVMaHEWfZXQ B0eRf32g== X-Received: by 2002:a17:903:1a2c:b0:2a0:d5bf:b271 with SMTP id d9443c01a7336-2a76ad5bf2bmr31448885ad.32.1768953686781; Tue, 20 Jan 2026 16:01:26 -0800 (PST) Received: from localhost ([112.149.32.52]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a7193dedacsm135367515ad.58.2026.01.20.16.01.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 20 Jan 2026 16:01:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 21 Jan 2026 09:01:20 +0900 Message-Id: Cc: "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Nathan Chancellor" , "Nicolas Schier" , , , Subject: Re: [PATCH 6/6] scripts: generate_rust_analyzer: move sysroot crates to sysroot_project From: "Jesung Yang" To: "Tamir Duberstein" , "Eliot Courtney" , "Jesung Yang" X-Mailer: aerc 0.21.0 References: <20260120-ra-fix-v1-0-829e4e92818c@nvidia.com> <20260120-ra-fix-v1-6-829e4e92818c@nvidia.com> In-Reply-To: On Wed Jan 21, 2026 at 12:34 AM KST, Tamir Duberstein wrote: > On Tue, Jan 20, 2026 at 3:55=E2=80=AFAM Eliot Courtney 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 the= m >> using sysroot_project tells rust-analyzer to let them load anything insi= de >> 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@g= mail.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 =3D ["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 =3D ["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