bazel-compile-commands-extractor
bazel-compile-commands-extractor copied to clipboard
Make compile_commands.json order deterministic
Order entries in the output json file by filename, to make output deterministic.
An example of why this is useful: changes in Python, bazel, or rules_cc can all change the exact output order in compile_commands.json. When my compile commands change as a result of an upstream change in bazel or rules_cc, I would like to see what has changed. By making output order deterministic it makes it much simpler to diff the old and new compiler commands json files.