Skip to content

clang-tidy test failures in darwin builds #60304

Closed
@hiraditya

Description

Summary:

This error happens when a fat binary (arm64 + x86_64) is built.

When clang-tidy doesn't find a compilation command for a particular file (trivially-destructible.cpp) it tries to infer the command, and in this case it picks up the compilation command of a file (FasterStringFindCheck.cpp) from a parent directory. clang-tidy cleans up the build command a little to make it suitable for -cc1 invocation. The problem is that clang-tidy doesn't cleanup the -arch flag, and because of that there are two cc1 invocations, one for each arm64 and x86_64.

Thus build fails with "error: unable to handle compilation, expected exactly one compiler job".

Shortened error message:

error: unable to handle compilation, expected exactly one compiler job in
./bin/clang++" "-cc1" "-triple" "arm64-apple-macosx10.14.0 ......
tools/clang/tools/extra/test/clang-tidy/checkers/performance/Output/trivially-destructible.cpp.tmp.cpp ; \ <------------ second command in the same invocation.
./bin/clang++" "-cc1" "-triple" "x86_64-apple-macosx10.14.0" ........
tools/clang/tools/extra/test/clang-tidy/checkers/performance/Output/trivially-destructible.cpp.tmp.cpp;

Repro steps:

$ cmake -GNinja ../llvm -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_TARGETS_TO_BUILD='AArch64;X86' -DLLVM_BUILD_LLVM_DYLIB=ON -DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14

$ ninja check-clang-tools

Failed Tests (1):
Clang Tools :: clang-tidy/checkers/performance/trivially-destructible.cpp

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions