Title: Failed to generate compile_commands.json · Issue #53 · j2kun/mlir-tutorial · GitHub
Open Graph Title: Failed to generate compile_commands.json · Issue #53 · j2kun/mlir-tutorial
X Title: Failed to generate compile_commands.json · Issue #53 · j2kun/mlir-tutorial
Description: I ran the command bazel run @hedron_compile_commands//:refresh_all on the latest commit (bf40cc2), and it failed to generate the compile_commands.json file. If I go back one commit, the compile_commands.json file is generated successfull...
Open Graph Description: I ran the command bazel run @hedron_compile_commands//:refresh_all on the latest commit (bf40cc2), and it failed to generate the compile_commands.json file. If I go back one commit, the compile_com...
X Description: I ran the command bazel run @hedron_compile_commands//:refresh_all on the latest commit (bf40cc2), and it failed to generate the compile_commands.json file. If I go back one commit, the compile_com...
Opengraph URL: https://github.com/j2kun/mlir-tutorial/issues/53
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Failed to generate compile_commands.json","articleBody":"I ran the command `bazel run @hedron_compile_commands//:refresh_all` on the latest commit (https://github.com/j2kun/mlir-tutorial/commit/bf40cc273cfa3b7f1ebbd53af7a5536f7276c349), and it failed to generate the `compile_commands.json` file. If I go back one commit, the `compile_commands.json` file is generated successfully.\n\nThe error when running the `bazel run` command at commit bf40cc27 is as follows:\n\n```\nINFO: Analyzed target @@hedron_compile_commands+//:refresh_all (4 packages loaded, 2013 targets configured).\nINFO: Found 1 target...\nTarget @@hedron_compile_commands+//:refresh_all up-to-date:\n bazel-bin/external/hedron_compile_commands+/refresh_all\n bazel-bin/external/hedron_compile_commands+/refresh_all.check_python_version.py\n bazel-bin/external/hedron_compile_commands+/refresh_all.py\nINFO: Elapsed time: 1.648s, Critical Path: 0.38s\nINFO: 9 processes: 7 internal, 2 linux-sandbox.\nINFO: Build completed successfully, 9 total actions\nINFO: Running command line: bazel-bin/external/hedron_compile_commands+/refresh_all\n\u003e\u003e\u003e Automatically added entries to .git/info/exclude to gitignore generated output.\n\u003e\u003e\u003e Automatically added //external workspace link:\n This link makes it easy for you--and for build tooling--to see the external dependencies you bring in. It also makes your source tree have the same directory structure as the build sandbox.\n It's a win/win: It's easier for you to browse the code you use, and it eliminates whole categories of edge cases for build tooling.\n\u003e\u003e\u003e Analyzing commands used in @//...\nWARNING: Build options --features and --host_features have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).\n\u003e\u003e\u003e A source file you compile doesn't (yet) exist: bazel-out/k8-dbg/bin/external/+_repo_rules+llvm-project/clang/clang-driver.cpp\n It's probably a generated file, and you haven't yet run a build to generate it.\n That's OK; your code doesn't even have to compile for this tool to work.\n If you can, though, you might want to run a build of your code with --keep_going.\n That way everything possible is generated, browsable and indexed for autocomplete.\n However, if you have *already* built your code, and generated the missing file...\n Please make sure you're supplying this tool with the same flags you use to build.\n You can either use a refresh_compile_commands rule or the special -- syntax. Please see the README.\n [Supplying flags normally won't work. That just causes this tool to be built with those flags.]\n Continuing gracefully...\nTraceback (most recent call last):\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/execroot/_main/bazel-out/k8-dbg/bin/external/hedron_compile_commands+/refresh_all.runfiles/_main/../hedron_compile_commands+/refresh_all.check_python_version.py\", line 15, in \u003cmodule\u003e\n refresh_all.main()\n ~~~~~~~~~~~~~~~~^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/execroot/_main/bazel-out/k8-dbg/bin/external/hedron_compile_commands+/refresh_all.runfiles/hedron_compile_commands+/refresh_all.py\", line 1420, in main\n compile_command_entries.extend(_get_commands(target, flags))\n ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/execroot/_main/bazel-out/k8-dbg/bin/external/hedron_compile_commands+/refresh_all.runfiles/hedron_compile_commands+/refresh_all.py\", line 1282, in _get_commands\n yield from _convert_compile_commands(parsed_aquery_output)\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/execroot/_main/bazel-out/k8-dbg/bin/external/hedron_compile_commands+/refresh_all.runfiles/hedron_compile_commands+/refresh_all.py\", line 1162, in _convert_compile_commands\n for source_files, header_files, compile_command_args in outputs:\n ^^^^^^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/external/rules_python++python+python_3_13_x86_64-unknown-linux-gnu/lib/python3.13/concurrent/futures/_base.py\", line 619, in result_iterator\n yield _result_or_cancel(fs.pop())\n ~~~~~~~~~~~~~~~~~^^^^^^^^^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/external/rules_python++python+python_3_13_x86_64-unknown-linux-gnu/lib/python3.13/concurrent/futures/_base.py\", line 317, in _result_or_cancel\n return fut.result(timeout)\n ~~~~~~~~~~^^^^^^^^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/external/rules_python++python+python_3_13_x86_64-unknown-linux-gnu/lib/python3.13/concurrent/futures/_base.py\", line 449, in result\n return self.__get_result()\n ~~~~~~~~~~~~~~~~~^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/external/rules_python++python+python_3_13_x86_64-unknown-linux-gnu/lib/python3.13/concurrent/futures/_base.py\", line 401, in __get_result\n raise self._exception\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/external/rules_python++python+python_3_13_x86_64-unknown-linux-gnu/lib/python3.13/concurrent/futures/thread.py\", line 59, in run\n result = self.fn(*self.args, **self.kwargs)\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/execroot/_main/bazel-out/k8-dbg/bin/external/hedron_compile_commands+/refresh_all.runfiles/hedron_compile_commands+/refresh_all.py\", line 1126, in _get_cpp_command_for_files\n source_files, header_files = _get_files(compile_action)\n ~~~~~~~~~~^^^^^^^^^^^^^^^^\n File \"/home/oulongwu/.cache/bazel/_bazel_oulongwu/5ea27db1debab93ecb57f96e7870f4b6/execroot/_main/bazel-out/k8-dbg/bin/external/hedron_compile_commands+/refresh_all.runfiles/hedron_compile_commands+/refresh_all.py\", line 624, in _get_files\n assert source_file_candidates, f\"No source files found in compile args: {compile_action.arguments}.\\nPlease file an issue with this information!\"\n ^^^^^^^^^^^^^^^^^^^^^^\nAssertionError: No source files found in compile args: ['external/rules_cc++cc_configure_extension+local_config_cc/cc_wrapper.sh', '-xc++-header', '-fsyntax-only', '-U_FORTIFY_SOURCE', '-fstack-protector', '-Wall', '-Wunused-but-set-parameter', '-Wno-free-nonheap-object', '-fno-omit-frame-pointer', '-g', '-std=c++17', '-MD', '-MF', 'bazel-out/k8-dbg/bin/external/abseil-cpp+/absl/base/_objs/base/call_once.h.d', '-iquote', 'external/abseil-cpp+', '-iquote', 'bazel-out/k8-dbg/bin/external/abseil-cpp+', '-fdiagnostics-color=always', '-std=c++17', '-Wall', '-Wextra', '-Wcast-qual', '-Wconversion-null', '-Wformat-security', '-Wmissing-declarations', '-Wnon-virtual-dtor', '-Woverlength-strings', '-Wpointer-arith', '-Wundef', '-Wunused-local-typedefs', '-Wunused-result', '-Wvarargs', '-Wvla', '-Wwrite-strings', '-DNOMINMAX', '-c', 'external/abseil-cpp+/absl/base/call_once.h', '-o', 'bazel-out/k8-dbg/bin/external/abseil-cpp+/absl/base/_objs/base/call_once.h.processed', '-Wno-builtin-macro-redefined', '-D__DATE__=\"redacted\"', '-D__TIMESTAMP__=\"redacted\"', '-D__TIME__=\"redacted\"'].\nPlease file an issue with this information!\n```","author":{"url":"https://github.com/xulongwu4","@type":"Person","name":"xulongwu4"},"datePublished":"2026-03-26T20:08:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/53/mlir-tutorial/issues/53"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1f891423-4e8f-4dc8-e0ff-abcdf26987cc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BA70:3EA9A9:2400987:33F777F:6A4BE20C |
| html-safe-nonce | 3b81357b0d754216c806b6cffdb0af4230bab6b70c473d3b00ed5877df3361ec |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQTcwOjNFQTlBOToyNDAwOTg3OjMzRjc3N0Y6NkE0QkUyMEMiLCJ2aXNpdG9yX2lkIjoiNDQ2NDUzNjY5NTQzODMwMzc1NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d51ccd809de12ebcd0d19d71de3c1844c892af000545c33830db7b4c56378104 |
| hovercard-subject-tag | issue:4147023643 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/j2kun/mlir-tutorial/53/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cf42a6f4b5c03deef61d816d7a7314b5480e86120dcd2fcbb7019cda3f5ece21/j2kun/mlir-tutorial/issues/53 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cf42a6f4b5c03deef61d816d7a7314b5480e86120dcd2fcbb7019cda3f5ece21/j2kun/mlir-tutorial/issues/53 |
| og:image:alt | I ran the command bazel run @hedron_compile_commands//:refresh_all on the latest commit (bf40cc2), and it failed to generate the compile_commands.json file. If I go back one commit, the compile_com... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xulongwu4 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0f5d3ba365b3985d75c32a5957c8635488d58dcf027ae6ae958eee7edaa306a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/j2kun/mlir-tutorial git https://github.com/j2kun/mlir-tutorial.git |
| octolytics-dimension-user_id | 2467754 |
| octolytics-dimension-user_login | j2kun |
| octolytics-dimension-repository_id | 606225969 |
| octolytics-dimension-repository_nwo | j2kun/mlir-tutorial |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 606225969 |
| octolytics-dimension-repository_network_root_nwo | j2kun/mlir-tutorial |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 253920ac2dc35b0849cca4633895f1f2e5f03051 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width