Closed FaiqueAli closed 10 months ago
Hey @FaiqueAli , two things I would say...
Thanks for the reply,
So I updated my OS and the Bear package now the current version of Bear is bear 3.0.18
with linux 22.04
and the compiler path is qcc: /home/sayedf/qnx710/host/linux/x86_64/usr/bin/qcc
Similarly the libexec.so
path
and bear --help
shows
other information:
file which make
is /home/sayedf/qnx710/host/linux/x86_64/usr/bin/make: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 4.4.162, with debug_info, not stripped
so the output of the command bear --verbose -- make -j8 all
is here
compile-op.txt
Meanwhile I was able to generate compile_commands.json
file, with this command
make clean
bear --verbose --config config.json -- make -j8 all
When I was trying multiple options.
But when I applied the same process a second time it generated an empty compile_commands.json
file.
Good to hear that you managed to install a newer version.
For the empty output on the second time, could it be that the second run was not call the compiler? (Bear builds the output from the intercepted compiler calls. You either use the --append
flag to keep the existing entries, or do a make clean
before you run it again.)
From the logs, I see that it does not recognize the qcc
compiler. This you can fix by the configuration file. (Read more about it on the man bear-citnames
page.)
Unfortunately, I forgot what other commands I executed at first time that generated the proper file, I only remember make clean
and bear -- make -j8 all
. Using these commands I am now not able to get the desired file.
Sadly I am not able to learn about configuration files as the output of the command man bear-citnames
shows
https://github.com/rizsotto/Bear/blob/master/source/citnames/man/bear-citnames.1.md is the man page in markdown.
Hi, So I created a config.json file and still getting an empty compile_command.json file, Below is the snapshot of confog.json file
Please have a look at the attached log of the command below
make clean
bear --verbose --config config.json -- make -j8 all
Just quickly looking at the config file, what stands up to me is that you put only the directory and not the compiler at compilation.compilers_to_recognize[0].executable
.
Hey, having the same issue where bear generates empty compilation database. I am on macOS (apple silicon) and installed bear through homebrew.
Works fine on my Linux VM(Fedora), just issue with macos
@parasaito , he is using Linux... the problem is he wrote /home/sayedf/qnx710/host/linux/x86_64/usr/bin
and not /home/sayedf/qnx710/host/linux/x86_64/usr/bin/qcc
. In the logs you can see lines like this, when the compilation was captured, but not recognized.
[18:21:54.073392, cs, 8712] [pid: 8682] execution: {"executable":"/home/sayedf/qnx710/host/linux/x86_64/usr/bin/qcc","arguments":["qcc","-lang-c++","-Vgcc_ntoaarch64le","-std=gnu++17", ...
[18:21:54.076061, cs, 8712] [pid: 8682] recognition failed: No tools recognize this execution.
Hi, Finally, the file is created with the required entries but the message at the end shows it is still failed bear-result.txt
[08:55:35.134201, cs, 24296] [pid: 24289] recognition failed: No tools recognize this execution. [08:55:35.134591, cs, 24296] compilation entries created. [size: 39] [08:55:35.134623, cs, 24296] compilation entries to output. [size: 39] [08:55:35.437564, cs, 24296] compilation entries written. [size: 39] [08:55:35.439112, cs, 24296] succeeded with: 0 [08:55:35.440143, br, 23160] Process wait request: done. [pid: 24296] [08:55:35.440202, br, 23160] Running citnames finished. [Exited with 0] [08:55:35.443252, br, 23160] succeeded with: 0
so is this a normal behaviour?
Secondly, I am getting some errors with clang-tidy
as it does not recognize or exclude non-user header files(system headers) using compile_commands.json
file.
is this the correct forum to discuss?
[08:55:35.132175, cs, 24296] [pid: 24289] execution: {"executable":"/home/sayedf/qnx710/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.1.0-ld","arguments":["/home/sayedf/qnx710/host/linux/x86_64/usr/bin/aarch64-unknown-nto-qnx7.1.0-ld", ...
It was not recognize the linking step as compilation. I think that's correct.
Sorry @FaiqueAli , can't help with the clang-tidy
problem.
Better to look into their doc.
Thank you for your support :)
Describe the bug I am trying to create a compile_commands.json file for my project which has a Makefile in order to execute clang-tidy. The project is being compiled using 'make -j8 all' command with and without bear. but with Bear, I am getting an empty compile_commands.json
I tried different options but had no luck.
bear -vvvv -l /usr/lib/x86_64-linux-gnu/bear/libear.so make -j8 all
bear -vvvv make -j8 all
To Reproduce Steps to reproduce the behavior:
bear -vvvv make -j8 all
Expected behavior Successful generation of compile_commands.json file.
Environment:
sudo apt-get install -y bear
(from package)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. too long to attachBefore you send...
README.md
file orman bear
? YES