diff options
author | Ian Rogers <[email protected]> | 2023-10-09 11:39:03 -0700 |
---|---|---|
committer | Namhyung Kim <[email protected]> | 2023-10-12 10:01:55 -0700 |
commit | 9e56d3be4bfd2ec6433a7c44195bd1e687b8ed2e (patch) | |
tree | e7a96bbb49e0f6bbbfe68f685c0fd410bcc13bdd | |
parent | 52c15e7e792857c42b4a926e45228e981c5a5f13 (diff) |
gen_compile_commands: Sort output compile commands by file name
Make the output more stable and deterministic.
Signed-off-by: Ian Rogers <[email protected]>
Reviewed-by: Nick Desaulniers <[email protected]>
Cc: Ravi Bangoria <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Yang Jihong <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Adrian Hunter <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Huacai Chen <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Nathan Chancellor <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Kan Liang <[email protected]>
Cc: [email protected]
Cc: Ming Wang <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Tom Rix <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Namhyung Kim <[email protected]>
-rwxr-xr-x | scripts/clang-tools/gen_compile_commands.py | 2 |
1 files changed, 1 insertions, 1 deletions
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__': |