Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
909 stars 99 forks source link

Irony server looks for compile_commands.json in wrong directory. #397

Open piojanu opened 7 years ago

piojanu commented 7 years ago

Hi!

I got such errors ( is valid path, but I can't show it in here):

Irony CDB: error in compilation database: (irony-server-error cannot-load-database "failed to load compilation database from directory" "/home/pjanusze/<some_path>")
Irony CDB: error in compilation database: (file-error "Opening input file" "No such file or directory" "/home/pjanusze/<some_path>/compile_commands.json")
Irony CDB: error in compilation database: (irony-server-error cannot-load-database "failed to load compilation database from directory" "/home/pjanusze/<some_path>")
Irony CDB: error in compilation database: (file-error "Opening input file" "No such file or directory" "/home/pjanusze/<some_path>/compile_commands.json")

The thing is, this path those errors report is not the one I have my compile_commands.json in (but it has some Makefile in it, does it matter?). compile_commands.json is three dirs earlier in the reported path. I tried to change path with irony-cdb-json-add-compile-commands-path (and then also execute irony-cdb-autosetup-compile-options), but it still tries to find compile_commands.json in this wrong path. I use bear (https://github.com/rizsotto/Bear) to generate this compile_commands.json file.

Can you help me? Thanks, Piotr

piojanu commented 7 years ago

Workaround: Copy compile_commands.json where irony want it to be.