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: <20190620192345.GA133204@google.com>
Date:   Thu, 20 Jun 2019 12:23:45 -0700
From:   Tom Roeder <tmroeder@...gle.com>
To:     Matthias Kaehlcke <mka@...omium.org>
Cc:     Masahiro Yamada <yamada.masahiro@...ionext.com>,
        linux-kernel@...r.kernel.org, Raul E Rangel <rrangel@...omium.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Tom Hughes <tomhughes@...omium.org>,
        Douglas Anderson <dianders@...omium.org>,
        Ryan Case <ryandcase@...omium.org>, Yu Liu <yudiliu@...gle.com>
Subject: Re: [PATCH] gen_compile_command: Add support for separate
 KBUILD_OUTPUT directory

I can confirm that I can still run clang-tidy on the kernel using this
new version of the script; it generates a version of
compile_commands.json that works in my case.

On Thu, Jun 20, 2019 at 11:45:23AM -0700, Matthias Kaehlcke wrote:
> gen_compile_command.py currently assumes that the .cmd files and the
> source code live in the same directory, which is not the case when
> a separate KBUILD_OUTPUT directory is used.
> 
> Add a new option to specify the kbuild output directory. If the
> option is not set the kernel source directory is used.
> 
> Signed-off-by: Matthias Kaehlcke <mka@...omium.org>
Reviewed-by: Tom Roeder <tmroeder@...gle.com>
Tested-by: Tom Roeder <tmroeder@...gle.com>

> ---
> Feel free to bikeshed about the option names ;-)
> 
>  scripts/gen_compile_commands.py | 28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
> 
> diff --git a/scripts/gen_compile_commands.py b/scripts/gen_compile_commands.py
> index 7915823b92a5..5a738ec66cc7 100755
> --- a/scripts/gen_compile_commands.py
> +++ b/scripts/gen_compile_commands.py
> @@ -31,15 +31,21 @@ def parse_arguments():
>  
>      Returns:
>          log_level: A logging level to filter log output.
> -        directory: The directory to search for .cmd files.
> +        source_directory: The kernel source directory.
> +        kbuild_output_directory: The directory to search for .cmd files.
>          output: Where to write the compile-commands JSON file.
>      """
>      usage = 'Creates a compile_commands.json database from kernel .cmd files'
>      parser = argparse.ArgumentParser(description=usage)
>  
> -    directory_help = ('Path to the kernel source directory to search '
> +    directory_help = ('Path to the kernel source directory'
Minor detail: this needs a space after "directory" so that it reads
"directory '". Otherwise, the output doesn't have a space before the
parenthesis.

>                        '(defaults to the working directory)')
>      parser.add_argument('-d', '--directory', type=str, help=directory_help)
> +    kbuild_output_directory_help = ('Path to the directory to search for '
> +                                    '.cmd files'
Same comment here: this should be "files '", with a space before the
ending quote character.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