Skip to content

assert prevents refresh.template.py from handling custom CC toolchains #15

Closed
@lukasoyen

Description

@lukasoyen

Steps to reproduce:

Output:

  File "$HOME/.cache/bazel/_bazel/008ff1d9dbee3b1e6642ec19c761ba55/execroot/__main__/bazel-out/k8-fastbuild/bin/external/hedron_compile_commands/extract.runfiles/hedron_compile_commands/extract.py", line 128, in _check_in_clang_args_format
    assert re.search(r'(?:clang|clang\+\+|gcc|g\+\+)(?:-[0-9\.]+)?$', compile_args[0]), f"Compiler doesn't look like normal clang/gcc. Time to add windows support? CMD: {compile_args}"
AssertionError: Compiler doesn't look like normal clang/gcc. Time to add windows support? CMD: ['external/llvm_toolchain/bin/cc_wrapper.sh', '--target=x86_64-unknown-linux-gnu', '-U_FORTIFY_SOURCE', '-fstack-protector', '-fno-omit-frame-pointer', '-fcolor-diagnostics', '-Wall', '-Wthread-safety', '-Wself-assign', '-std=c++17', '-stdlib=libc++', '-MD', '-MF', 'bazel-out/k8-fastbuild/bin/lib/_objs/hello-time/hello-time.pic.d', '-frandom-seed=bazel-out/k8-fastbuild/bin/lib/_objs/hello-time/hello-time.pic.o', '-fPIC', '-iquote', '.', '-iquote', 'bazel-out/k8-fastbuild/bin', '-no-canonical-prefixes', '-Wno-builtin-macro-redefined', '-D__DATE__="redacted"', '-D__TIMESTAMP__="redacted"', '-D__TIME__="redacted"', '-fdebug-prefix-map=external/llvm_toolchain_llvm/=__bazel_toolchain_llvm_repo__/', '-c', 'lib/hello-time.cc', '-o', 'bazel-out/k8-fastbuild/bin/lib/_objs/hello-time/hello-time.pic.o']

extract.py does not like the external/llvm_toolchain/bin/cc_wrapper.sh script. If we fix that regex to also accept the wrapper script, we get: FileNotFoundError: [Errno 2] No such file or directory: 'external/llvm_toolchain/bin/cc_wrapper.sh': 'external/llvm_toolchain/bin/cc_wrapper.sh'. If that file happens to be vendored in the workspace and just call to a binary from an external repository, the call inside the wrapper script fails.

Not sure what a good way to solve this would be.

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