Skip to content

Commit 6567a45

Browse files
committed
[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.
1 parent 1c1bb77 commit 6567a45

File tree

17 files changed

+158
-322
lines changed

17 files changed

+158
-322
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,24 @@ jobs:
193193
**/crash_diagnostics/*
194194
195195
macos:
196-
runs-on: macos-14
197196
needs: [ stage1 ]
198197
strategy:
199-
fail-fast: true
198+
fail-fast: false
200199
matrix:
201-
config: [
202-
generic-cxx03,
203-
generic-cxx23,
204-
generic-modules,
205-
apple-configuration
206-
]
200+
include:
201+
- config: generic-cxx03
202+
os: macos-latest
203+
- config: generic-cxx23
204+
os: macos-latest
205+
- config: generic-modules
206+
os: macos-latest
207+
- config: apple-configuration
208+
os: macos-latest
209+
- config: apple-system
210+
os: macos-13
211+
- config: apple-system-hardened
212+
os: macos-13
213+
runs-on: ${{ matrix.os }}
207214
steps:
208215
- uses: actions/checkout@v4
209216
- uses: maxim-lobanov/setup-xcode@v1

libcxx/test/configs/apple-libc++-backdeployment.cfg.in

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Testing configuration for back-deployment against the system-provided libc++.
2+
#
3+
# Under this configuration, we compile and link all the test suite against the just-built
4+
# libc++, but we run against the system libc++.
5+
6+
import os, site
7+
site.addsitedir(os.path.join('@LIBCXX_SOURCE_DIR@', 'utils'))
8+
import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
9+
10+
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
11+
12+
config.substitutions.append(('%{flags}',
13+
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
14+
))
15+
config.substitutions.append(('%{compile_flags}',
16+
'-nostdinc++ -I %{include-dir} -I %{libcxx-dir}/test/support'
17+
))
18+
config.substitutions.append(('%{link_flags}',
19+
'-nostdlib++ -L %{lib-dir} -lc++'
20+
))
21+
config.substitutions.append(('%{exec}',
22+
'%{executor} --execdir %T -- '
23+
))
24+
25+
config.stdlib = 'apple-libc++'
26+
config.using_system_stdlib = True
27+
28+
libcxx.test.config.configure(
29+
libcxx.test.params.DEFAULT_PARAMETERS,
30+
libcxx.test.features.DEFAULT_FEATURES,
31+
config,
32+
lit_config
33+
)

libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
// basic_filebuf<charT,traits>* open(const char* s, ios_base::openmode mode);
1212

13+
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
14+
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
15+
1316
// XFAIL: LIBCXX-AIX-FIXME
1417

1518
#include <fstream>

libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
// basic_streambuf<charT, traits>* setbuf(char_type* s, streamsize n) override;
1212

13+
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
14+
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
15+
1316
#include <fstream>
1417
#include <cstddef>
1518
#include <cassert>

libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
// explicit basic_fstream(const char* s, ios_base::openmode mode = ios_base::in | ios_base::out);
1515

16+
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
17+
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
18+
1619
// XFAIL: LIBCXX-AIX-FIXME
1720

1821
#include <fstream>

libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
// void open(const char* s, ios_base::openmode mode = ios_base::in|ios_base::out);
1515

16+
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
17+
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
18+
1619
// XFAIL: LIBCXX-AIX-FIXME
1720

1821
#include <fstream>

libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
// explicit basic_ofstream(const char* s, ios_base::openmode mode = ios_base::out);
1515

16+
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
17+
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
18+
1619
// XFAIL: LIBCXX-AIX-FIXME
1720

1821
#include <fstream>

libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
// void open(const char* s, ios_base::openmode mode = ios_base::out);
1515

16+
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
17+
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
18+
1619
// XFAIL: LIBCXX-AIX-FIXME
1720

1821
#include <fstream>

libcxx/test/std/input.output/string.streams/stringstream/stringstream.members/gcount.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: 32-bit-pointer
1010
// REQUIRES: large_tests
1111

12+
// This bug was fixed in the dylib by 53aed4759b33e33614e0f4e321bc1ef764b6d5b6.
13+
// XFAIL: using-built-library-before-llvm-17
14+
1215
// Android devices frequently don't have enough memory to run this test. Rather
1316
// than throw std::bad_alloc, exhausting memory triggers the OOM Killer.
1417
// UNSUPPORTED: LIBCXX-ANDROID-FIXME

libcxx/utils/ci/buildkite-pipeline.yml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -37,48 +37,6 @@ definitions:
3737
- "**/crash_diagnostics/*"
3838

3939
steps:
40-
- group: ':mac: Apple'
41-
steps:
42-
- label: Apple back-deployment macosx10.13
43-
command: libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.13
44-
agents:
45-
queue: libcxx-builders
46-
os: macos
47-
arch: x86_64 # We need to use x86_64 for back-deployment CI on this target since macOS didn't support arm64 back then
48-
<<: *common
49-
50-
- label: Apple back-deployment macosx10.15
51-
command: libcxx/utils/ci/run-buildbot apple-system-backdeployment-10.15
52-
agents:
53-
queue: libcxx-builders
54-
os: macos
55-
arch: x86_64 # We need to use x86_64 for back-deployment CI on this target since macOS didn't support arm64 back then
56-
<<: *common
57-
58-
- label: Apple back-deployment with hardening enabled
59-
command: libcxx/utils/ci/run-buildbot apple-system-backdeployment-hardened-11.0
60-
agents:
61-
queue: libcxx-builders
62-
os: macos
63-
arch: x86_64 # TODO: Remove this once we are able to run back-deployment on arm64 again, since this isn't x86_64 specific
64-
<<: *common
65-
66-
# TODO: Re-enable this once we've figured out how to run back-deployment testing on arm64 on recent OSes
67-
# - label: "Apple back-deployment macosx11.0 arm64"
68-
# command: "libcxx/utils/ci/run-buildbot apple-system-backdeployment-11.0"
69-
# artifact_paths:
70-
# - "**/test-results.xml"
71-
# - "**/*.abilist"
72-
# agents:
73-
# queue: "libcxx-builders"
74-
# os: "macos"
75-
# arch: "arm64"
76-
# retry:
77-
# automatic:
78-
# - exit_status: -1 # Agent was lost
79-
# limit: 2
80-
# timeout_in_minutes: 120
81-
8240
- group: ARM
8341
steps:
8442
- label: AArch64

libcxx/utils/ci/run-buildbot

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -522,78 +522,24 @@ apple-configuration)
522522
# TODO: It would be better to run the tests against the fake-installed version of libc++ instead
523523
xcrun --sdk macosx ninja -vC "${BUILD_DIR}/${arch}" check-cxx check-cxxabi check-cxx-abilist
524524
;;
525-
apple-system-backdeployment-hardened-*)
525+
apple-system-hardened)
526526
clean
527-
528-
if [[ "${OSX_ROOTS}" == "" ]]; then
529-
echo "--- Downloading previous macOS dylibs"
530-
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
531-
OSX_ROOTS="${BUILD_DIR}/macos-roots"
532-
mkdir -p "${OSX_ROOTS}"
533-
curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
534-
fi
535-
536-
DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-hardened-}"
537-
538-
# TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
539-
# only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
540-
# tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
541-
cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
542-
"${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
543-
cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
544-
"${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
545-
546-
arch="$(uname -m)"
547-
PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
548-
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
549-
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
550-
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
551-
PARAMS+=";hardening_mode=fast"
552-
553527
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
554-
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
555-
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
556-
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
557-
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
558-
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
559-
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
528+
-DLIBCXX_TEST_CONFIG="apple-libc++-system.cfg.in" \
529+
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-system.cfg.in" \
530+
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-system.cfg.in" \
531+
-DLIBCXX_TEST_PARAMS="hardening_mode=fast" \
532+
-DLIBCXXABI_TEST_PARAMS="hardening_mode=fast" \
533+
-DLIBUNWIND_TEST_PARAMS="hardening_mode=fast"
560534

561535
check-runtimes
562536
;;
563-
apple-system-backdeployment-*)
537+
apple-system)
564538
clean
565-
566-
if [[ "${OSX_ROOTS}" == "" ]]; then
567-
echo "--- Downloading previous macOS dylibs"
568-
PREVIOUS_DYLIBS_URL="https://dl.dropboxusercontent.com/s/gmcfxwgl9f9n6pu/libcxx-roots.tar.gz"
569-
OSX_ROOTS="${BUILD_DIR}/macos-roots"
570-
mkdir -p "${OSX_ROOTS}"
571-
curl "${PREVIOUS_DYLIBS_URL}" | tar -xz --strip-components=1 -C "${OSX_ROOTS}"
572-
fi
573-
574-
DEPLOYMENT_TARGET="${BUILDER#apple-system-backdeployment-}"
575-
576-
# TODO: On Apple platforms, we never produce libc++abi.1.dylib or libunwind.1.dylib,
577-
# only libc++abi.dylib and libunwind.dylib. Fix that in the build so that the
578-
# tests stop searching for @rpath/libc++abi.1.dylib and @rpath/libunwind.1.dylib.
579-
cp "${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.dylib" \
580-
"${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}/libc++abi.1.dylib"
581-
cp "${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.dylib" \
582-
"${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}/libunwind.1.dylib"
583-
584-
arch="$(uname -m)"
585-
PARAMS="target_triple=${arch}-apple-macosx${DEPLOYMENT_TARGET}"
586-
PARAMS+=";cxx_runtime_root=${OSX_ROOTS}/macOS/libc++/${DEPLOYMENT_TARGET}"
587-
PARAMS+=";abi_runtime_root=${OSX_ROOTS}/macOS/libc++abi/${DEPLOYMENT_TARGET}"
588-
PARAMS+=";unwind_runtime_root=${OSX_ROOTS}/macOS/libunwind/${DEPLOYMENT_TARGET}"
589-
590539
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
591-
-DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
592-
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-backdeployment.cfg.in" \
593-
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-backdeployment.cfg.in" \
594-
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
595-
-DLIBCXXABI_TEST_PARAMS="${PARAMS}" \
596-
-DLIBUNWIND_TEST_PARAMS="${PARAMS}"
540+
-DLIBCXX_TEST_CONFIG="apple-libc++-system.cfg.in" \
541+
-DLIBCXXABI_TEST_CONFIG="apple-libc++abi-system.cfg.in" \
542+
-DLIBUNWIND_TEST_CONFIG="apple-libunwind-system.cfg.in"
597543

