https://github.com/ldionne created 
https://github.com/llvm/llvm-project/pull/109984

This removes the need for macOS nodes in Buildkite. It also moves to the proper 
way of testing backdeployment, which is to actually run on the target OS 
itself, instead of using packaged dylibs from previous OS versions and trying 
to emulate backdeployment with DYLD_LIBRARY_PATH.

>From b03b189897358070290549af67bfd3705ec3c203 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionn...@gmail.com>
Date: Wed, 25 Sep 2024 09:55:53 -0400
Subject: [PATCH] [runtimes] Run backdeployment CI on Github hosted runners

This removes the need for macOS nodes in Buildkite. It also moves to
the proper way of testing backdeployment, which is to actually run on
the target OS itself, instead of using packaged dylibs from previous OS
versions and trying to emulate backdeployment with DYLD_LIBRARY_PATH.
---
 .github/workflows/libcxx-build-and-test.yaml  | 23 +++++--
 .../apple-libc++-backdeployment.cfg.in        | 65 ------------------
 .../test/configs/apple-libc++-system.cfg.in   | 33 +++++++++
 libcxx/utils/ci/buildkite-pipeline.yml        | 42 ------------
 libcxx/utils/ci/run-buildbot                  | 60 +++--------------
 .../apple-libc++abi-backdeployment.cfg.in     | 66 ------------------
 .../configs/apple-libc++abi-system.cfg.in     | 34 ++++++++++
 .../apple-libunwind-backdeployment.cfg.in     | 67 -------------------
 .../configs/apple-libunwind-system.cfg.in     | 35 ++++++++++
 9 files changed, 128 insertions(+), 297 deletions(-)
 delete mode 100644 libcxx/test/configs/apple-libc++-backdeployment.cfg.in
 create mode 100644 libcxx/test/configs/apple-libc++-system.cfg.in
 delete mode 100644 libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
 create mode 100644 libcxxabi/test/configs/apple-libc++abi-system.cfg.in
 delete mode 100644 libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
 create mode 100644 libunwind/test/configs/apple-libunwind-system.cfg.in

