Closed SoloAs closed 1 year ago
Bump!
i have the same problem. the only difference is that, if compiling via cmake, bear produces empty JSON, while if compiling via makefile without cmake, bear works well.
Hey @SoloAs , sorry for the delay... You've been running the bear --verbose --force-wrapper -- make
command, which is using compiler wrappers to intercept the compiler calls. This needs the build system to respect the CC
and CXX
environment variables.
From the log I see it was calling the /nix/store/74kv08wjf06ifgk4dxrnra4qhzr5s1w4-gcc-wrapper-10.3.0/bin/gcc
directly and not using the CC
variable (which was set to cc
).
My suggestion would be to try to change the build system (make file) to use CC
for compiling the sources. (But remove this line CC=gcc
at the top of the Makefile.)
You can also try to run without the --force-wrapper
flag. (That works better on linux. Not sure about NIX. :))
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:
Additional context
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.logAlso I'm using *nix shell to setup all the necessary environment and packages. SELinux is disabled:
Compilers seem to be set up correctly:
Please tell me if you need any additional info.
Before you send...
README.md
file orman bear
? Yes