rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.79k stars 314 forks source link

Empty compile_commands.json for building bitcoind #382

Closed SwJay closed 3 years ago

SwJay commented 3 years ago

Describe the bug Bear produces empty json for bitcoind. Actually, I've built it before using bear. Then I run make clean and build it again with bear, but it gives empty json again. Finally I start from git clone to get a clean workspace and build it with bear from beginning, but it still yields empty json file.

To Reproduce Steps to reproduce the behavior:

  1. git clone git@github.com:bitcoin/bitcoin.git
  2. install dependencies for bitcoind according to its doc.
  3. build with bear
    bear ./autogen.sh
    bear ./configure
    bear make

Expected behavior non-empty json file.

Environment:

Additional context

Before you send...

rizsotto commented 3 years ago

Thanks for the report @SwJay . Is there any way you could use the latest version of Bear? (The version you are using is about 4 years old.)

And either way (if you are using the new one or the old) I'll need some logs in order to help you. Could you attach the output of a verbose run? Or you can try to debug yourself, it's not that difficult. (It first intercepts the executed commands, then it try to recognize if it was a compiler call. Empty output means any of them is failing.)

SwJay commented 3 years ago

Thanks for your reply, and I'll try with the latest version first. If I failed to debug myself, I'll upload the log file and seek for help. Thanks!

SwJay commented 3 years ago

@rizsotto I've checked that the version 2.3.11 is the latest package on ubuntu 18.04. I built with bear [3.0.11] on macOS and it produces perfect json file. For the original issue, I reproduced the process and have log files here corresponding to three building steps.

rizsotto commented 3 years ago

I'm glad that you could use Bear to generate the desired JSON compilation database.

I'm closing this issue then. The newlocal errors are fixed since 2.3.11. :)