Re: [PATCH v4 1/2] rust: support overriding crate_name
From: Tamir Duberstein
Date: Thu Apr 02 2026 - 11:21:23 EST
On 2026-04-02 14:33:49+02:00, Alice Ryhl wrote:
> On Thu, Apr 2, 2026 at 2:23 PM Jesung Yang <y.j3ms.n@xxxxxxxxx> wrote:
>
> > On Thu, Apr 2, 2026 at 10:55 AM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
> > [...]
> >
> > Could you add type hints to `invoke_rustc` and `get_crate_name`? You can
> > run the following command to verify if it's all good:
> >
> > mypy --strict scripts/generate_rust_analyzer.py --python-version 3.9
>
> This seems to work.
>
> def invoke_rustc(args: List[str]) -> str:
> return subprocess.check_output(
> [os.environ["RUSTC"]] + args,
> stdin=subprocess.DEVNULL,
> ).decode('utf-8').strip()
>
> and
>
> def get_crate_name(path: pathlib.Path) -> str:
> return invoke_rustc(["--print", "crate-name", str(path)])
>
> Does that look ok to you? If so, perhaps Miguel can use these on apply?
>
> > Once that's done, for the script part:
> >
> > Reviewed-by: Jesung Yang <y.jems.n@xxxxxxxxx>
>
> Thanks!
>
> Alice
With the above changes and after confirming `mypy --strict
scripts/generate_rust_analyzer.py --python-version 3.9` is happy:
Acked-by: Tamir Duberstein <tamird@xxxxxxxxxx>