diff --git a/.github/workflows/libcxx-build-and-test.yaml 
b/.github/workflows/libcxx-build-and-test.yaml
index b5e60781e00064..653cd4563cb125 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -193,17 +193,26 @@ jobs:
             **/crash_diagnostics/*
 
   macos:
-    runs-on: macos-14
     needs: [ stage1 ]
     strategy:
       fail-fast: true
       matrix:
-        config: [
-          generic-cxx03,
-          generic-cxx23,
-          generic-modules,
-          apple-configuration
-        ]
+        include:
+        - config: generic-cxx03
+          os: macos-latest
+        - config: generic-cxx23
+          os: macos-latest
+        - config: generic-modules
+          os: macos-latest
+        - config: apple-configuration
+          os: macos-latest
+        - config: apple-system-12.0
+          os: macos-12
+        - config: apple-system-13.0
+          os: macos-13
+        - config: apple-system-hardened-13.0
+          os: macos-13
+    runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout@v4
       - uses: maxim-lobanov/setup-xcode@v1
diff --git a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in 
b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
deleted file mode 100644
index 9843c4a9ad70da..00000000000000
--- a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
+++ /dev/null
@@ -1,65 +0,0 @@
-# Testing configuration for back-deployment against older Apple system libc++.
-#
-# Under this configuration, we compile and link all the test suite against the 
latest libc++,
-# however we run against the libc++ on a different platform. This emulates the 
workflow of
-# a developer building their application using recent tools but with the goal 
of deploying
-# on existing devices running an older OS (and hence an older dylib).
-
-import os, site
-site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
-import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
-
-lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-
-BACKDEPLOYMENT_PARAMETERS = [
-    libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libc++) when running tests.
-
-        This should be a directory hierarchy under which the libc++ dylib can 
be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-    libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libc++abi) when running tests.
-
-        This should be a directory hierarchy under which the libc++abi dylib 
can be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-    libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libunwind) when running tests.
-
-        This should be a directory hierarchy under which the libunwind dylib 
can be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-]
-
-config.substitutions.append(('%{flags}',
-    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else 
''
-))
-config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
-))
-config.substitutions.append(('%{link_flags}',
-    '-nostdlib++ -L %{lib-dir} -lc++'
-))
-config.substitutions.append(('%{exec}',
-    '%{executor} --execdir %T --env 
DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}"
 -- '
-))
-
-config.stdlib = 'apple-libc++'
-config.using_system_stdlib = True
-
-libcxx.test.config.configure(
-    libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
-    libcxx.test.features.DEFAULT_FEATURES,
-    config,
-    lit_config
-)
diff --git a/libcxx/test/configs/apple-libc++-system.cfg.in 
b/libcxx/test/configs/apple-libc++-system.cfg.in
new file mode 100644
index 00000000000000..b59506f375c4a6
--- /dev/null
+++ b/libcxx/test/configs/apple-libc++-system.cfg.in
@@ -0,0 +1,33 @@
+# Testing configuration for back-deployment against the system-provided libc++.
+#
+# Under this configuration, we compile and link all the test suite against the 
just-built
+# libc++, but we run against the system libc++.
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
+import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else 
''
+))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
+))
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{lib-dir} -lc++'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- '
+))
+
+config.stdlib = 'apple-libc++'
+config.using_system_stdlib = True
+
+libcxx.test.config.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)
diff --git a/libcxx/utils/ci/buildkite-pipeline.yml 
b/libcxx/utils/ci/buildkite-pipeline.yml
index 906df734bc42b5..d1465721cf1648 100644
--- a/libcxx/utils/ci/buildkite-pipeline.yml
+++ b/libcxx/utils/ci/buildkite-pipeline.yml
@@ -37,48 +37,6 @@ definitions:
       - "**/crash_diagnostics/*"
 
 steps:
-- group: ':mac: Apple'
-  steps:
-  - label: Apple back-deployment macosx10.13
-    command: libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.13
-    agents:
-      queue: libcxx-builders
-      os: macos
-      arch: x86_64 # We need to use x86_64 for back-deployment CI on this 
target since macOS didn't support arm64 back then
-    <<: *common
-
-  - label: Apple back-deployment macosx10.15
-    command: libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.15
-    agents:
-      queue: libcxx-builders
-      os: macos
-      arch: x86_64 # We need to use x86_64 for back-deployment CI on this 
target since macOS didn't support arm64 back then
-    <<: *common
-
-  - label: Apple back-deployment with hardening enabled
-    command: libcxx/utils/ci/run-buildbot 
apple-system-backdeployment-hardened-11.0
-    agents:
-      queue: libcxx-builders
-      os: macos
-      arch: x86_64 # TODO: Remove this once we are able to run back-deployment 
on arm64 again, since this isn't x86_64 specific
-    <<: *common
-
-    # TODO: Re-enable this once we've figured out how to run back-deployment 
testing on arm64 on recent OSes
-    # - label: "Apple back-deployment macosx11.0 arm64"
-    #   command: "libcxx/utils/ci/run-buildbot 
apple-system-backdeployment-11.0"
-    #   artifact_paths:
-    #     - "**/test-results.xml"
-    #     - "**/*.abilist"
-    #   agents:
-    #     queue: "libcxx-builders"
-    #     os: "macos"
-    #     arch: "arm64"
-    #   retry:
-    #     automatic:
-    #       - exit_status: -1  # Agent was lost
-    #         limit: 2
-    #   timeout_in_minutes: 120
-
 - group: ARM
   steps:
   - label: AArch64
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index b0533cb9a49c93..7a688c24e5f98a 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -522,75 +522,35 @@ apple-configuration)
     # TODO: It would be better to run the tests against the fake-installed 
version of libc++ instead
     xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi 
check-cxx-abilist
 ;;
-apple-system-backdeployment-hardened-*)
+apple-system-hardened-*)
     clean
 
-    if [[ "${OSX_ROOTS}" == "" ]]; then
-        echo "--- Downloading previous macOS dylibs"
-        
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz";
-        OSX_ROOTS="${BUILD_DIR}/macos-roots"
-        mkdir -p "${OSX_ROOTS}"
-        curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C 
"${OSX_ROOTS}"
-    fi
-
-    DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-hardened-}"
-
-    # TODO: On Apple platforms, we never produce libc++abi.1.dylib or 
libunwind.1.dylib,
-    #       only libc++abi.dylib and libunwind.dylib. Fix that in the build so 
that the
-    #       tests stop searching for @rpath/libc++abi.1.dylib and 
@rpath/libunwind.1.dylib.
-    cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
-       "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
-    cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
-       "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
-
+    DEPLOYMENT_TARGET="${BUILDER#apple-system-hardened-}"
     arch="$(uname -m)"
     PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
