rizsotto / Bear

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

[This is not an issue but a question] : How about gRPC #368

Closed didier31 closed 3 years ago

didier31 commented 3 years ago

Hi László !

I've just succeeded to build Bear on OpenBSD (Yes, that's easily possible) in order to document its kernel with clang-doc.

I've run it. It seems to work well until this :

gRPC failed to connect to all addresses

I guess a server should run in background. But what am I supposed to do ?

Thanks a lot !

I can't wait for it to work :smiley:

Have a nice day Cheers

rizsotto commented 3 years ago

Hey @didier31 , thanks for the report. It's exciting to try out Bear on platform I've never tried. :) To help you I need a bit context. Which version did you installed? Did you have to make changes in the source in order to compile/install? What is the gRPC dependency version?

And it would be also helpful if you can put the exact log lines (a few lines before and after) when you run the tool in verbose mode. (So, I could picture where it fails.)

didier31 commented 3 years ago

Thank you, László for your quick response.

I thought it was a bad usage of my own. This seems not from your message.

As a result, what I have to do the best is to make run tests. Indeed, googletest has been adapted for OpenBSD 6.7 10 months ago. The last release of googletest dates from 2019. Today, I have modified third_party/googletest/CMakeLists.txt to download googletest/head. And googletest builds on OpenBSD.

Now, Bear tests build too.

I transmit to you all the stuff if mutt works ...

didier31 commented 3 years ago

Here is mods on bear code : Bear-3.0.9-wd.diff.txt

Here is $ cmake .. output : cmake.log

Here is $ make output : make.log

Here is $ make install output : make_install.log

Here is $ bear -- make output : bear_--_make.log

Here is $ bear --verbose -- make output: bear--verbose--make.log

_compilecommands.json : []

Thank you for your help Hoping it helps

rizsotto commented 3 years ago

Thanks @didier31 for the follow up!

Ok, it looks like a bug in Bear. I did not implemented the io redirects in the wrapper I am afraid. Will fix it in the next release.

didier31 commented 3 years ago

Happy to contribute to improve Bear's reliability, László :-)

rizsotto commented 3 years ago

Hey @didier31 , I'm trying to reproduce this error on my linux machine, but could not get this error.

I am looking again at the logs you've sent, and noticed these lines.

[14:33:25.454419, el, 51111] lib.cc; execvp file: /bin/sh
[14:33:25.454905, el, 51111] lib.cc; execvp failed.
/bin/sh: Bad address

What would be the reason to not able to exec /bin/sh? Is it exists? Has executable rights? Is it statically linked?

didier31 commented 3 years ago

I can't understand because all seems right :

ours# uname -a
OpenBSD ours.home 6.8 GENERIC#97 amd64
ours# which sh
/bin/sh
ours# ldd /bin/sh
/bin/sh:
    Start            End              Type  Open Ref GrpRef Name
    00000bbb6e31e000 00000bbb6e3c4000 dlib  1    0   0      /bin/sh
ours# file /bin/sh
/bin/sh: ELF 64-bit LSB shared object, x86-64, version 1
rizsotto commented 3 years ago

I was thinking more about this problem... Is there a way you can run Bear with the compiler wrappers?

bear --verbose --force-wrapper -- make would be the command. It works if the build of the project is respecting the CC and CXX environment variables. (Hardwired compiler path might not work.)

didier31 commented 3 years ago

Sorry, I've given up to use Bear. I've developed my own C crossref tool thanks to prolog DCG feature.