rizsotto / Bear

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

Is it possible to run Bear via manual LD_PRELOAD? #441

Closed yugr closed 2 years ago

yugr commented 2 years ago

I'm trying to collect compilation database in a package build system (pbuilder) environment. Unfortunately the build infrastructure does not provide control over build command so I can not simply apply bear to it:

$ bear make clean all

I do have control over environment variables though so I could set LD_PRELOAD by hand prior to running the build. I this possible? If yes, could this scenario be added to docs?

rizsotto commented 2 years ago

Hey @yugr , this is a good question. I don't think the LD_PRELOAD itself can help you out to solve the pbuilder limitation. (Definitely not with the 3.x versions, maybe with the 2.4 version.)

I made these suggestion without really know how pbuilder works. (I did try this with arch linux package maker though.)