rizsotto / Bear

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

Bear exits without generating compile_commands.json #538

Closed f-zl closed 11 months ago

f-zl commented 11 months ago

Describe the bug I want to generate compile_commands for the linux kernel. Initially bear -- make runs well and compile_commands.sqlite3 is generated, then it is stuck for a long time after printing "Kernel: arch/x86/boot/bzImage is ready (# 2)", then it exits, removing compile_commands.sqlite3 without generating compile_commands.json or an error message. Another run of clean and make produces the same result.

To Reproduce Run bear -- make

Expected behavior compile_commands.json is generated

Environment:

Additional context

The last few lines are:

[14:36:36.692252, wr, 1767, ppid: 1762] Process wait request: done. [pid: 1772] [14:36:36.692287, wr, 1767, ppid: 1762] gRPC call requested: supervise::Interceptor::Register [14:36:36.696653, wr, 1767, ppid: 1762] gRPC call [Register] finished: true [14:36:36.696881, wr, 1767, ppid: 1762] succeeded with: 0 [14:36:36.696915, el, 1767] lib.cc; on_unload [14:36:36.697550, ic, 1762] Process wait request: done. [pid: 1767] [14:36:36.697612, ic, 1762] Running command. [Exited with 0] [14:36:36.697621, ic, 1762] Stopping gRPC server. [14:36:36.698169, ic, 1762] succeeded with: 0 [14:36:36.700024, br, 1761] Process wait request: done. [pid: 1762] [14:36:36.700094, br, 1761] Running intercept finished. [Exited with 0] [14:36:36.700441, br, 1761] Process spawned. [pid: 16211, command: [/usr/bin/citnames, --input, compile_commands.sqlite3, --output, compile_commands.json, --run-checks, --verbose]] [14:36:36.700503, br, 1761] Process wait requested. [pid: 16211] [14:36:36.707692, cs, 16211] citnames: 3.0.8 [14:36:36.707759, cs, 16211] arguments: ["/usr/bin/citnames", "--input", "compile_commands.sqlite3", "--output", "compile_commands.json", "--run-checks", "--verbose"] (environment) [14:36:36.707792, cs, 16211] sysname: Linux [14:36:36.707796, cs, 16211] release: 5.15.90.1-microsoft-standard-WSL2 [14:36:36.707799, cs, 16211] version: #1 SMP Fri Jan 27 02:56:13 UTC 2023 [14:36:36.707802, cs, 16211] machine: x86_64 [14:36:36.707809, cs, 16211] arguments parsed: {program: /usr/bin/citnames, arguments: [{--input: [compile_commands.sqlite3]}, {--output: [compile_commands.json]}, {--run-checks: []}, {--verbose: []}]} [14:36:36.707933, cs, 16211] Configuration: {"compilation":null,"output":{"content":{"include_only_existing_source":true},"format":{"command_as_array":true,"drop_output_field":false}}}

Before you send...

rizsotto commented 11 months ago

Please use a recent version of this tool... Kernel compilation had issues before 3.0.11 version. Those issues are fixed since. (3.0.8 is more than 2 years old now.)