Rather than including libc++ include dir, use the cxx-headers target.
Details
- Reviewers
ldionne - Group Reviewers
Restricted Project - Commits
- rG1687f2bbe2e2: [libcxxabi] Use cxx-headers target to consume libcxx headers
rG72728e12806a: [libcxxabi] Use cxx-headers target to consume libcxx headers
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
libcxxabi/CMakeLists.txt | ||
---|---|---|
159–175 | Why not make this if (NOT TARGET cxx-headers)? You don't really care so much about the standalone target as much as you do about the cxx-headers target existing. | |
164 | I believe that with the suggestion below, this check is unnecessary as CMake will verify that the path exists and is a directory. | |
166–170 | There is no need for this complicated special handling, why not just let CMake handle it? |
libcxxabi/CMakeLists.txt | ||
---|---|---|
159–175 | The issue is that depending on the order in which users put projects in LLVM_ENABLE_PROJECTS or LLVM_ENABLE_RUNTIMES, cxx-headers target may not yet exist, see also D97314 for a related discussion. | |
166–170 | We tried to use that approach in the past but it broke the runtimes build with what appeared to be a CMake bug where it would simply drop the include on the floor on certain platforms like macOS, see D82702 for some of the background discussion. We could try and revisit this but I'd prefer to do it in a follow up change. |
libcxxabi/CMakeLists.txt | ||
---|---|---|
166–170 | Can you please create that follow-up change right now and make it a child of this patch? |
Actually, I accepted a bit too fast. I'm fine with the patch but there seems to be a problem with it, since CI is failing.
Hi,
I don't know what is happening at all, but I noticed that when I do "ninja check-runtimes" with this patch it fails with
[0/1] Running all regression tests llvm-lit: /repo/uabelho/master-github/llvm/build-all-builtins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/libcxxabi/test/lit.site.cfg:60: note: Using configuration variant: libcxxabi llvm-lit: /repo/uabelho/master-github/libcxx/utils/libcxx/test/config.py:632: note: Setting target_triple to x86_64-unknown-linux-gnu llvm-lit: /repo/uabelho/master-github/libcxxabi/test/libcxxabi/test/config.py:67: fatal: cxx_headers='/repo/uabelho/master-github/llvm/build-all-builtins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/include/c++/v1' is not a directory.
The directory
/repo/uabelho/master-github/llvm/build-all-builtins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/include/c++/v1
doesn't exist. The dir
/repo/uabelho/master-github/llvm/build-all-builtins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins
exists, but there is no "include" in it.
If I search for "v1" in my build dir I find
build-all-builtins/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/include/c++/v1 build-all-builtins/include/c++/v1
Any idea what's up?
What's your CMake configuration? I'd like to try and reproduce this locally so I can investigate.
Hi @phosek ,
we got the same thing on the win-x-arm cross toolchain builders as described by @uabelho
cmake --build . --target check-cxxabi ... -- Build files have been written to: C:/buildbot/temp/build/runtimes/runtimes-bins [4/5] cmd.exe /C "cd /D C:\buildbot\temp\build\runtimes\runtimes-bin...uild/runtimes/runtimes-bins/ --target check-cxxabi --config Release" [0/1] Running libcxxabi tests llvm-lit.py: c:\buildbot\temp\build\runtimes\runtimes-bins\libcxxabi\test\lit.site.cfg:60: note: Using configuration variant: libcxxabi llvm-lit.py: C:\buildbot\temp\llvm-project\libcxx\utils\libcxx\test\target_info.py:152: note: inferred target_info as: 'libcxx.test.target_info.LinuxRemoteTI' llvm-lit.py: C:\buildbot\temp\llvm-project\libcxx\utils\libcxx\test\config.py:632: note: Setting target_triple to aarch64-linux-gnu llvm-lit.py: C:\buildbot\temp\llvm-project\libcxxabi\test\libcxxabi\test\config.py:67: fatal: cxx_headers='C:/buildbot/temp/build/runtimes/runtimes-bins\include\c++\v1' is not a directory. FAILED: libcxxabi/test/CMakeFiles/check-cxxabi cmd.exe /C "cd /D C:\buildbot\temp\build\runtimes\runtimes-bins\libcxxabi\test && C:\Python38\python.exe C:/buildbot/temp/build/./bin/llvm-lit.py -vv -v -vv C:/buildbot/temp/build/runtimes/runtimes-bins/libcxxabi/test" ninja: build stopped: subcommand failed. FAILED: runtimes/CMakeFiles/check-cxxabi cmd.exe /C "cd /D C:\buildbot\temp\build\runtimes\runtimes-bins && "C:\Program Files\CMake\bin\cmake.exe" --build C:/buildbot/temp/build/runtimes/runtimes-bins/ --target check-cxxabi --config Release" ninja: build stopped: subcommand failed.
The <build_root>/runtimes/runtimes-bins folder does not contain include/c++/v1. There is only <build-root>/include/c++/v1.
Builders:
aarch64: https://lab.llvm.org/buildbot/#/builders/119/builds/2894
armv7: https://lab.llvm.org/buildbot/#/builders/60/builds/2484
For me it fails with
CC='/proj/flexasic/app/llvm/8.0/bin/clang -march=corei7' CXX='/proj/flexasic/app/llvm/8.0/bin/clang++ -march=corei7' LDFLAGS='-L/proj/flexasic/app/llvm/8.0/lib64 -Wl,-R/proj/flexasic/app/llvm/8.0/lib64:/proj/bbi_twh/wh_bbi/x86_64-Linux3/z3/4.8.8-1/lib64' PATH=/proj/flexasic/app/ninja/1.8.2/SLED11-64/bin:$PATH /app/vbuild/RHEL7-x86_64/cmake/3.16.4/bin/cmake /repo/uabelho/master-github/llvm --debug-trycompile -G Ninja -DCMAKE_MAKE_PROGRAM=/proj/flexasic/app/ninja/1.8.2/SLED11-64/bin/ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_INSTALL_PREFIX=/compiler-clang -DLLVM_APPEND_VC_REV=OFF -DLLVM_CCACHE_BUILD=OFF -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_WERROR=ON -DLLVM_ENABLE_PROJECTS='clang;clang-tools-extra;lld' -DLLVM_BUILTIN_TARGETS=default -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=ON -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi;libunwind;compiler-rt' -DRUNTIMES_x86_64-unknown-linux-gnu_SANITIZER_USE_STATIC_LLVM_UNWINDER=ON -DRUNTIMES_x86_64-unknown-linux-gnu_SANITIZER_USE_STATIC_CXX_ABI=ON -DRUNTIMES_x86_64-unknown-linux-gnu_COMPILER_RT_USE_BUILTINS_LIBRARY=ON -DRUNTIMES_x86_64-unknown-linux-gnu_COMPILER_RT_CAN_EXECUTE_TESTS=OFF -DRUNTIMES_x86_64-unknown-linux-gnu_LIBCXX_HAS_ATOMIC_LIB=0 -DRUNTIMES_x86_64-unknown-linux-gnu_COMPILER_RT_BUILD_XRAY=OFF -DLLVM_RUNTIME_TARGETS='x86_64-unknown-linux-gnu' -DLLVM_ENABLE_Z3_SOLVER=ON -DLLVM_Z3_INSTALL_DIR=/proj/bbi_twh/wh_bbi/x86_64-Linux3/z3/4.8.8-1 -DLLVM_ENABLE_LIBPFM=OFF -DCLANG_TOOLING_BUILD_AST_INTROSPECTION=OFF ninja check-runtimes
Since there are also buildbots failing, perhaps we can revert while investigating unless there is a very quick fix?
Hi @phosek,
I have tested the updated diff on Windows-x-ARM cross builder and it works fine. Thank you.
I believe that with the suggestion below, this check is unnecessary as CMake will verify that the path exists and is a directory.