From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D2E434107F for ; Mon, 20 Apr 2026 16:25:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776702315; cv=none; b=lllLeSxMTGuApoPBAOlgdq1wn76wNUlmOQpYxTO+Zo/IE62Do/IlebgyYsBETBPZUMgzxQu8xtNZDl6lCoGAXQ98ZfgYL6QSFYNEHv21QNDSdxdIIlhguwQ4j2L+WpCG3F28QstacGLTnMe0/gG0KUAuvkQBfiIwZWPioj3hT50= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776702315; c=relaxed/simple; bh=nkikaXbuQw00EBqlS6zJ4SxfxibN+blVhL323O1n/3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jwLz7Vriads2kYjCehZvnIiJWe9aGYfeMz1B/439SwtF+JUU+RQpeB5QaQKlgV0w7wjKY/EyHYquQEae3nmV6Bv7AGTincoV3peu9ZIsxtuFdKcn7pbEON0s2mdUc9pop64lyPiL3nYRdmAaduMuPW8Ivto5Yhb9+QIcVX5pKKk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Djk62cDk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Djk62cDk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 399BDC19425; Mon, 20 Apr 2026 16:25:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776702314; bh=nkikaXbuQw00EBqlS6zJ4SxfxibN+blVhL323O1n/3I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Djk62cDkewi+7L0V1eqLYdTkWQZYd4u9lnSdx0vQ6uUnv4n/zXV7VFpnM9KM050sC 78t7GqIOpljL/ox5laQ9RgIPqhPDSLgP6BNrxh7KIrtcT+UxviVWazDYFQYVXcKy6B fh48MxT5kWvYgaBwB7TwkkHNoKei87W3GQZQD6UT8MtNea1YRnmNWLohY4x0bk+8nd eI7u3g1ExUEC6dUoaXH+5H8NOFBbnCvpwoUpUZVN8FUnDLVNiVvTuVA6V9dgt8Gfv5 yX8N2DRi/4QRJuWUes7FU6FYsCCNvA1PnG8PVEg8BO9Y+VQQbR7OJ5xN1Nqz67lt3W RF+JwVnX40pfQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Tamir Duberstein , Daniel Almeida , Fiona Behrens , Trevor Gross , Sasha Levin Subject: [PATCH 6.6.y] scripts: generate_rust_analyzer.py: define scripts Date: Mon, 20 Apr 2026 12:25:12 -0400 Message-ID: <20260420162512.1267976-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026042047-drizzly-oblivious-029f@gregkh> References: <2026042047-drizzly-oblivious-029f@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Tamir Duberstein [ Upstream commit 36c619f6bd793493294becb10a02fea370b67a91 ] Add IDE support for host-side scripts written in Rust. This support has been missing since these scripts were initially added in commit 9a8ff24ce584 ("scripts: add `generate_rust_target.rs`"), thus add it. Change the existing instance of extension stripping to `pathlib.Path.stem` to maintain code consistency. Fixes: 9a8ff24ce584 ("scripts: add `generate_rust_target.rs`") Cc: stable@vger.kernel.org Reviewed-by: Daniel Almeida Reviewed-by: Fiona Behrens Reviewed-by: Trevor Gross Link: https://patch.msgid.link/20260122-rust-analyzer-scripts-v1-1-ff6ba278170e@kernel.org Signed-off-by: Tamir Duberstein [ changed `[std]` dep to `["std"]` and kept untyped `is_root_crate()` ] Signed-off-by: Sasha Levin --- scripts/generate_rust_analyzer.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py index 99d5b177a43c6..92534fafdf564 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -119,6 +119,18 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): "exclude_dirs": [], } + scripts = srctree / "scripts" + makefile = (scripts / "Makefile").read_text() + for path in scripts.glob("*.rs"): + name = path.stem + if f"{name}-rust" not in makefile: + continue + append_crate( + name, + path, + ["std"], + ) + def is_root_crate(build_file, target): try: return f"{target}.o" in open(build_file).read() @@ -134,7 +146,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs): for folder in extra_dirs: for path in folder.rglob("*.rs"): logging.info("Checking %s", path) - name = path.name.replace(".rs", "") + name = path.stem # Skip those that are not crate roots. if not is_root_crate(path.parent / "Makefile", name) and \ -- 2.53.0