Re: [PATCH v1 02/18] gen_compile_commands: Sort output compile commands by file name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 22, 2023 at 10:35 PM Ian Rogers <irogers@xxxxxxxxxx> wrote:
>
> Make the output more stable and deterministic.
>
> Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>

Thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesaulniers@xxxxxxxxxx>

> ---
>  scripts/clang-tools/gen_compile_commands.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py
> index b43f9149893c..180952fb91c1 100755
> --- a/scripts/clang-tools/gen_compile_commands.py
> +++ b/scripts/clang-tools/gen_compile_commands.py
> @@ -221,7 +221,7 @@ def main():
>                                       cmdfile, err)
>
>      with open(output, 'wt') as f:
> -        json.dump(compile_commands, f, indent=2, sort_keys=True)
> +        json.dump(sorted(compile_commands, key=lambda x: x["file"]), f, indent=2, sort_keys=True)
>
>
>  if __name__ == '__main__':
> --
> 2.42.0.515.g380fc7ccd1-goog
>


-- 
Thanks,
~Nick Desaulniers





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux