[llvm] 565d455 - [libcxx] Add a CI configuration for standalone building in llvm-project/runtimes
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 29 11:37:58 PDT 2021
Author: Martin Storsjö
Date: 2021-09-29T21:37:28+03:00
New Revision: 565d45541f860d72b2e2f12001104edd78f5b0c3
URL: https://github.com/llvm/llvm-project/commit/565d45541f860d72b2e2f12001104edd78f5b0c3
DIFF: https://github.com/llvm/llvm-project/commit/565d45541f860d72b2e2f12001104edd78f5b0c3.diff
LOG: [libcxx] Add a CI configuration for standalone building in llvm-project/runtimes
Generate the llvm-lit script in runtimes/CmakeFiles.txt unless invoked
from llvm/runtimes.
Differential Revision: https://reviews.llvm.org/D109593
Added:
Modified:
libcxx/utils/ci/buildkite-pipeline.yml
libcxx/utils/ci/run-buildbot
llvm/runtimes/CMakeLists.txt
runtimes/CMakeLists.txt
Removed:
################################################################################
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index 098aef7e92c11..26cf7d0ce8587 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -479,6 +479,19 @@ steps:
limit: 2
timeout_in_minutes: 120
+ - label: "New standalone runtimes build"
+ command: "libcxx/utils/ci/run-buildbot new-standalone"
+ artifact_paths:
+ - "**/test-results.xml"
+ agents:
+ queue: "libcxx-builders"
+ os: "linux"
+ retry:
+ automatic:
+ - exit_status: -1 # Agent was lost
+ limit: 2
+ timeout_in_minutes: 120
+
- label: "Runtimes build"
command: "libcxx/utils/ci/run-buildbot runtimes-build"
artifact_paths:
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index de470053d5082..82796296a707c 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -430,6 +430,22 @@ unified-standalone)
check-cxx-cxxabi
;;
+new-standalone)
+
+ clean
+
+ echo "--- Generating CMake"
+ ${CMAKE} \
+ -S "${MONOREPO_ROOT}/runtimes" \
+ -B "${BUILD_DIR}" \
+ -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+ -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+ -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \
+ -DLIBCXX_TEST_CONFIG="${MONOREPO_ROOT}/libcxx/test/configs/libcxx-trunk-shared.cfg.in"
+
+ check-cxx-cxxabi
+;;
runtimes-build)
clean
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 3436cd8bdfbef..1ec808e7ff212 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -13,6 +13,7 @@ set(LLVM_ENABLE_RUNTIMES "" CACHE STRING
if(LLVM_ENABLE_RUNTIMES STREQUAL "all" )
set(LLVM_ENABLE_RUNTIMES ${LLVM_ALL_RUNTIMES})
endif()
+set(COMMON_CMAKE_ARGS "-DHAVE_LLVM_LIT=ON")
foreach(proj ${LLVM_ENABLE_RUNTIMES})
set(proj_dir "${CMAKE_CURRENT_SOURCE_DIR}/../../${proj}")
if(IS_DIRECTORY ${proj_dir} AND EXISTS ${proj_dir}/CMakeLists.txt)
@@ -87,6 +88,7 @@ function(builtin_default_target compiler_rt_path)
-DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=${LLVM_ENABLE_PER_TARGET_RUNTIME_DIR_default}
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
+ ${COMMON_CMAKE_ARGS}
${BUILTINS_CMAKE_ARGS}
PASSTHROUGH_PREFIXES COMPILER_RT
USE_TOOLCHAIN
@@ -119,6 +121,7 @@ function(builtin_register_target compiler_rt_path target)
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
+ ${COMMON_CMAKE_ARGS}
${${target}_extra_args}
USE_TOOLCHAIN
TARGET_TRIPLE ${target}
@@ -236,6 +239,7 @@ function(runtime_default_target)
-DCMAKE_C_COMPILER_WORKS=ON
-DCMAKE_CXX_COMPILER_WORKS=ON
-DCMAKE_ASM_COMPILER_WORKS=ON
+ ${COMMON_CMAKE_ARGS}
${RUNTIMES_CMAKE_ARGS}
PASSTHROUGH_PREFIXES LLVM_ENABLE_RUNTIMES
${ARG_PREFIXES}
@@ -338,6 +342,7 @@ function(runtime_register_target name target)
-DCMAKE_ASM_COMPILER_WORKS=ON
-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON
-DLLVM_RUNTIMES_TARGET=${name}
+ ${COMMON_CMAKE_ARGS}
${${name}_extra_args}
EXTRA_TARGETS ${${name}_extra_targets}
${${name}_test_targets}
diff --git a/runtimes/CMakeLists.txt b/runtimes/CMakeLists.txt
index 2bde09b71699d..506697d3f2cfd 100644
--- a/runtimes/CMakeLists.txt
+++ b/runtimes/CMakeLists.txt
@@ -116,6 +116,8 @@ if (NOT LLVM_DEFAULT_TARGET_TRIPLE)
get_host_triple(LLVM_DEFAULT_TARGET_TRIPLE)
endif()
+option(LLVM_INCLUDE_TESTS "Generate build targets for the runtimes unit tests." ON)
+
# Use libtool instead of ar if you are both on an Apple host, and targeting Apple.
if(CMAKE_HOST_APPLE AND APPLE)
include(UseLibtool)
@@ -184,6 +186,14 @@ if(LLVM_INCLUDE_TESTS)
ARGS ${RUNTIMES_LIT_EXTRA_ARGS}
)
add_custom_target(runtimes-test-depends DEPENDS ${RUNTIMES_LIT_DEPENDS})
+
+ if (NOT HAVE_LLVM_LIT)
+ # If built by manually invoking cmake on this directory, we don't have
+ # llvm-lit. If invoked via llvm/runtimes, the toplevel llvm cmake
+ # invocation already generated the llvm-lit script.
+ add_subdirectory(${LLVM_MAIN_SRC_DIR}/utils/llvm-lit
+ ${CMAKE_CURRENT_BINARY_DIR}/llvm-lit)
+ endif()
endif()
get_property(SUB_COMPONENTS GLOBAL PROPERTY SUB_COMPONENTS)
More information about the llvm-commits
mailing list