lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72m66PbmDmGUoQecOzJRSFg+G+3KKGkkqS3ySNAPxCe1Ag@mail.gmail.com>
Date:   Thu, 19 Jan 2023 20:12:56 +0100
From:   Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To:     Vinay Varma <varmavinaym@...il.com>
Cc:     Masahiro Yamada <masahiroy@...nel.org>,
        Michal Marek <michal.lkml@...kovi.net>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Miguel Ojeda <ojeda@...nel.org>,
        Alex Gaynor <alex.gaynor@...il.com>,
        Wedson Almeida Filho <wedsonaf@...il.com>,
        Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
        Björn Roy Baron <bjorn3_gh@...tonmail.com>,
        linux-kbuild@...r.kernel.org, linux-kernel@...r.kernel.org,
        rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] scripts: `make rust-analyzer` for out-of-tree modules

On Wed, Jan 18, 2023 at 5:02 PM Vinay Varma <varmavinaym@...il.com> wrote:
>
> Adds support for out-of-tree rust modules to use the `rust-analyzer`
> make target to generate the rust-project.json file.

Thanks for sending this! A few nits below...

> When this parameter is passed, I have chosen
> not to add the non-core modules (samples and drivers) into the result
> since these are not expected to be used in third party modules.

Sounds good to me.

> changes are also made to the Makefile and rust/Makefile allowing the
> `rust-analyzer` target to be used for out-of-tree modules as well.
>
> Signed-off-by: Vinay Varma <varmavinaym@...il.com>

A `Link: ` to the GitHub PR would be nice here:
https://github.com/Rust-for-Linux/linux/pull/914.

Possibly another one to the out-of-tree approach at
https://github.com/Rust-for-Linux/rust-out-of-tree-module/pull/2.

>  import logging
>  import pathlib
>  import sys
> +import os

Please keep the `import`s sorted.

> -    for folder in ("samples", "drivers"):
> +    extra_src_dirs = ["samples", "drivers"] if external_src is None else [external_src]

If you send a v2 for the above, this could be a tuple like in the
original line, to minimize the diff.

> +            if os.path.exists(path.parent / "Makefile") and f"{name}.o" not in open(path.parent / "Makefile").read():

In Python one would typically go with the EAFP style instead
(https://docs.python.org/3/glossary.html#term-EAFP), which would also
reduce the duplication of the path computation. But it would take more
lines... Not a big deal in any case.

Thanks!

Cheers,
Miguel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