[libcxx-commits] [libcxx] 342e0eb - Revert the removal of LLVM_ENABLE_PROJECTS for libc++ and libc++abi

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Aug 23 06:58:57 PDT 2022


Author: Louis Dionne
Date: 2022-08-23T09:58:30-04:00
New Revision: 342e0ebd0b7409c8808a90cf38dd45ec7dc57671

URL: https://github.com/llvm/llvm-project/commit/342e0ebd0b7409c8808a90cf38dd45ec7dc57671
DIFF: https://github.com/llvm/llvm-project/commit/342e0ebd0b7409c8808a90cf38dd45ec7dc57671.diff

LOG: Revert the removal of LLVM_ENABLE_PROJECTS for libc++ and libc++abi

This commit reverts the following commits:

- 952f90b72b3546d6b6b038d410f07ce520c59b48
- e6a0800532bb409f6d1c62f3698bdd6994a877dc (D132298)
- 176db3b3ab25ff8a9b2405f50ef5a8bd9304a6d5 (D132324)

These commits caused CI instability and need to be reverted in order
to figure things out again. See the discussion in https://llvm.org/D132324
for more information.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Linux.cpp
    compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
    libcxx/utils/ci/buildkite-pipeline.yml
    libcxx/utils/ci/oss-fuzz.sh
    libcxx/utils/ci/run-buildbot
    libcxxabi/CMakeLists.txt
    libcxxabi/test/CMakeLists.txt
    llvm/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
index 29f385f31564f..cf5cdbcd86f34 100644
--- a/clang/lib/Driver/ToolChains/Linux.cpp
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
@@ -308,6 +308,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
 
   Generic_GCC::AddMultiarchPaths(D, SysRoot, OSLibDir, Paths);
 
+  // The deprecated -DLLVM_ENABLE_PROJECTS=libcxx configuration installs
+  // libc++.so in D.Dir+"/../lib/". Detect this path.
+  // TODO Remove once LLVM_ENABLE_PROJECTS=libcxx is unsupported.
+  if (StringRef(D.Dir).startswith(SysRoot) &&
+      D.getVFS().exists(D.Dir + "/../lib/libc++.so"))
+    addPathIfExists(D, D.Dir + "/../lib", Paths);
+
   addPathIfExists(D, concat(SysRoot, "/lib"), Paths);
   addPathIfExists(D, concat(SysRoot, "/usr/lib"), Paths);
 }

diff  --git a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
index a0a9ac312e225..52c45d48de154 100755
--- a/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
+++ b/compiler-rt/lib/sanitizer_common/symbolizer/scripts/build_symbolizer.sh
@@ -100,12 +100,12 @@ if [[ ! -d ${LIBCXX_BUILD} ]]; then
   mkdir -p ${LIBCXX_BUILD}
   cd ${LIBCXX_BUILD}
   LIBCXX_FLAGS="${FLAGS} -Wno-macro-redefined"
-  RUNTIMES=
+  PROJECTS=
   if [[ ! -d $LLVM_SRC/projects/libcxxabi ]] ; then
-    RUNTIMES="-DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi'"
+    PROJECTS="-DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi'"
   fi
   cmake -GNinja \
-    ${RUNTIMES} \
+    ${PROJECTS} \
     -DCMAKE_BUILD_TYPE=Release \
     -DCMAKE_C_COMPILER=$CC \
     -DCMAKE_CXX_COMPILER=$CXX \

diff  --git a/libcxx/utils/ci/buildkite-pipeline.yml b/libcxx/utils/ci/buildkite-pipeline.yml
index bf9db29ce7f59..8e804552f3591 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -321,6 +321,20 @@ steps:
             limit: 2
       timeout_in_minutes: 120
 
+    - label: "Legacy LLVM_ENABLE_PROJECTS build"
+      command: "libcxx/utils/ci/run-buildbot legacy-project-build"
+      artifact_paths:
+        - "**/test-results.xml"
+        - "**/*.abilist"
+      agents:
+        queue: "libcxx-builders"
+        os: "linux"
+      retry:
+        automatic:
+          - exit_status: -1  # Agent was lost
+            limit: 2
+      timeout_in_minutes: 120
+
   # Tests with various build configurations.
   - label: "Static libraries"
     command: "libcxx/utils/ci/run-buildbot generic-static"

diff  --git a/libcxx/utils/ci/oss-fuzz.sh b/libcxx/utils/ci/oss-fuzz.sh
index 123ac47fc449b..12149de87ce5b 100755
--- a/libcxx/utils/ci/oss-fuzz.sh
+++ b/libcxx/utils/ci/oss-fuzz.sh
@@ -13,7 +13,7 @@ INSTALL=cxx_install_dir
 
 mkdir ${BUILD}
 cmake -S ${PWD} -B ${BUILD} \
-      -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
+      -DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
       -DCMAKE_BUILD_TYPE=RelWithDebInfo \
       -DCMAKE_INSTALL_PREFIX="${INSTALL}"
 cmake --build ${BUILD} --target install-cxx-headers

