From nobody Mon Feb 9 15:59:15 2026 Received: from mail-qk1-f177.google.com (mail-qk1-f177.google.com [209.85.222.177]) (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 3866425B687; Mon, 10 Feb 2025 17:56:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739210162; cv=none; b=Lt3y27PohCTVX05V0QECar9tDgsXFADnRZERdHh0J6DihBjR+uMxpDkKZ/IDMMhGl3vBdwj/I+xhzw0zyEjyNIpsKhj7f9AWta9N9S0ZCgDjGt3ZfHxdHE+Y3n+I0SxcV+FCJuUkEZSbPDJSaXZ57hpdxzqhj60kbZ0+a6LT/1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739210162; c=relaxed/simple; bh=Mtqbgw2OIehnD8M4asR136gXQxf831IPvScVu2CeFV4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Gtt3jeEzRsnYVWICtaJ+WIPFugGfJ1B1jmAJyWek4KA10q7NoU/2jnxyuZlvbxsLIooLAj8CxwXLA46dh/eg8aDXCfBdiLKzwcHcxUadB1F1e9Yo3p6j9P1noJu5jjnXCxpRObzKSiDx4fbfqpdhrcSbJliLQfG+WVfLePnHB/U= 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=RooEBhAT; arc=none smtp.client-ip=209.85.222.177 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="RooEBhAT" Received: by mail-qk1-f177.google.com with SMTP id af79cd13be357-7c05f3dde21so148753785a.2; Mon, 10 Feb 2025 09:56:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739210160; x=1739814960; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ugP0WQMcU/54tTmvfDWk5D3dxw+mt5ZDUJmbgAZzY60=; b=RooEBhATsY/wAIrb+Vkz4QgTkQq8M0OZuvG8rYX5T5TM+JcoAFLzs9qFdujP/iiaiZ YUhtWpVQ+KiktOQH99BWntG0NmlZ35QCSJhjIut96O5qfKpEMlCgfYTwhf5YzvnAxvJM XMEdBVov6auhA94at8I6ebyrr88I8a++bLLe5UzoVt3XPomt1EHc4z4JO5ACXDfApLni z9WpOGRRpRC9jss03XSK8fJCx4+1WqtqPuxYTLg8B2bBevrPEiZ7orWcvg6xlrL9ZHiE f3GX7Qk71VZIqzh2liqFY4ZQWoVlbhFcA0MPIGfa62L8wpFBSZhzqLCX52oRkM2DDKnF tFSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739210160; x=1739814960; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ugP0WQMcU/54tTmvfDWk5D3dxw+mt5ZDUJmbgAZzY60=; b=WwUWAejor1zAADmCKJ+eQu/bdAoy8e85sqpw/+jnkHADPx8dY7WlcykUeTYJVodUcW f2c0GJ1JNU8A5NAqyzv1cGwXDM0hqiB0h2rG4hHtxLE8o3L1I3WFFNtimCNE3W6EmtJa xLeWJG12WWGERT82mmJiTRhc+97nPyadhxY1g6u2mblNWoS6RL3GcmwPcLnnGluu2OSZ lJ5J7mfnTDlZ1iUZGqQXGEbOcBpEub9agJS7+mAR/KU6yMfoD4wsXx4+MOdNN3idFGwC prujbb/r560UxrO6c5l5/xfOECjgNVi4Iq7r/rE91XZjmf7r4qdOgIoJHT5ivzwlFqAh DyOg== X-Forwarded-Encrypted: i=1; AJvYcCV7RKj6QZTrRPlxpFkRZP7zEHewtNtaXp6NqUl5sJX3Z0SS7J4OOvTW0lkOZiPyuOSnAMj0iWQWo35MNBlvujo=@vger.kernel.org, AJvYcCXd7Xbz5wVm1EYp4tUnG0KtX1xnwjXGk/AucY5m50+hbKv7eIB668xzscOljY7d+nnlNJ6KDvq5B9H+TMw=@vger.kernel.org X-Gm-Message-State: AOJu0YyhaRTY0aVRe+dNfViptyyGLdPlg4dMgQE33q+1s2ay62H1BZaj 4GayjCbw1qCRM4HFA1FpINbN27S34ybkLGW5i3DSe4L3CLvMCa41 X-Gm-Gg: ASbGnctdojbBAcf0lnDm95XP6X/YSp7203ZJJRymb9zOTCNrNZIEdY9vEme2qwiVABQ qeVtk+OclSNSn3pZ4P+wZ19gi5J1wtcjJSqFAOK80VcEbdMcMfb7ddhv8BAsBB+U0ggVXuC683N VHm7QJOaDtdJzSIoncN9bzO0N1/5D9yqIrs9EpyFuMR4LFcsGqSjHEAymQWHjHaSkCv2cpo0mw/ IdfGSogDFUiCBbG97Do9zYElvUzlCrJa+pEeXlWDe9cOZs9guIe23jkNcoEb/kSUO5faf8dNh80 OZlyt/Z8/2KPJa8fhJ/Nn5Z8PK5AtENnfedgZzzNtKysSPh5D8h/LsnnRL/JBQmEXpjDUpkqF7p +iep+l+ts26GgpPBmsH2GV4kw X-Google-Smtp-Source: AGHT+IHTXFpC+Lr4Yup/29/vLpZn+wbBAjuiBhuYmhDfMhVpelG0yR9jfA/S9h/k6XO1CAKtGU5QjQ== X-Received: by 2002:a05:620a:8f8a:b0:7c0:62ff:d12d with SMTP id af79cd13be357-7c062ffd23dmr356306085a.32.1739210159986; Mon, 10 Feb 2025 09:55:59 -0800 (PST) Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa ([2620:10d:c091:600::1:cc94]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c041e11d19sm548788885a.52.2025.02.10.09.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 09:55:59 -0800 (PST) From: Tamir Duberstein Date: Mon, 10 Feb 2025 12:55:53 -0500 Subject: [PATCH 1/2] scripts: generate_rust_analyzer.py: add missing include_dirs Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250210-rust-analyzer-bindings-include-v1-1-6cbf420e95b6@gmail.com> References: <20250210-rust-analyzer-bindings-include-v1-0-6cbf420e95b6@gmail.com> In-Reply-To: <20250210-rust-analyzer-bindings-include-v1-0-6cbf420e95b6@gmail.com> To: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Kees Cook , Fiona Behrens , Martin Rodriguez Reboredo , Asahi Lina Cc: Boris-Chengbiao Zhou , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Tamir Duberstein X-Mailer: b4 0.15-dev Commit 8c4555ccc55c ("scripts: add `generate_rust_analyzer.py`") specified OBJTREE for the bindings crate, and `source.include_dirs` for the kernel crate, likely in an attempt to support out-of-source builds for those crates where the generated files reside in `objtree` rather than `srctree`. This was insufficient because both bits of configuration are required for each crate; the result is that rust-analyzer is unable to resolve generated files for either crate in an out-of-source build. Add the missing bits to improve the developer experience. Fixes: 8c4555ccc55c ("scripts: add `generate_rust_analyzer.py`") Signed-off-by: Tamir Duberstein --- scripts/generate_rust_analyzer.py | 40 +++++++++++++++++++----------------= ---- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_anal= yzer.py index aa8ea1a4dbe5..1f573d19cd99 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -85,27 +85,27 @@ def generate_crates(srctree, objtree, sysroot_src, exte= rnal_src, cfgs): ["core", "compiler_builtins"], ) =20 - append_crate( - "bindings", - srctree / "rust"/ "bindings" / "lib.rs", - ["core"], - cfg=3Dcfg, - ) - crates[-1]["env"]["OBJTREE"] =3D str(objtree.resolve(True)) + def append_crate_with_generated( + display_name, + deps, + ): + append_crate( + display_name, + srctree / "rust"/ display_name / "lib.rs", + deps, + cfg=3Dcfg, + ) + crates[-1]["env"]["OBJTREE"] =3D str(objtree.resolve(True)) + crates[-1]["source"] =3D { + "include_dirs": [ + str(srctree / "rust" / display_name), + str(objtree / "rust") + ], + "exclude_dirs": [], + } =20 - append_crate( - "kernel", - srctree / "rust" / "kernel" / "lib.rs", - ["core", "macros", "build_error", "bindings"], - cfg=3Dcfg, - ) - crates[-1]["source"] =3D { - "include_dirs": [ - str(srctree / "rust" / "kernel"), - str(objtree / "rust") - ], - "exclude_dirs": [], - } + append_crate_with_generated("bindings", ["core"]) + append_crate_with_generated("kernel", ["core", "macros", "build_error"= , "bindings"]) =20 def is_root_crate(build_file, target): try: --=20 2.48.1 From nobody Mon Feb 9 15:59:15 2026 Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171]) (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 9098724BD0F; Mon, 10 Feb 2025 17:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739210164; cv=none; b=ipwYpH2VxPPsDIC3nhd+ztOm8fDyQMU4irhDM1bEFHQ1CWD0pwLy+EfxuOxU8NBCXgjZpMIguar9x91Jc9fGCUa9ixwrstcKhyBl5JKd+Xqjckr84GpwCEylv2+MsBzYyVpsxITXpDw+0BeMi1ltQHlewBNaIX4iO4XIi0xDmDY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739210164; c=relaxed/simple; bh=WfRTBdyeM4nQmtCZWzXI+u96gqxpn6LiEPBczZ91G/Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JWCAyW5js8kr06nGzKKW0x5wSTZY7XNb1w1R5f3TYTnbwH+h47fooxR0Ez7rnt+SYDanyqPYuPHemAp5D2uYCu+lswrgKp7P0ebpMyu/oRaXkiaMnKRhmSfBNmbx4TIqheXITL7ghvPWSsLsVjaDPN74xGemzYuxeC3F8gcm1E8= 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=B5dS2BHP; arc=none smtp.client-ip=209.85.222.171 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="B5dS2BHP" Received: by mail-qk1-f171.google.com with SMTP id af79cd13be357-7c04e5018dbso185843885a.0; Mon, 10 Feb 2025 09:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739210161; x=1739814961; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=BxgKM+hVOP6x6Lqz4af2aMlNHDAI6axnHkoGyF+WopM=; b=B5dS2BHPxwKpmbsVXw1ePYQdbUI5S2inxJbnfBqeGsfDGLFMH/KF36MNXxs3G80Sbv bBWVVrQEd03G9tzbvmc6WOz5qGXizGGCY9lGW3e9FtWWdykT//hC2Brc0OUVTTlXx6Qe d+lnVWLXM5kxeiOD8MhtO1JJQX+i25tPkWlAJ8e/65GpzbaR640L+LF7zpklx+WAPfoa J6m8xrZAvQjV7/2WzFWG1AiUkuvuGmiHOwFXybrHrljuHm3nz6B/XVoA6h58aNi8W6D7 ham3UICbfXnm4CWrU9+AoMx3f9B/WdjTwkDIxmgebkvoef+M9QbHWwZi5a979zollIY3 rG+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739210161; x=1739814961; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BxgKM+hVOP6x6Lqz4af2aMlNHDAI6axnHkoGyF+WopM=; b=pY6enYwKoeAR1ufOP+TyckxZsjMlUIMvEZRJRibZRGpL5p00UhS9qt6VzaIzsDX2g3 u1utRqRpvuNeSlJQPoGkgDo+ZnU2S1//S7ac8jmF/kKthPMsSeeP1Dzr+RAsV6ZAlNzv oDvfNmSoVFz2T/kpYoGRYzQa6twbrjbrw63Zc7aULaR9aJat+TRHPWEYWI4CKVvJt9sD FQACextl1R3cLTCE6lTANNm29RpjRzcNh+ugannJvWdGsinxs35TIZMvC3EqreyrWuGb KATLpccyYHi/lPkoZduq/gyapa4bQYZGvgnuxHQ5WqR/9WllhHhitfY9SO5Mafdhw+0m KR1w== X-Forwarded-Encrypted: i=1; AJvYcCWNT2OIFIH4iInrCslB6cNfssvADdyhTnY5C0rVGPa5Y9u9pM6CC92P7BrPXQPD8JupjrCsTjijnIzepUw=@vger.kernel.org, AJvYcCXLLPIn50ColZrzg13cYRaC8Gyzbmbk5TlukUGmmQPZjWyE9Yin9vV5SQywngb+hN6cjJWgkXU7FWpwOIn6qXs=@vger.kernel.org X-Gm-Message-State: AOJu0Yw7Y+osSPwMkGbMAp6KD9snHH8oCeHbUMd3WTfL7yaeesH+QEFA AdRXS/x7tEug1UbKhwyF5l60oH2zPIpgVwuluRIumjTyLj8Hro6O X-Gm-Gg: ASbGncupisqhbvecJwo9Z3j/z7Bnu1iuOvTF5a+XQmdwL6iIrBfAtE42mdT7WgaPTSb qh04OWH4hKGwvIGYhxlD/yuSf8NJMATxu0HAF+8LmBMV0HQQKpkrZRyjbWEvNL9JQpphYV8V5hE 5WM1odKoyoazVkStDqOYm45v7nx9VBHFj4N6WGQkNbGzetrWAAeptoTMF0XmnnR25IelkNdDelB 7i54/YXz6nfwweQsJwCVnvVLIp4wHQcXKwBTjsrGFw0oEt5cpTVe0dmkhkVmqwGjsY8gDV7XEpn Ccp9lS8R1Ty1tH/zS6bdvcl9Isrc6l3fB58eZRConGs3kV8xST/y+bqU8hLZjpCuOA5ZEUF7c/c tWqUAwg9HkzagsyDh/vh2Nn6n X-Google-Smtp-Source: AGHT+IG8J+N7uHkRhbfsCpNHhQICPanAFtIppZ/l1d+b/Z8KQjinFkh/mFY5x6xjgxw+OUhJCMvNzw== X-Received: by 2002:a05:620a:1708:b0:7a8:554:c368 with SMTP id af79cd13be357-7c068f8a167mr43811285a.6.1739210161370; Mon, 10 Feb 2025 09:56:01 -0800 (PST) Received: from 1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa ([2620:10d:c091:600::1:cc94]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7c041e11d19sm548788885a.52.2025.02.10.09.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 09:56:00 -0800 (PST) From: Tamir Duberstein Date: Mon, 10 Feb 2025 12:55:54 -0500 Subject: [PATCH 2/2] scripts: generate_rust_analyzer.py: add uapi crate Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250210-rust-analyzer-bindings-include-v1-2-6cbf420e95b6@gmail.com> References: <20250210-rust-analyzer-bindings-include-v1-0-6cbf420e95b6@gmail.com> In-Reply-To: <20250210-rust-analyzer-bindings-include-v1-0-6cbf420e95b6@gmail.com> To: Miguel Ojeda , Alex Gaynor , Boqun Feng , Gary Guo , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Kees Cook , Fiona Behrens , Martin Rodriguez Reboredo , Asahi Lina Cc: Boris-Chengbiao Zhou , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Tamir Duberstein X-Mailer: b4 0.15-dev Commit 4e1746656839 ("rust: uapi: Add UAPI crate") did not update rust-analyzer to include the new crate. Add the missing definition to improve the developer experience. Fixes: 4e1746656839 ("rust: uapi: Add UAPI crate") Signed-off-by: Tamir Duberstein --- scripts/generate_rust_analyzer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_anal= yzer.py index 1f573d19cd99..ee4f01ada277 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -105,6 +105,7 @@ def generate_crates(srctree, objtree, sysroot_src, exte= rnal_src, cfgs): } =20 append_crate_with_generated("bindings", ["core"]) + append_crate_with_generated("uapi", ["core"]) append_crate_with_generated("kernel", ["core", "macros", "build_error"= , "bindings"]) =20 def is_root_crate(build_file, target): --=20 2.48.1