Closed bneradt closed 2 years ago
Hey @bneradt, thanks for your kind words.
For your problem, here is a little background information... Bear works differently on Linux and Mac. On Linux it intercept the process executions with a preloaded shared object. This trick does not work on Mac. Instead it use compiler wrapper, which reports the process executions... The compiler wrapper interposing only works with builds, which are open to override the compiler. (See these tickets: #460, #401, #375, #364, #360, or a common troubleshooting page for this kind of errors.)
From the logs you've attached, I did noticed:
bear
calls intercept
(this is expected),intercept
try to interpose the compiler wrapper for /usr/bin/clang++
(it wants to interpose /opt/homebrew/Cellar/bear/3.0.19_2/lib/bear/wrapper.d/clang++
as compiler),/usr/bin/clang++
was called directly from the build.bear
calls citnames
(this is expected),citnames
found no execution reports (means, the wrappers were never called).My suggestion would be:
CC
, CXX
environments?)pipenv
(which might reset the environment variables) pipenv run bear -- scons -j4 --with-libs=/opt
I see. Thank you for the quick reply @rizsotto. This is very helpful. I actually work with one of the contributors for Scons. I'll work with him to see if there is a way to get it to use the wrapper and report back on what I find.
I am closing it, because not much I can do with it... As we discussed this is more like the build system needs to respect the variables, or the Bear executed commands does not reset the environment variables.
Yes, that is fine to close @rizsotto. Thank you again for your previous feedback. I want to contribute to the project by documenting what can be done with scons-parts to it to use bear's wrapper scripts.
My scons-parts contact has been very busy with other build issues so I have not had the opportunity yet dig into this yet with him. I still plan to pursue this in the future and add comments here.
Describe the bug When I compile https://github.com/yahoo/proxy-verifier.git, which is built via the scons-parts build system on my Mac via Bear, I get an empty compile_commands.json:
I am building from scratch and I see the clang calls in the output (verbose logs attached).
To Reproduce
Install developer tools to get llvm and use brew to install various package dependencies.
pkg-config
,autoconf
,automake
,libtool
,pipenv
, andpython3
will be necessary.Bear
is also necesasry. :) Here is my list of installed brew packages:Once this is installed, then the following should reproduce the behavior:
This results in an empty compile_commands.json:
Expected behavior
The compile_commands.json should be populated with the build output. As a point of comparison, I get the expected compile_commands.json when I build Proxy Verifier on
Centos 7
using GCC devtoolset-9:bear_pv_works_centos_7.txt
Here is some sample, healthy compile_commands.json output:
By contrast, my Mac Scons build via Bear of proxy-verifier has an empty compile_commands.json:
Environment:
MacOS Montery, version 12.3.1
arm64
3.0.19
. I also tried with3.0.20
with the same result (emptycompile_commands.json
).brew install bear
Additional context
clang 13.1.6
arm64
bear -- make
) with extra verbose log switches (e.g.bear --verbose -- make
) and send the output of it, that would help a lot. bear_pv_build_output.txtBefore you send...
README.md
file orman bear
? YesThank you for working on this wonderful tool. I'm sorry if I'm missing something obvious.