Skip to content

Make compile_commands.json order deterministic #251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eklitzke
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant