Sarcasm / compdb

The compilation database Swiss army knife
MIT License
292 stars 23 forks source link

headerdb: don't crash if a file doesn't exist #4

Closed 3v1n0 closed 6 years ago

3v1n0 commented 6 years ago

In some meson-ninja generated files I've references of not existing files. Although this is an error, it shouldn't cause headerdb to crash.

Sarcasm commented 6 years ago

Oh thanks, will take a look.

By any chance, do you have a simple Meson based project that I could give a try to see what the generated compilation database looks like?

3v1n0 commented 6 years ago

The smallest I can think is https://github.com/jadahl/gnome-monitor-config

It has some dependency on glib, but only that ones. However it's not creating troubles. I had such issue with others.

Sarcasm commented 6 years ago

Hi,

Sorry for ignoring this PR, but I was in the middle of a rework of some compdb parts related to your issue so I wanted to finish it before going further.

Thanks to your issue, the rework now takes care of accepting missing files, it will print a warning, this may be removed later but it's printed on standard error so that should not be much of an issue.

https://github.com/Sarcasm/compdb/blob/5e5035833e046c7ee887130b5c85f5a149ee2eee/compdb/includedb.py#L109-L111