598544
check-runtimes
599545
;;

libcxx/utils/libcxx/test/features.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -747,27 +747,27 @@ def check_gdb(cfg):
747747
cfg.available_features,
748748
),
749749
),
750-
# Tests that require __libcpp_verbose_abort support in the built library
750+
# Tests that require std::to_chars(floating-point) in the built library
751751
Feature(
752-
name="availability-verbose_abort-missing",
752+
name="availability-fp_to_chars-missing",
753753
when=lambda cfg: BooleanExpression.evaluate(
754-
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-13)",
754+
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-14)",
755755
cfg.available_features,
756756
),
757757
),
758-
# Tests that require std::pmr support in the built library
758+
# Tests that require __libcpp_verbose_abort support in the built library
759759
Feature(
760-
name="availability-pmr-missing",
760+
name="availability-verbose_abort-missing",
761761
when=lambda cfg: BooleanExpression.evaluate(
762-
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-13)",
762+
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-15)",
763763
cfg.available_features,
764764
),
765765
),
766-
# Tests that require std::to_chars(floating-point) in the built library
766+
# Tests that require std::pmr support in the built library
767767
Feature(
768-
name="availability-fp_to_chars-missing",
768+
name="availability-pmr-missing",
769769
when=lambda cfg: BooleanExpression.evaluate(
770-
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-14)",
770+
"!libcpp-has-no-availability-markup && (stdlib=apple-libc++ && !_target-has-llvm-16)",
771771
cfg.available_features,
772772
),
773773
),

0 commit comments

Comments
 (0)