Skip to content

No source files found in compile args #204

Open
@kuntryn

Description

@kuntryn

got this error when compiling abseil library.

 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/bazel_tools~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', '-g', '-std=c++17', '-MD', '-MF', 'bazel-out/k8-dbg/bin/external/abseil-cpp~/absl/log/_objs/absl_log/absl_log.h.d', '-iquote', 'external/abseil-cpp~', '-iquote', 'bazel-out/k8-dbg/bin/external/abseil-cpp~', '-std=c++20', '-Xclang', '-fno-modules-validate-textual-header-includes', '-Wall', '-Wextra', '-Wcast-qual', '-Wconversion', '-Wfloat-overflow-conversion', '-Wfloat-zero-conversion', '-Wfor-loop-analysis', '-Wformat-security', '-Wgnu-redeclared-enum', '-Winfinite-recursion', '-Winvalid-constexpr', '-Wliteral-conversion', '-Wmissing-declarations', '-Woverlength-strings', '-Wpointer-arith', '-Wself-assign', '-Wshadow-all', '-Wshorten-64-to-32', '-Wsign-conversion', '-Wstring-conversion', '-Wtautological-overlap-compare', '-Wtautological-unsigned-zero-compare', '-Wundef', '-Wuninitialized', '-Wunreachable-code', '-Wunused-comparison', '-Wunused-local-typedefs', '-Wunused-result', '-Wvla', '-Wwrite-strings', '-Wno-float-conversion', '-Wno-implicit-float-conversion', '-Wno-implicit-int-float-conversion', '-Wno-unknown-warning-option', '-DNOMINMAX', '-no-canonical-prefixes', '-Wno-builtin-macro-redefined', '-D__DATE__="redacted"', '-D__TIMESTAMP__="redacted"', '-D__TIME__="redacted"', '-c', 'external/abseil-cpp~/absl/log/absl_log.h', '-o', 'bazel-out/k8-dbg/bin/external/abseil-cpp~/absl/log/_objs/absl_log/absl_log.h.processed'].
Please file an issue with this information!

def _get_files(compile_action):
"""Gets the ({source files}, {header files}) clangd should be told the command applies to."""
# Getting the source file is a little trickier than it might seem.
# First, we do the obvious thing: Filter args to those that look like source files.
source_file_candidates = [arg for arg in compile_action.arguments if not arg.startswith('-') and arg.endswith(_get_files.source_extensions)]
assert source_file_candidates, f"No source files found in compile args: {compile_action.arguments}.\nPlease file an issue with this information!"
source_file = source_file_candidates[0]

This command seems try to generate a preprocessed header file, so it contains no cpp source files.

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