From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f194.google.com (mail-pf1-f194.google.com [209.85.210.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 230604611E9 for ; Wed, 21 Jan 2026 23:12:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.194 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769037137; cv=none; b=OR5cbaRTpGOvP25FvHzQRhalyaWnLFdzx26cas7iJZ0abhtr/40AFeThdOI5FmiUbDQi1Lq/SnJXtmFC1Ok9OviX1ObVvaLcFj32J3fe0aTaE5cVCGfluQaFilaJ7vgkElG2RQL7yRfXIC5xVPH0NcnmNaRoL9WNqKT9Wcv8H9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769037137; c=relaxed/simple; bh=nicC8+jQs+KtIj72y7cCmjx0QatbClmM3BMjEzyUHcI=; h=Mime-Version:Content-Type:Date:Message-Id:To:Cc:Subject:From: References:In-Reply-To; b=jE6rTYM5JmQtyCKdE1ypjRKVc+rOeEVKU5Aedc3lXKopjdnFeFfxJjVc0UtOXnWbVdN/r1UvcBECQsOzmKy9EBI5XlHkRW0DOTvZ8S50M4ipnfQPtGNIF1pcrwD0n3rbWOWC7uA0jK0bsjWUIWYqDR/rfjjySqA4SYYHD5+eLHc= 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=JInWRjBb; arc=none smtp.client-ip=209.85.210.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="JInWRjBb" Received: by mail-pf1-f194.google.com with SMTP id d2e1a72fcca58-81f3fba4a11so399978b3a.1 for ; Wed, 21 Jan 2026 15:12:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769037126; x=1769641926; darn=vger.kernel.org; h=in-reply-to:references:from:subject:cc:to:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Sc/mNIGKOkGXOmNQcditc1e06kj6bQ3nXqqocKQMT1g=; b=JInWRjBbfSs0kDty3rjrdtYrcZcctlA+ZclKrWtQWO4t9rHzosxzNQl68ytW5ecIfa YjRS9Ok0gDKYye6VqgRDYBCGd0YReu/isWO+0E4WAD8rbFwqGMCA/9d/sUubwVaLSVI4 lBE2w5loWbHfkvVwF863Fn4JacA+3ujiSL1uGETqTmzBl3xmaDjv4/kjyhVPTOhI8XAG AAQtdAttOI82UkfV5HeW53PHm/ptbn1uF9A83T/76I9jE3xY4oWwIXNiVKBki9ZfGA8Q HdkWwLskMTD1jn1EeG8jMPL12SZI02ABZbyNrFzzLGMh9XlrZZBLEQDp/m193g8MpWPK YbgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769037126; x=1769641926; h=in-reply-to:references:from:subject:cc:to: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=Sc/mNIGKOkGXOmNQcditc1e06kj6bQ3nXqqocKQMT1g=; b=BqTA0vWSMARRSDMlmZHvNsqNYK4uNy1LD44PLJQ7qJOPjGrjxqNTa9+F6YSzWSel6W LcsXzQ+feXjM9IpduOdgwXJwSurae554QhHZiWwtP92uv9hGjdv9Stawo7wAm+Uktt44 bdC2/XpNSdXKCDmRo2DD0XMmjiNkTzPZ8BRjcEc6hO3yEnVEIA0E5q9r7gaAXltbj2lL eoZj7rdEcPe1wMX9X2gWc7zubq3eUjOw3PvX9DlSO51QFx3uAE8l6CKcSkejgtAcec6k FbqB5crJFpoUTqxgSmVGt2s0+h7uZtJVwP1Zl6bFHDREsEYwGNnylJhdoviXCKgWVgW8 S1Aw== X-Forwarded-Encrypted: i=1; AJvYcCVxBlMbZgqKbxBv/8dxD3Mz99aXPlxxizpG7ywBfoNygYuVvFphqPzBwsqIOcxgAb6WNNtZzUsXlfT6gcM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxk39CoNcRX1c3iEOLTheUcfmqrgCeHCf8VH+rO28jyVbhjBNHr AxdHgmLFbEJUjWlcCsYZxG96+g7fr/x3XWl3TZeZHvHIwWb4vRDZQo6u X-Gm-Gg: AZuq6aKhteb8fo8e4kLqDaNKdRYsRcRFQAWsNc4Lf7HOfYvnEMBxHXBAR684E0VNaDI Co/5/7RiHznoI+33maZtprqAFr/8h5rvr2Ao5Ds5/hSNx9U7cW6ckWCd0Y3AjMyqEm3IfF2A9F6 WvHXJnUMwOlfI7HVKI8MLtmnBEQYzVIgZZLDNHqeVJoRxikkaniE9DeOObZCAuB3bTAYs2BlOxI /2yLZS/hqyUEqk5Bt8eMUXDGWlRb5ejH5vzqER52RjUauuN829nijhgJJG7HhBA0XNuRjRUeHWF Puz0MIAeyQp9pIAT0kx5YepXv1RjQ38GHvub4F/sXbVcKIKr8iU+akFiH/n1o7uxA6yvIXv1n8+ vic9599QO8CQIcLv1JUizhVnPkltddpGeo8Rj4uTwneLPjaza7s7i15+cr8brL4pLKHn1IBV5ei SWfWD3Ug== X-Received: by 2002:a05:6a21:9988:b0:38b:ec0d:51ed with SMTP id adf61e73a8af0-38e45e8d3dfmr7094344637.69.1769037126245; Wed, 21 Jan 2026 15:12:06 -0800 (PST) Received: from localhost ([112.149.32.52]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3533527bacesm499552a91.17.2026.01.21.15.12.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Jan 2026 15:12:05 -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: Thu, 22 Jan 2026 08:12:01 +0900 Message-Id: To: "Tamir Duberstein" , "Jesung Yang" 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" , "Linux Kbuild mailing list" Subject: Re: [PATCH v2 2/2] scripts: generate_rust_analyzer.py: reduce cfg plumbing From: "Jesung Yang" X-Mailer: aerc 0.21.0 References: <20260120-rust-analyzer-pin-init-duplication-v2-0-a1c76f0d3bef@kernel.org> <20260120-rust-analyzer-pin-init-duplication-v2-2-a1c76f0d3bef@kernel.org> In-Reply-To: On Wed Jan 21, 2026 at 11:13 PM KST, Tamir Duberstein wrote: > On Tue, Jan 20, 2026 at 8:16=E2=80=AFPM Jesung Yang = wrote: >> On Wed Jan 21, 2026 at 1:10 AM KST, Tamir Duberstein wrote: >> > Centralize `cfg` lookup in `append_crate` to avoid having to do so for >> > each crate. Remove hardcoded `cfg`s for `pin-init{,-internal}` now tha= t >> > these are passed from `rust/Makefile`. >> > >> > Signed-off-by: Tamir Duberstein >> > --- >> > scripts/generate_rust_analyzer.py | 13 +++++-------- >> > 1 file changed, 5 insertions(+), 8 deletions(-) >> > >> > diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust= _analyzer.py >> > index 147d0cc94068..b96d3cbe3df1 100755 >> > --- a/scripts/generate_rust_analyzer.py >> > +++ b/scripts/generate_rust_analyzer.py >> > @@ -35,7 +35,9 @@ def generate_crates(srctree, objtree, sysroot_src, e= xternal_src, cfgs, core_edit >> > crates_indexes =3D {} >> > crates_cfgs =3D args_crates_cfgs(cfgs) >> > >> > - def append_crate(display_name, root_module, deps, cfg=3D[], is_wo= rkspace_member=3DTrue, is_proc_macro=3DFalse, edition=3D"2021"): >> > + def append_crate(display_name, root_module, deps, cfg=3DNone, is_= workspace_member=3DTrue, is_proc_macro=3DFalse, edition=3D"2021"): >> > + if cfg is None: >> > + cfg =3D crates_cfgs.get(display_name, []) >> >> Could we add a brief comment explaining how the behavior of >> `append_crate` changes according to the `cfg` parameter? Since `None` >> and an empty list have different effects, documenting that distinction >> would make the intended behavior clearer. > > I don't think this is necessary - it won't age well when we change the > entire API surface here in the next version of the series[0] that adds > type annotations. > > Link: https://lore.kernel.org/all/20250424-rust-analyzer-host-v6-0-40e67f= e5c38a@gmail.com/ > [0] > >> This would also help later when we add proper Python docstrings. > > Same as above: a lot of change is coming. Is this worth considering right= now? Fair point, thanks for the context. Reviewed-by: Jesung Yang By the way, could you share your plan for upcoming major changes? It would help me prepare and align my series if I know the intended direction. I currently have these on my radar: [1] https://lore.kernel.org/all/20250424-rust-analyzer-host-v6-0-40e67fe5= c38a@gmail.com/ [2] https://lore.kernel.org/rust-for-linux/20260109-ra-fix-primitive-v2-0= -249852a4145a@gmail.com/ [3] https://lore.kernel.org/rust-for-linux/20260120-ra-fix-v1-0-829e4e928= 18c@nvidia.com/ I assume you would prefer merging [1] first? Please let me know if I'm missing something. Thanks! Best regards, Jesung