[runtimes] Run backdeployment CI on Github hosted runners (#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. As a drive-by change, also fix a few back-deployment annotations that were incorrect and add support for minor versions in the Lit feature determining availability from the target triple.
This commit is contained in:
23
.github/workflows/libcxx-build-and-test.yaml
vendored
23
.github/workflows/libcxx-build-and-test.yaml
vendored
@@ -193,17 +193,24 @@ jobs:
|
||||
**/crash_diagnostics/*
|
||||
|
||||
macos:
|
||||
runs-on: macos-14
|
||||
needs: [ stage1 ]
|
||||
strategy:
|
||||
fail-fast: true
|
||||
fail-fast: false
|
||||
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
|
||||
os: macos-13
|
||||
- config: apple-system-hardened
|
||||
os: macos-13
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: maxim-lobanov/setup-xcode@v1
|
||||
|
||||
@@ -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
|
||||
)
|
||||
33
libcxx/test/configs/apple-libc++-system.cfg.in
Normal file
33
libcxx/test/configs/apple-libc++-system.cfg.in
Normal file
@@ -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
|
||||
)
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
// basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode);
|
||||
|
||||
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
|
||||
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
|
||||
// basic_streambuf<charT, traits>* setbuf(char_type* s, streamsize n) override;
|
||||
|
||||
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
|
||||
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
|
||||
|
||||
#include <fstream>
|
||||
#include <cstddef>
|
||||
#include <cassert>
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
// explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in | ios_base::out);
|
||||
|
||||
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
|
||||
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
// void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);
|
||||
|
||||
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
|
||||
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
// explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out);
|
||||
|
||||
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
|
||||
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -13,6 +13,9 @@
|
||||
|
||||
// void open(const char* s, ios_base::openmode mode = ios_base::out);
|
||||
|
||||
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
|
||||
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
|
||||
|
||||
// XFAIL: LIBCXX-AIX-FIXME
|
||||
|
||||
#include <fstream>
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
// UNSUPPORTED: 32-bit-pointer
|
||||
// REQUIRES: large_tests
|
||||
|
||||
// This bug was fixed in the dylib by 53aed4759b33e33614e0f4e321bc1ef764b6d5b6.
|
||||
// XFAIL: using-built-library-before-llvm-17
|
||||
|
||||
// Android devices frequently don't have enough memory to run this test. Rather
|
||||
// than throw std::bad_alloc, exhausting memory triggers the OOM Killer.
|
||||
// UNSUPPORTED: LIBCXX-ANDROID-FIXME
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -522,80 +522,94 @@ 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"
|
||||
|
||||
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"
|
||||
version="$(sw_vers --productVersion)"
|
||||
params="target_triple=${arch}-apple-macosx${version}"
|
||||
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_PARAMS="${PARAMS}" \
|
||||
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
|
||||
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
|
||||
# In the Apple system configuration, we build libc++ and libunwind separately.
|
||||
${CMAKE} \
|
||||
-S "${MONOREPO_ROOT}/runtimes" \
|
||||
-B "${BUILD_DIR}/cxx" \
|
||||
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/cxx" \
|
||||
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
|
||||
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
|
||||
-DLIBCXX_CXX_ABI=libcxxabi \
|
||||
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
||||
-DLIBCXX_TEST_CONFIG="apple-libc++-system.cfg.in" \
|
||||
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-system.cfg.in" \
|
||||
-DLIBCXX_TEST_PARAMS="${params}" \
|
||||
-DLIBCXXABI_TEST_PARAMS="${params}"
|
||||
|
||||
check-runtimes
|
||||
${CMAKE} \
|
||||
-S "${MONOREPO_ROOT}/runtimes" \
|
||||
-B "${BUILD_DIR}/unwind" \
|
||||
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/unwind" \
|
||||
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
|
||||
-DLLVM_ENABLE_RUNTIMES="libunwind" \
|
||||
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-system.cfg.in" \
|
||||
-DLIBUNWIND_TEST_PARAMS="${params}" \
|
||||
-DCMAKE_INSTALL_NAME_DIR="/usr/lib/system"
|
||||
|
||||
echo "+++ Running the libc++ tests"
|
||||
${NINJA} -vC "${BUILD_DIR}/cxx" check-cxx
|
||||
|
||||
echo "+++ Running the libc++abi tests"
|
||||
${NINJA} -vC "${BUILD_DIR}/cxx" check-cxxabi
|
||||
|
||||
echo "+++ Running the libunwind tests"
|
||||
${NINJA} -vC "${BUILD_DIR}/unwind" check-unwind
|
||||
;;
|
||||
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"
|
||||
|
||||
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}"
|
||||
version="$(sw_vers --productVersion)"
|
||||
params="target_triple=${arch}-apple-macosx${version}"
|
||||
|
||||
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_PARAMS="${PARAMS}" \
|
||||
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
|
||||
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
|
||||
# In the Apple system configuration, we build libc++ and libunwind separately.
|
||||
${CMAKE} \
|
||||
-S "${MONOREPO_ROOT}/runtimes" \
|
||||
-B "${BUILD_DIR}/cxx" \
|
||||
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/cxx" \
|
||||
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
|
||||
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" \
|
||||
-DLIBCXX_CXX_ABI=libcxxabi \
|
||||
-C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
|
||||
-DLIBCXX_TEST_CONFIG="apple-libc++-system.cfg.in" \
|
||||
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-system.cfg.in" \
|
||||
-DLIBCXX_TEST_PARAMS="${params}" \
|
||||
-DLIBCXXABI_TEST_PARAMS="${params}"
|
||||
|
||||
check-runtimes
|
||||
${CMAKE} \
|
||||
-S "${MONOREPO_ROOT}/runtimes" \
|
||||
-B "${BUILD_DIR}/unwind" \
|
||||
-GNinja -DCMAKE_MAKE_PROGRAM="${NINJA}" \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_INSTALL_PREFIX="${INSTALL_DIR}/unwind" \
|
||||
-DLLVM_LIT_ARGS="-sv --xunit-xml-output test-results.xml --timeout=1500 --time-tests" \
|
||||
-DLLVM_ENABLE_RUNTIMES="libunwind" \
|
||||
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-system.cfg.in" \
|
||||
-DLIBUNWIND_TEST_PARAMS="${params}" \
|
||||
-DCMAKE_INSTALL_NAME_DIR="/usr/lib/system"
|
||||
|
||||
echo "+++ Running the libc++ tests"
|
||||
${NINJA} -vC "${BUILD_DIR}/cxx" check-cxx
|
||||
|
||||
echo "+++ Running the libc++abi tests"
|
||||
${NINJA} -vC "${BUILD_DIR}/cxx" check-cxxabi
|
||||
|
||||
echo "+++ Running the libunwind tests"
|
||||
${NINJA} -vC "${BUILD_DIR}/unwind" check-unwind
|
||||
;;
|
||||
benchmarks)
|
||||
clean
|
||||
|
||||
@@ -620,21 +620,21 @@ DEFAULT_FEATURES += [
|
||||
Feature(
|
||||
name="_target-has-llvm-17",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.0)?}} || target={{.+}}-apple-macosx{{1[5-9]([.].+)?}}",
|
||||
"_target-has-llvm-18 || target={{.+}}-apple-macosx{{14.[4-9](.[0-9]+)?}} || target={{.+}}-apple-macosx{{1[5-9]([.].+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
Feature(
|
||||
name="_target-has-llvm-16",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-17 || target={{.+}}-apple-macosx{{14.[0-3](.0)?}}",
|
||||
"_target-has-llvm-17 || target={{.+}}-apple-macosx{{14.[0-3](.[0-9]+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
Feature(
|
||||
name="_target-has-llvm-15",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-16 || target={{.+}}-apple-macosx{{13.[4-9](.0)?}}",
|
||||
"_target-has-llvm-16 || target={{.+}}-apple-macosx{{13.[4-9](.[0-9]+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
@@ -648,21 +648,21 @@ DEFAULT_FEATURES += [
|
||||
Feature(
|
||||
name="_target-has-llvm-13",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-14 || target={{.+}}-apple-macosx{{13.[0-3](.0)?}}",
|
||||
"_target-has-llvm-14 || target={{.+}}-apple-macosx{{13.[0-3](.[0-9]+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
Feature(
|
||||
name="_target-has-llvm-12",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-13 || target={{.+}}-apple-macosx{{12.[3-9](.0)?}}",
|
||||
"_target-has-llvm-13 || target={{.+}}-apple-macosx{{12.[3-9](.[0-9]+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
Feature(
|
||||
name="_target-has-llvm-11",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-12 || target={{.+}}-apple-macosx{{(11.[0-9]|12.[0-2])(.0)?}}",
|
||||
"_target-has-llvm-12 || target={{.+}}-apple-macosx{{(11.[0-9]|12.[0-2])(.[0-9]+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
@@ -676,7 +676,7 @@ DEFAULT_FEATURES += [
|
||||
Feature(
|
||||
name="_target-has-llvm-9",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"_target-has-llvm-10 || target={{.+}}-apple-macosx{{10.15(.0)?}}",
|
||||
"_target-has-llvm-10 || target={{.+}}-apple-macosx{{10.15(.[0-9]+)?}}",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
@@ -719,7 +719,7 @@ DEFAULT_FEATURES += [
|
||||
# a libc++ flavor that enables availability markup. Similarly, a test could fail when
|
||||
# run against the system library of an older version of FreeBSD, even though FreeBSD
|
||||
# doesn't provide availability markup at the time of writing this.
|
||||
for version in ("9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19"):
|
||||
for version in ("9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"):
|
||||
DEFAULT_FEATURES.append(
|
||||
Feature(
|
||||
name="using-built-library-before-llvm-{}".format(version),
|
||||
@@ -755,11 +755,19 @@ DEFAULT_FEATURES += [
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
# Tests that require std::to_chars(floating-point) in the built library
|
||||
Feature(
|
||||
name="availability-fp_to_chars-missing",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-14)",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
# Tests that require __libcpp_verbose_abort support in the built library
|
||||
Feature(
|
||||
name="availability-verbose_abort-missing",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-13)",
|
||||
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-15)",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
@@ -767,15 +775,7 @@ DEFAULT_FEATURES += [
|
||||
Feature(
|
||||
name="availability-pmr-missing",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-13)",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
# Tests that require std::to_chars(floating-point) in the built library
|
||||
Feature(
|
||||
name="availability-fp_to_chars-missing",
|
||||
when=lambda cfg: BooleanExpression.evaluate(
|
||||
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-14)",
|
||||
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-16)",
|
||||
cfg.available_features,
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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
|
||||
)
|
||||
34
libcxxabi/test/configs/apple-libc++abi-system.cfg.in
Normal file
34
libcxxabi/test/configs/apple-libc++abi-system.cfg.in
Normal file
@@ -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++'
|
||||
))
|
||||
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
|
||||
)
|
||||
@@ -9,9 +9,8 @@
|
||||
// This test is too big for most embedded devices.
|
||||
// XFAIL: LIBCXX-PICOLIBC-FIXME
|
||||
|
||||
// https://llvm.org/PR51407 was not fixed in some previously-released
|
||||
// demanglers, which causes them to run into the infinite loop.
|
||||
// UNSUPPORTED: using-built-library-before-llvm-14
|
||||
// This test exercises support for char array initializer lists added in dd8b266ef.
|
||||
// UNSUPPORTED: using-built-library-before-llvm-20
|
||||
|
||||
// Android's long double on x86[-64] is (64/128)-bits instead of Linux's usual
|
||||
// 80-bit format, and this demangling test is failing on it.
|
||||
|
||||
@@ -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
|
||||
)
|
||||
41
libunwind/test/configs/apple-libunwind-system.cfg.in
Normal file
41
libunwind/test/configs/apple-libunwind-system.cfg.in
Normal file
@@ -0,0 +1,41 @@
|
||||
# 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++ -lunwind'
|
||||
))
|
||||
config.substitutions.append(('%{exec}',
|
||||
'%{executor} --execdir %T -- '
|
||||
))
|
||||
|
||||
config.stdlib = 'apple-libc++'
|
||||
config.using_system_stdlib = True
|
||||
|
||||
# TODO: This is a giant hack, but we need to change the install_name of libunwind.dylib because the
|
||||
# upstream configuration can't currently produce a libunwind.dylib that is compatible with the
|
||||
# Apple system one.
|
||||
import subprocess
|
||||
subprocess.check_call(['install_name_tool', '-id', '/usr/lib/system/libunwind.dylib', '@LIBUNWIND_TESTING_INSTALL_PREFIX@/lib/libunwind.dylib'])
|
||||
|
||||
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
|
||||
)
|
||||
Reference in New Issue
Block a user