Re: [PATCH v5 13/13] scripts: generate_rust_analyzer.py: use `cfg_groups`
From: Trevor Gross
Date: Thu Apr 17 2025 - 03:32:59 EST
On Tue, Mar 25, 2025 at 3:07 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> Declare common `cfg`s just once to reduce the size of rust-analyzer.json
> from 30619 to 2624 lines.
>
> Link: https://github.com/rust-lang/rust-analyzer/commit/2607c09fddef36da0d6f0a84625db5e20a5ebde3
> Reviewed-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> Tested-by: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx>
> Signed-off-by: Tamir Duberstein <tamird@xxxxxxxxx>
> ---
> scripts/generate_rust_analyzer.py | 19 ++++++++++---------
> 1 file changed, 10 insertions(+), 9 deletions(-)
> @@ -76,6 +70,7 @@ def generate_crates(
> "root_module": str(root_module),
> "is_workspace_member": is_workspace_member,
> "deps": deps,
> + "cfg_groups": cfg_groups if is_workspace_member else [],
Does r-a just expect cfg_groups for workspace members or is there
logic here? Maybe worth a comment.
Reviewed-by: Trevor Gross <tmgross@xxxxxxxxx>