Skip to content

assert source_file_candidates fails #271

@a1exxd0

Description

@a1exxd0

Error found, asked to raise an issue

After running a bazel run :refresh_compile_commands I get:

"/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 626, in _get_files
    assert source_file_candidates, f"No source files found in compile args: {compile_action.arguments}.\nPlease file an issue with this information!"

My repository is publicly availaible here, branched at the point that causes the error. Reproduced by:

bazel build //... # the build works fine
bazel run :refresh_compile_commands

At this point I'm not too familiar with how this works, but happy to contribute a fix with a few pointers!

The error in full:

❯ bazel run :refresh_compile_commands
WARNING: Build options --features and --host_features have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
INFO: Analyzed target //:refresh_compile_commands (2 packages loaded, 3176 targets configured).
INFO: Found 1 target...
Target //:refresh_compile_commands up-to-date:
  bazel-bin/refresh_compile_commands
  bazel-bin/refresh_compile_commands.check_python_version.py
  bazel-bin/refresh_compile_commands.py
INFO: Elapsed time: 1.266s, Critical Path: 0.52s
INFO: 4 processes: 9 action cache hit, 2 internal, 2 darwin-sandbox.
INFO: Build completed successfully, 4 total actions
INFO: Running command line: bazel-bin/refresh_compile_commands
>>> Analyzing commands used in //...
WARNING: Build options --features and --host_features have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.check_python_version.py", line 15, in <module>
    refresh_compile_commands.main()
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1416, in main
    compile_command_entries.extend(_get_commands(target, flags))
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1278, in _get_commands
    yield from _convert_compile_commands(parsed_aquery_output)
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1158, in _convert_compile_commands
    for source_files, header_files, compile_command_args in outputs:
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/external/rules_python++python+python_3_11_aarch64-apple-darwin/lib/python3.11/concurrent/futures/_base.py", line 619, in result_iterator
    yield _result_or_cancel(fs.pop())
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/external/rules_python++python+python_3_11_aarch64-apple-darwin/lib/python3.11/concurrent/futures/_base.py", line 317, in _result_or_cancel
    return fut.result(timeout)
           ^^^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/external/rules_python++python+python_3_11_aarch64-apple-darwin/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/external/rules_python++python+python_3_11_aarch64-apple-darwin/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/external/rules_python++python+python_3_11_aarch64-apple-darwin/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 1122, in _get_cpp_command_for_files
    source_files, header_files = _get_files(compile_action)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/var/tmp/_bazel_alex/975cff4f4d663bb648ada73232e06de5/execroot/_main/bazel-out/darwin_arm64-fastbuild/bin/refresh_compile_commands.runfiles/_main/refresh_compile_commands.py", line 626, in _get_files
    assert source_file_candidates, f"No source files found in compile args: {compile_action.arguments}.\nPlease file an issue with this information!"
           ^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 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', '-Wthread-safety', '-Wself-assign', '-Wunused-but-set-parameter', '-Wno-free-nonheap-object', '-fcolor-diagnostics', '-fno-omit-frame-pointer', '-std=c++17', '-DBOOST_ALL_NO_LIB', '-DBOOST_ASIO_SEPARATE_COMPILATION', '-DBOOST_BEAST_SEPARATE_COMPILATION', '-mmacosx-version-min=13.3', '-MD', '-MF', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.beast+/_objs/boost.beast/beast.h.d', '-iquote', 'external/boost.beast+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.beast+', '-iquote', 'external/boost.asio+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.asio+', '-iquote', 'external/boost.align+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.align+', '-iquote', 'external/boost.assert+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.assert+', '-iquote', 'external/boost.config+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.config+', '-iquote', 'external/boost.core+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.core+', '-iquote', 'external/boost.static_assert+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.static_assert+', '-iquote', 'external/boost.throw_exception+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.throw_exception+', '-iquote', 'external/boost.context+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.context+', '-iquote', 'external/boost.mp11+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.mp11+', '-iquote', 'external/boost.pool+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.pool+', '-iquote', 'external/boost.integer+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.integer+', '-iquote', 'external/boost.type_traits+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.type_traits+', '-iquote', 'external/boost.winapi+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.winapi+', '-iquote', 'external/boost.predef+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.predef+', '-iquote', 'external/boost.smart_ptr+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.smart_ptr+', '-iquote', 'external/boost.date_time+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.date_time+', '-iquote', 'external/boost.algorithm+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.algorithm+', '-iquote', 'external/boost.array+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.array+', '-iquote', 'external/boost.bind+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.bind+', '-iquote', 'external/boost.concept_check+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.concept_check+', '-iquote', 'external/boost.preprocessor+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.preprocessor+', '-iquote', 'external/boost.exception+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.exception+', '-iquote', 'external/boost.tuple+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.tuple+', '-iquote', 'external/boost.function+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.function+', '-iquote', 'external/boost.iterator+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.iterator+', '-iquote', 'external/boost.detail+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.detail+', '-iquote', 'external/boost.fusion+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.fusion+', '-iquote', 'external/boost.container_hash+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.container_hash+', '-iquote', 'external/boost.describe+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.describe+', '-iquote', 'external/boost.function_types+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.function_types+', '-iquote', 'external/boost.mpl+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.mpl+', '-iquote', 'external/boost.utility+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.utility+', '-iquote', 'external/boost.io+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.io+', '-iquote', 'external/boost.functional+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.functional+', '-iquote', 'external/boost.typeof+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.typeof+', '-iquote', 'external/boost.optional+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.optional+', '-iquote', 'external/boost.range+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.range+', '-iquote', 'external/boost.conversion+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.conversion+', '-iquote', 'external/boost.regex+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.regex+', '-iquote', 'external/boost.unordered+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.unordered+', '-iquote', 'external/boost.lexical_cast+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.lexical_cast+', '-iquote', 'external/boost.container+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.container+', '-iquote', 'external/boost.intrusive+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.intrusive+', '-iquote', 'external/boost.move+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.move+', '-iquote', 'external/boost.numeric_conversion+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.numeric_conversion+', '-iquote', 'external/boost.tokenizer+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.tokenizer+', '-iquote', 'external/boost.system+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.system+', '-iquote', 'external/boost.variant2+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.variant2+', '-iquote', 'external/boost.endian+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.endian+', '-iquote', 'external/boost.logic+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.logic+', '-iquote', 'external/boost.static_string+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.static_string+', '-iquote', 'external/boost.type_index+', '-iquote', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.type_index+', '-isystem', 'external/boost.beast+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.beast+/include', '-isystem', 'external/boost.asio+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.asio+/include', '-isystem', 'external/boost.align+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.align+/include', '-isystem', 'external/boost.assert+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.assert+/include', '-isystem', 'external/boost.config+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.config+/include', '-isystem', 'external/boost.core+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.core+/include', '-isystem', 'external/boost.static_assert+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.static_assert+/include', '-isystem', 'external/boost.throw_exception+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.throw_exception+/include', '-isystem', 'external/boost.context+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.context+/include', '-isystem', 'external/boost.mp11+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.mp11+/include', '-isystem', 'external/boost.pool+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.pool+/include', '-isystem', 'external/boost.integer+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.integer+/include', '-isystem', 'external/boost.type_traits+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.type_traits+/include', '-isystem', 'external/boost.winapi+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.winapi+/include', '-isystem', 'external/boost.predef+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.predef+/include', '-isystem', 'external/boost.smart_ptr+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.smart_ptr+/include', '-isystem', 'external/boost.date_time+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.date_time+/include', '-isystem', 'external/boost.algorithm+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.algorithm+/include', '-isystem', 'external/boost.array+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.array+/include', '-isystem', 'external/boost.bind+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.bind+/include', '-isystem', 'external/boost.concept_check+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.concept_check+/include', '-isystem', 'external/boost.preprocessor+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.preprocessor+/include', '-isystem', 'external/boost.exception+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.exception+/include', '-isystem', 'external/boost.tuple+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.tuple+/include', '-isystem', 'external/boost.function+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.function+/include', '-isystem', 'external/boost.iterator+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.iterator+/include', '-isystem', 'external/boost.detail+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.detail+/include', '-isystem', 'external/boost.fusion+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.fusion+/include', '-isystem', 'external/boost.container_hash+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.container_hash+/include', '-isystem', 'external/boost.describe+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.describe+/include', '-isystem', 'external/boost.function_types+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.function_types+/include', '-isystem', 'external/boost.mpl+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.mpl+/include', '-isystem', 'external/boost.utility+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.utility+/include', '-isystem', 'external/boost.io+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.io+/include', '-isystem', 'external/boost.functional+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.functional+/include', '-isystem', 'external/boost.typeof+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.typeof+/include', '-isystem', 'external/boost.optional+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.optional+/include', '-isystem', 'external/boost.range+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.range+/include', '-isystem', 'external/boost.conversion+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.conversion+/include', '-isystem', 'external/boost.regex+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.regex+/include', '-isystem', 'external/boost.unordered+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.unordered+/include', '-isystem', 'external/boost.lexical_cast+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.lexical_cast+/include', '-isystem', 'external/boost.container+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.container+/include', '-isystem', 'external/boost.intrusive+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.intrusive+/include', '-isystem', 'external/boost.move+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.move+/include', '-isystem', 'external/boost.numeric_conversion+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.numeric_conversion+/include', '-isystem', 'external/boost.tokenizer+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.tokenizer+/include', '-isystem', 'external/boost.system+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.system+/include', '-isystem', 'external/boost.variant2+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.variant2+/include', '-isystem', 'external/boost.endian+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.endian+/include', '-isystem', 'external/boost.logic+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.logic+/include', '-isystem', 'external/boost.static_string+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.static_string+/include', '-isystem', 'external/boost.type_index+/include', '-isystem', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.type_index+/include', '-std=c++23', '-c', 'external/boost.beast+/include/boost/beast.hpp', '-o', 'bazel-out/darwin_arm64-fastbuild/bin/external/boost.beast+/_objs/boost.beast/beast.h.processed', '-no-canonical-prefixes', '-Wno-builtin-macro-redefined', '-D__DATE__="redacted"', '-D__TIMESTAMP__="redacted"', '-D__TIME__="redacted"'].
Please file an issue with this information!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions