Bear icon indicating copy to clipboard operation
Bear copied to clipboard

compilation_database.json is empty

Open SoloAs opened this issue 2 years ago • 0 comments

Describe the bug Compilation database JSON has no content, just "[]"

To Reproduce Steps to reproduce the behavior: running bear to build sources via Makefile right after cleaning up previous build artifacts.

Expected behavior compile_database.json contains all the necessary data. Environment:

  • OS name: Linux
  • OS version: CentOS Linux release 7.7.1908
  • OS architecture: x86_64
  • Bear version: bear 3.0.20
  • Bear install method: from the *nix package: https://search.nixos.org/packages?channel=22.05&show=bear&from=0&size=50&sort=relevance&type=packages&query=bear

Additional context

  • Can you give us a reference to the project that you are running against this tool? Main project is closed, test application is very simple and contains two .c files with one header being built using Makefile. Basically, this: https://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/
  • What build tools this project is using? Autotools for the main project, GNU Make 4.3 for simple test application, both have the same problem.
  • What architecture you are trying to compile for? x86_64, not cross-compiling.
  • Could you attach build logs? If you can re-run the command which failed (e.g. bear -- make) with extra verbose log switches (e.g. bear --verbose -- make) and send the output of it, that would help a lot. - attaching logs to this message: bear.log

Also I'm using *nix shell to setup all the necessary environment and packages. SELinux is disabled:

[nix-shell:~/projects/pro-av-clean/modules/mint/test]$ sestatus | grep 'SELinux status'
SELinux status:                 disabled

Compilers seem to be set up correctly:

[nix-shell:~/projects/pro-av-clean/modules/mint/test]$ which cc
/nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/cc
[nix-shell:~/projects/pro-av-clean/modules/mint/test]$ which g++
/nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/g++

Please tell me if you need any additional info.

Before you send...

  • Have you read the README.md file or man bear? Yes
  • Have you looked what other open issues Bear has? Yes, as well as the most of the closed ones
  • Are you sure that the build works without Bear? Yes

SoloAs avatar Aug 11 '22 08:08 SoloAs