Open Jehops opened 6 months ago
I just upgraded to 14.0-STABLE and I'm getting the same issue, just endless wrappers spawning. If I run with --force-wrapper it seems to run the Makefile and exit, but it doesn't write anything in compile_commands.json.
Thanks guys for the reporting... Yes, if the newly introduced execve
is causing the issue. (The fact that the posix_spawn
is calling execve
is the problem for this application.)
The potential workarounds are not easy with my time budget this time... Static linking of the wrapper could fix that. (A lot of work on the build system, which will not be as portable as it is today.) Instead of calling posix_spawn
the wrapper should call the execve
directly. (Seems like the cheapest solution.)
Using the --force-wapper
is the no-code-change workaround. This mode of the interception is more depending on the build system... This page might be helpful to set it up.
Unfortunately, --force-wrapper
doesn't seem to be a viable workaround. Using bear --force-wrapper -- make
on a project gives a compile_commands.json
that only contains []
.
I think it depends on the project @Jehops .
Three things have to match: the makefile should call the compiler not with an absolute path, and the compiler should have a matching wrapper (you can create a soft link), and if the compiler name is not recognized you need to register in the config file.
The link I've posted helps this to set up.
If you have a specific problem I can try to help you, but need more details.
After this commit on FreeBSD's main branch, bear will indefinitely spawn new processes.
root@15amd64-default:~ # bear --verbose -- ls
bear_ls_output_freebsd15.txt Until SIGKILL is sent, new process will be spawned indefinitely.Bear runs as expected on FreeBSD systems built prior to that commit.
root@14amd64-default:~ # bear --verbose -- ls
bear_ls_output_freebsd14.txt