From: "Jesung Yang" <y.j3ms.n@gmail.com>
To: "Tamir Duberstein" <tamird@kernel.org>,
"Jesung Yang" <y.j3ms.n@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
"Nathan Chancellor" <nathan@kernel.org>,
"Nicolas Schier" <nsc@kernel.org>,
"Linux Kbuild mailing list" <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH v2 2/2] scripts: generate_rust_analyzer.py: reduce cfg plumbing
Date: Thu, 22 Jan 2026 08:12:01 +0900 [thread overview]
Message-ID: <DFUNBMAPQS6Z.4RPBKCCKCMIA@gmail.com> (raw)
In-Reply-To: <CAJ-ks9nVxs5aGWPO5m=7GBjEE+Rn_qS_Yg0HD6qc5=Na6-K9OQ@mail.gmail.com>
On Wed Jan 21, 2026 at 11:13 PM KST, Tamir Duberstein wrote:
> On Tue, Jan 20, 2026 at 8:16 PM Jesung Yang <y.j3ms.n@gmail.com> 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 that
>> > these are passed from `rust/Makefile`.
>> >
>> > Signed-off-by: Tamir Duberstein <tamird@kernel.org>
>> > ---
>> > 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, external_src, cfgs, core_edit
>> > crates_indexes = {}
>> > crates_cfgs = args_crates_cfgs(cfgs)
>> >
>> > - def append_crate(display_name, root_module, deps, cfg=[], is_workspace_member=True, is_proc_macro=False, edition="2021"):
>> > + def append_crate(display_name, root_module, deps, cfg=None, is_workspace_member=True, is_proc_macro=False, edition="2021"):
>> > + if cfg is None:
>> > + cfg = 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-40e67fe5c38a@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 <y.j3ms.n@gmail.com>
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-40e67fe5c38a@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-829e4e92818c@nvidia.com/
I assume you would prefer merging [1] first? Please let me know if I'm
missing something.
Thanks!
Best regards,
Jesung
next prev parent reply other threads:[~2026-01-21 23:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-20 16:10 [PATCH v2 0/2] rust: reduce duplicate information Tamir Duberstein
2026-01-20 16:10 ` [PATCH v2 1/2] rust: kbuild: extract configs for reuse Tamir Duberstein
2026-01-26 4:15 ` Miguel Ojeda
2026-01-20 16:10 ` [PATCH v2 2/2] scripts: generate_rust_analyzer.py: reduce cfg plumbing Tamir Duberstein
2026-01-21 1:16 ` Jesung Yang
2026-01-21 14:13 ` Tamir Duberstein
2026-01-21 23:12 ` Jesung Yang [this message]
2026-01-22 15:09 ` Tamir Duberstein
2026-01-20 19:27 ` [PATCH v2 0/2] rust: reduce duplicate information Benno Lossin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DFUNBMAPQS6Z.4RPBKCCKCMIA@gmail.com \
--to=y.j3ms.n@gmail.com \
--cc=a.hindborg@kernel.org \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=nathan@kernel.org \
--cc=nsc@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox