Skip to content

Reevaluate the need for version controlling compile_commands.json

#1245 (closed) introduced the compile_commands.json file into the repository, along with the CI jobs to check and update this file. While I think the idea is interesting, we should probably re-evaluate whether we actually want to version control this file.

  • What is the benefit we get from version controlling this file?
  • Why is it not sufficient for our build process to generate this on the fly?

At the moment, we have a job that checks these compile commands, but this runs after the build. Meaning that developers basically always have to run half the pipeline twice if we want to keep this file updated.

  1. Pipeline starts
  2. Developer waits ~7 minutes for the build to complete
  3. The compile_commands.json file is incorrect
  4. The developer has to trigger the update job
  5. The entire pipeline has to run again from scratch

In addition to this, because the job is allowed to fail, we have no guarantee that whatever is on the main branch is correct.

IMO we should not be version controlling this file unless we have a very good reason to do so; it creates too much friction in the development workflow.