Skip to content

compile_commands.json is large! Could we make it smaller? #6

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

Closed
cpsauer opened this issue Nov 17, 2021 · 1 comment
Closed

compile_commands.json is large! Could we make it smaller? #6

cpsauer opened this issue Nov 17, 2021 · 1 comment

Comments

@cpsauer
Copy link
Contributor

cpsauer commented Nov 17, 2021

Sure is. [It's ~260MB on the main Hedron repo.]

Why? It contains a description of all the ways how every file is compiled, including headers included in lots of compilations. We're hoping that, at least temporarily, you can spare the disk space.

Need it smaller? There are things we can do but we intentionally haven't because we anticipate that this problem will be temporary. The easiest thing would be to modify refresh.template.py to only output the first entry per file. Since clangd currently chooses just one command per file anyway, this shouldn't hurt usability. We haven't done this already because clangd will hopefully not need compile commands for headers in the future, and will hopefully take advantage multiple compile commands per file. The size without headers is only a couple MB, and without duplicate files, 16MB.

@cpsauer
Copy link
Contributor Author

cpsauer commented Apr 7, 2022

If we need to do more, we could omit headers whose unambiguously-closest source file uses the same command. Clangd will already infer those correctly.

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

No branches or pull requests

1 participant