-    PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
-    
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
-    
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
     PARAMS+=";hardening_mode=fast"
 
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
-                   -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
-                   
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
-                   
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
+                   -DLIBCXX_TEST_CONFIG="apple-libc++-system.cfg.in" \
+                   -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-system.cfg.in" \
+                   -DLIBUNWIND_TEST_CONFIG="apple-libunwind-system.cfg.in" \
                    -DLIBCXX_TEST_PARAMS="${PARAMS}" \
                    -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
                    -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
 
     check-runtimes
 ;;
-apple-system-backdeployment-*)
+apple-system-*)
     clean
 
-    if [[ "${OSX_ROOTS}" == "" ]]; then
-        echo "--- Downloading previous macOS dylibs"
-        
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz";
-        OSX_ROOTS="${BUILD_DIR}/macos-roots"
-        mkdir -p "${OSX_ROOTS}"
-        curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C 
"${OSX_ROOTS}"
-    fi
-
-    DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
-
-    # TODO: On Apple platforms, we never produce libc++abi.1.dylib or 
libunwind.1.dylib,
-    #       only libc++abi.dylib and libunwind.dylib. Fix that in the build so 
that the
-    #       tests stop searching for @rpath/libc++abi.1.dylib and 
@rpath/libunwind.1.dylib.
-    cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
-       "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
-    cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
-       "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
-
+    DEPLOYMENT_TARGET="${BUILDER#apple-system-}"
     arch="$(uname -m)"
     PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
-    PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
-    
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
-    
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
 
     generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
-                   -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
-                   
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
-                   
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
+                   -DLIBCXX_TEST_CONFIG="apple-libc++-system.cfg.in" \
+                   -DLIBCXXABI_TEST_CONFIG="apple-libc++abi-system.cfg.in" \
+                   -DLIBUNWIND_TEST_CONFIG="apple-libunwind-system.cfg.in" \
                    -DLIBCXX_TEST_PARAMS="${PARAMS}" \
                    -DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
                    -DLIBUNWIND_TEST_PARAMS="${PARAMS}"
