-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[compiler-rt] Make add_custom_libcxx() resilient to DESTDIR being set #115525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[compiler-rt] Make add_custom_libcxx() resilient to DESTDIR being set #115525
Conversation
Created using spr 1.3.6-beta.1
@@ -713,6 +713,9 @@ macro(add_custom_libcxx name prefix) | |||
USES_TERMINAL_INSTALL 1 | |||
LIST_SEPARATOR | | |||
EXCLUDE_FROM_ALL TRUE | |||
# Ensure that DESTDIR=... set in the out environment does not affect this | |||
# target (we always need to install to the build directory). | |||
INSTALL_COMMAND env DESTDIR= ${CMAKE_COMMAND} --build ${prefix}/build --target install | |||
INSTALL_BYPRODUCTS "${prefix}/lib/libc++.a" "${prefix}/lib/libc++abi.a" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the INSTALL_COMMAND fix we now get this:
[2091/2122] Performing install step for 'libcxx_fuzzer_x86_64'
ninja: error: unknown target 'INSTALL_BYPRODUCTS'
FAILED: compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/src/libcxx_fuzzer_x86_64-stamp/libcxx_fuzzer_x86_64-install
cd /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/build && env DESTDIR= /cmake/3.20.1/bin/cmake --build /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/build --target install INSTALL_BYPRODUCTS /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++.a /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/lib/libc++abi.a && /cmake/3.20.1/bin/cmake -E touch /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_x86_64/src/libcxx_fuzzer_x86_64-stamp/libcxx_fuzzer_x86_64-install
ninja: build stopped: subcommand failed.
FAILED: runtimes/runtimes-x86_64-unknown-linux-gnu-stamps/runtimes-x86_64-unknown-linux-gnu-build
cd /repo/llvm/build-all/runtimes/runtimes-x86_64-unknown-linux-gnu-bins && /cmake/3.20.1/bin/cmake --build .
ninja: build stopped: subcommand failed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, maybe the earlier patch that added INSTALL_BYPRODUCTS need to bump the requirement on cmake version to 3.26 (while current requirement is 3.20.0 according to https://llvm.org/docs/GettingStarted.html#software).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I guess I had a newer CMake, we can make this conditional on CMake version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just built with CMake 3.20 and am able to reproduce - will fix now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by #115677
If DESTDIR is set in the environment during the build/test stage, the local libc++ installation will be installed under DESTDIR instead of being in the build directory. See llvm#115077 (comment) and https://gitlab.kitware.com/cmake/cmake/-/issues/18165. Pull Request: llvm#115525
If DESTDIR is set in the environment during the build/test stage, the
local libc++ installation will be installed under DESTDIR instead of being
in the build directory.
See #115077 (comment)
and https://gitlab.kitware.com/cmake/cmake/-/issues/18165.