diff  --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 220082c1209c8..27431f3c2cac8 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -510,6 +510,21 @@ legacy-test-config)
                    -DLIBUNWIND_TEST_CONFIG="${MONOREPO_ROOT}/libunwind/test/lit.site.cfg.in"
     check-runtimes
 ;;
+legacy-project-build)
+    clean
+
+    echo "--- Generating CMake"
+    ${CMAKE} \
+          -S "${MONOREPO_ROOT}/llvm" \
+          -B "${BUILD_DIR}" \
+          -DLLVM_ENABLE_PROJECTS="libcxx;libunwind;libcxxabi" \
+          -GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
+          -DCMAKE_BUILD_TYPE=RelWithDebInfo \
+          -DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}" \
+          -DLLVM_LIT_ARGS="-sv --show-unsupported --xunit-xml-output test-results.xml --timeout=1500" \
+          -DLIBCXX_CXX_ABI=libcxxabi
+    check-runtimes
+;;
 aarch64)
     clean
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/AArch64.cmake"

diff  --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
index 9064afbe890f8..b8326d08d23a8 100644
--- a/libcxxabi/CMakeLists.txt
+++ b/libcxxabi/CMakeLists.txt
@@ -131,17 +131,10 @@ if (NOT LIBCXXABI_ENABLE_SHARED AND NOT LIBCXXABI_ENABLE_STATIC)
   message(FATAL_ERROR "libc++abi must be built as either a shared or static library.")
 endif()
 
+# TODO: Remove this, which shouldn't be necessary since we know we're being built
+#       side-by-side with libc++.
 set(LIBCXXABI_LIBCXX_INCLUDES "" CACHE PATH
     "Specify path to libc++ includes.")
-if (NOT libcxx IN_LIST LLVM_ENABLE_RUNTIMES)
-  if (NOT IS_DIRECTORY ${LIBCXXABI_LIBCXX_INCLUDES})
-    message(FATAL_ERROR
-      "LIBCXXABI_LIBCXX_INCLUDES=${LIBCXXABI_LIBCXX_INCLUDES} is not a valid directory. "
-      "Please provide the path to where the libc++ headers have been installed.")
-  endif()
-  add_library(cxx-headers INTERFACE)
-  target_include_directories(cxx-headers INTERFACE "${LIBCXXABI_LIBCXX_INCLUDES}")
-endif()
 
 set(LIBCXXABI_HERMETIC_STATIC_LIBRARY_DEFAULT OFF)
 if (WIN32)

diff  --git a/libcxxabi/test/CMakeLists.txt b/libcxxabi/test/CMakeLists.txt
index 0b82943c5a63b..0a4541b9443c6 100644
--- a/libcxxabi/test/CMakeLists.txt
+++ b/libcxxabi/test/CMakeLists.txt
@@ -61,13 +61,9 @@ if (LIBCXXABI_BUILD_EXTERNAL_THREAD_LIBRARY)
   list(APPEND LIBCXXABI_TEST_DEPS cxx_external_threads)
 endif()
 
-if(libcxx IN_LIST LLVM_ENABLE_RUNTIMES)
-  list(APPEND LIBCXXABI_TEST_DEPS cxx)
-endif()
-if(libunwind IN_LIST LLVM_ENABLE_RUNTIMES)
-  if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
-    list(APPEND LIBCXXABI_TEST_DEPS unwind)
-  endif()
+list(APPEND LIBCXXABI_TEST_DEPS cxx)
+if (LIBCXXABI_USE_LLVM_UNWINDER AND TARGET unwind)
+  list(APPEND LIBCXXABI_TEST_DEPS unwind)
 endif()
 
 set(AUTO_GEN_COMMENT "## Autogenerated by libcxxabi configuration.\n# Do not edit!")

diff  --git a/llvm/CMakeLists.txt b/llvm/CMakeLists.txt
index c9cbf420fdc3e..1c1a38d102a60 100644
--- a/llvm/CMakeLists.txt
+++ b/llvm/CMakeLists.txt
@@ -127,11 +127,8 @@ foreach(proj ${LLVM_ENABLE_PROJECTS})
 endforeach()
 foreach(proj "libcxx" "libcxxabi" "libunwind")
   if (${proj} IN_LIST LLVM_ENABLE_PROJECTS)
-    # TODO(Ericson2314): Making non-fatal for now because of out-of-tree docs
-    # CI jobs use this.
-    message(SEND_ERROR
-      "Using LLVM_ENABLE_PROJECTS=${proj} is incorrect. Please use -DLLVM_ENABLE_RUNTIMES=${proj} or "
-      "see the instructions at https://libcxx.llvm.org/BuildingLibcxx.html for building the runtimes.")
+    message(WARNING "Using LLVM_ENABLE_PROJECTS=${proj} is deprecated now, please use -DLLVM_ENABLE_RUNTIMES=${proj} or "
+                    "see the instructions at https://libcxx.llvm.org/BuildingLibcxx.html for building the runtimes.")
   endif()
 endforeach()
 


        


More information about the libcxx-commits mailing list