diff --git a/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in 
b/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
deleted file mode 100644
index 9e725c523f29bf..00000000000000
--- a/libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
+++ /dev/null
@@ -1,66 +0,0 @@
-# Testing configuration for back-deployment against older Apple system 
libc++abi.
-#
-# Under this configuration, we compile and link all the test suite against the 
latest libc++abi,
-# however we run against the libc++abi on a different platform. This emulates 
the workflow of
-# a developer building their application using recent tools but with the goal 
of deploying
-# on existing devices running an older OS (and hence an older dylib).
-
-import os, site
-site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
-
-lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-
-BACKDEPLOYMENT_PARAMETERS = [
-    libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libc++) when running tests.
-
-        This should be a directory hierarchy under which the libc++ dylib can 
be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-    libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libc++abi) when running tests.
-
-        This should be a directory hierarchy under which the libc++abi dylib 
can be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-    libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libunwind) when running tests.
-
-        This should be a directory hierarchy under which the libunwind dylib 
can be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-]
-
-config.substitutions.append(('%{flags}',
-    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else 
''
-))
-config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} 
%{maybe-include-libunwind} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS 
' +
-    '-I %{libcxx}/test/support -I %{libcxx}/src'
-))
-config.substitutions.append(('%{link_flags}',
-    '-nostdlib++ -L %{lib} -lc++ -lc++abi'
-))
-config.substitutions.append(('%{exec}',
-    '%{executor} --execdir %T --env 
DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}"
 -- '
-))
-
-config.stdlib = 'apple-libc++'
-config.using_system_stdlib = True
-
-libcxx.test.config.configure(
-    libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
-    libcxx.test.features.DEFAULT_FEATURES,
-    config,
-    lit_config
-)
diff --git a/libcxxabi/test/configs/apple-libc++abi-system.cfg.in 
b/libcxxabi/test/configs/apple-libc++abi-system.cfg.in
new file mode 100644
index 00000000000000..8cff0efc4fdf41
--- /dev/null
+++ b/libcxxabi/test/configs/apple-libc++abi-system.cfg.in
@@ -0,0 +1,34 @@
+# Testing configuration for back-deployment against the system-provided 
libc++abi.
+#
+# Under this configuration, we compile and link all the test suite against the 
just-built
+# libc++abi, but we run against the system libc++abi.
+
+import os, site
+site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else 
''
+))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} 
%{maybe-include-libunwind} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS 
' +
+    '-I %{libcxx}/test/support -I %{libcxx}/src'
+))
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{lib} -lc++ -lc++abi'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- '
+))
+
+config.stdlib = 'apple-libc++'
+config.using_system_stdlib = True
+
+libcxx.test.config.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)
diff --git a/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in 
b/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
deleted file mode 100644
index 013c43ae78001b..00000000000000
--- a/libunwind/test/configs/apple-libunwind-backdeployment.cfg.in
+++ /dev/null
@@ -1,67 +0,0 @@
-# Testing configuration for back-deployment against older Apple system 
libunwind.
-#
-# Under this configuration, we compile and link all the test suite against the 
latest libunwind,
-# however we run against the libunwind on a different platform. This emulates 
the workflow of
-# a developer building their application using recent tools but with the goal 
of deploying
-# on existing devices running an older OS (and hence an older dylib).
-
-import os, site
-site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
-import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
-
-lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
-
-BACKDEPLOYMENT_PARAMETERS = [
-    libcxx.test.dsl.Parameter(name='cxx_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{cxx-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libc++) when running tests.
-
-        This should be a directory hierarchy under which the libc++ dylib can 
be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-    libcxx.test.dsl.Parameter(name='abi_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{abi-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libc++abi) when running tests.
-
-        This should be a directory hierarchy under which the libc++abi dylib 
can be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-    libcxx.test.dsl.Parameter(name='unwind_runtime_root', type=str,
-        actions=lambda root: 
[libcxx.test.dsl.AddSubstitution('%{unwind-runtime-root}', root)],
-        help="""
-        The simulated root of the system (for libunwind) when running tests.
-
-        This should be a directory hierarchy under which the libunwind dylib 
can be found.
-        The dylib in that hierarchy is the one that will be used at runtime 
when running
-        the tests.
-        """),
-]
-
-config.substitutions.append(('%{flags}',
-    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else 
''
-))
-config.substitutions.append(('%{compile_flags}',
-    '-nostdinc++ -I %{include}'
-))
-config.substitutions.append(('%{link_flags}',
-    '-nostdlib++ -L %{lib} -lc++ -lc++abi -lunwind'
-))
-config.substitutions.append(('%{exec}',
-    '%{executor} --execdir %T --env 
DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}:%{unwind-runtime-root}"
 -- '
-))
-
-config.stdlib = 'apple-libc++'
-config.using_system_stdlib = True
-
-import os, site
-import libcxx.test.params, libcxx.test.config
-libcxx.test.config.configure(
-    libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
-    libcxx.test.features.DEFAULT_FEATURES,
-    config,
-    lit_config
-)
diff --git a/libunwind/test/configs/apple-libunwind-system.cfg.in 
b/libunwind/test/configs/apple-libunwind-system.cfg.in
new file mode 100644
index 00000000000000..eb84c3c7b7b7e9
--- /dev/null
+++ b/libunwind/test/configs/apple-libunwind-system.cfg.in
@@ -0,0 +1,35 @@
+# Testing configuration for back-deployment against the system-provided 
libunwind.
+#
+# Under this configuration, we compile and link all the test suite against the 
just-built
+# libunwind, but we run against the system libunwind.
+
+import os, site
+site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
+import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
+
+lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
+
+config.substitutions.append(('%{flags}',
+    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else 
''
+))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -I %{include}'
+))
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{lib} -lc++ -lc++abi -lunwind'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T -- '
+))
+
+config.stdlib = 'apple-libc++'
+config.using_system_stdlib = True
+
+import os, site
+import libcxx.test.params, libcxx.test.config
+libcxx.test.config.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to