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 A44B92C11C6 for ; Mon, 20 Apr 2026 16:05:52 +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=1776701152; cv=none; b=COU5oAZF0UgFxQRnfJWrdhaXWMQ30qBlOvNCL6WWnyME0TnNZw28nq0ohqzHcxr9iCUpqfOyCwhm9cRvOWivbuAKd9wjOWiW4MXhpiJrFdOM/ggpg0hUw7tUyr0dahEPV7rlUAz8BXQjRiUAQ9GcREkx4HZpGSBtSUm2oXQ5Leg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776701152; c=relaxed/simple; bh=1nWqsysMeAMaMFwnMMoWilObOiKO9FEV91o6ulwwoMw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JscpvcGgXKKb6NXI7/w3VpErwAZXPnx9Dk3QRR48PohaY8xrJfbn7V4ssKai82GIik8XlPsVcLW706VML9PHv5pGC53H9GCdgGVUqx+JGuTl0T/RSQp5VjQpKM+yZvHkrX8/NBpqqeOr46akjVg5HKykoqYfYdkpI7YOGuSe7U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Da0EpII3; 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="Da0EpII3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D32C2C2BCB4; Mon, 20 Apr 2026 16:05:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776701152; bh=1nWqsysMeAMaMFwnMMoWilObOiKO9FEV91o6ulwwoMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Da0EpII35XQsRxhEqfPusVK24HB5sga7H4/9lTT9kqHjeUFGhgYOxoX3XW3BCEhda ZtoaO0KQxBIs8HnvcV99eR4Q1s+8A/4YztcHi2gRJFYbBUhlk2ELeMSE6FRgVne9PZ aou35yuDut7tPvJWZWRHNoZcl9sexGBje3ZBoRTBIp9FfgJbK4V9WHn2ms2GhZlX9t 7vrSc4KOKCxFUyDteV09AOx3a2W45/uShOdc5WVEx1WvZKB/2Fnj0Y7mD0sTALnwu4 85tBrWGCrMIb9vwiMDtll+xqmvpBUU9OkBk87l65O4TQFDvUrSaZUEIsMeErEu43gh mAPUqvMbiwTiQ== From: Sasha Levin To: stable@vger.kernel.org Cc: Tamir Duberstein , Daniel Almeida , Fiona Behrens , Trevor Gross , Sasha Levin Subject: [PATCH 6.18.y] scripts: generate_rust_analyzer.py: define scripts Date: Mon, 20 Apr 2026 12:05:50 -0400 Message-ID: <20260420160550.1184938-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026042046-underfeed-riding-d661@gregkh> References: <2026042046-underfeed-riding-d661@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 852444352657e..1016f857f7be2 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -166,6 +166,18 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit append_crate_with_generated("uapi", ["core", "ffi", "pin_init"]) append_crate_with_generated("kernel", ["core", "macros", "build_error", "pin_init", "ffi", "bindings", "uapi"]) + 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() @@ -181,7 +193,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit 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