[libcxx] [llvm] [libc++] Bump OS version for macOS backdeployment CI jobs (PR #131883)

Louis Dionne via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 4 14:29:24 PDT 2025


https://github.com/ldionne updated https://github.com/llvm/llvm-project/pull/131883

>From 097afe2b3d7a21b95c3461fe18141f0ff7c62c57 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 18 Mar 2025 14:07:35 -0400
Subject: [PATCH 1/5] [libc++] Bump OS version for macOS backdeployment CI jobs

In 0547e573c555, I introduced backdeployment testing on macOS using
Github-provided builders. This was done by basically building libc++
on a slightly older macOS (like macOS 13) and then running against
the system library on that machine. However, that created a dependency
that libc++ must keep working on macOS 13, which doesn't support the
latest-released Xcode.

This patch solves that problem by moving the deployment testing to a
newer version of macOS which supports the latest-released version of
Xcode.

Sadly, that also reduces the backdeployment coverage we have since we're
not actually testing on older OSes, but is necessary to satisfy the
documented libc++ support policy. In the future, we could improve the
situation by providing a Lit configuration that allows compiling
(but not running) all the tests, building the tests on a supported macOS,
and then shipping those tests on an older backdeployment target in order
to run them against the system library. Since that requires significant
engineering, this isn't done at this time.
---
 .github/workflows/libcxx-build-and-test.yaml | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/libcxx-build-and-test.yaml b/.github/workflows/libcxx-build-and-test.yaml
index bb7243a19cf70..e3d85991b2726 100644
--- a/.github/workflows/libcxx-build-and-test.yaml
+++ b/.github/workflows/libcxx-build-and-test.yaml
@@ -201,10 +201,20 @@ jobs:
           os: macos-15
         - config: apple-configuration
           os: macos-15
+        # TODO: These jobs are intended to test back-deployment (building against ToT libc++ but running against an
+        #       older system-provided libc++.dylib). Doing this properly would require building the test suite on a
+        #       recent macOS using a recent Clang (hence recent Xcode), and then running the actual test suite on an
+        #       older mac. We could do that by e.g. sharing artifacts between the two jobs.
+        #
+        #       However, our Lit configuration currently doesn't provide a good way to do that in a batch, so our only
+        #       alternative is to actually build on the same host that we're going to run on. Sadly, that doesn't work
+        #       since older macOSes don't support newer Xcodes. For now, we run the "backdeployment" jobs on recent
+        #       macOS versions as a way to avoid rotting that configuration, but it doesn't provide a lot of additional
+        #       coverage.
         - config: apple-system
-          os: macos-13
+          os: macos-15
         - config: apple-system-hardened
-          os: macos-13
+          os: macos-15
     runs-on: ${{ matrix.os }}
     steps:
       - uses: actions/checkout at 11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

>From 29dacc416765c49efcc71ef411deba3975516210 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 1 Apr 2025 13:44:46 -0400
Subject: [PATCH 2/5] Adjust XFAIL

---
 .../file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp
index 10435dc482367..3e09ab4d0f22a 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/setbuf.pass.cpp
@@ -10,8 +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
+// This test requires the fix to https://github.com/llvm/llvm-project/issues/60509 in the dylib,
+// which landed in 5afb937d8a30445642ccaf33866ee4cdd0713222.
+// XFAIL: using-built-library-before-llvm-19
 
 #include <fstream>
 #include <cstddef>

>From e4b28b87315180e9a9f3afec3c08027e7c5823be Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 1 Apr 2025 13:59:56 -0400
Subject: [PATCH 3/5] Re-add previously removed XFAILs to facet tests

---
 .../locale.num.get/facet.num.get.members/get_double.pass.cpp  | 4 ++++
 .../locale.num.get/facet.num.get.members/get_float.pass.cpp   | 4 ++++
 .../facet.num.get.members/get_long_double.pass.cpp            | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
index 1708e94b682c4..a388c0b15a840 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_double.pass.cpp
@@ -6,6 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+// The fix for LWG2381 (https://github.com/llvm/llvm-project/pull/77948) changed behavior of
+// FP parsing. This requires 3e15c97fa3812993bdc319827a5c6d867b765ae8 in the dylib.
+// XFAIL: using-built-library-before-llvm-19
+
 // <locale>
 
 // class num_get<charT, InputIterator>
diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
index 8268b5419eb3e..596d81cbc8c91 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_float.pass.cpp
@@ -6,6 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+// The fix for LWG2381 (https://github.com/llvm/llvm-project/pull/77948) changed behavior of
+// FP parsing. This requires 3e15c97fa3812993bdc319827a5c6d867b765ae8 in the dylib.
+// XFAIL: using-built-library-before-llvm-19
+
 // <locale>
 
 // class num_get<charT, InputIterator>
diff --git a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
index f3569ed6e5d89..8a9fd41501626 100644
--- a/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
+++ b/libcxx/test/std/localization/locale.categories/category.numeric/locale.num.get/facet.num.get.members/get_long_double.pass.cpp
@@ -6,6 +6,10 @@
 //
 //===----------------------------------------------------------------------===//
 
+// The fix for LWG2381 (https://github.com/llvm/llvm-project/pull/77948) changed behavior of
+// FP parsing. This requires 3e15c97fa3812993bdc319827a5c6d867b765ae8 in the dylib.
+// XFAIL: using-built-library-before-llvm-19
+
 // <locale>
 
 // class num_get<charT, InputIterator>

>From e4ffddc20ffaf1ca7561f5cc294de602d4446983 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 1 Apr 2025 14:05:43 -0400
Subject: [PATCH 4/5] Add missing XFAIL to
 libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp

---
 .../basic.string/string.capacity/over_max_size.pass.cpp     | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
index b919551c9f880..5eb3240699a81 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/over_max_size.pass.cpp
@@ -8,6 +8,12 @@
 
 // UNSUPPORTED: no-exceptions
 
+// After changing the alignment of the allocated pointer from 16 to 8, the exception
+// thrown is no longer `bad_alloc` but instead length_error on systems using new
+// headers but a dylib that doesn't contain 04ce0ba.
+//
+// XFAIL: using-built-library-before-llvm-19
+
 // <string>
 
 // size_type max_size() const; // constexpr since C++20

>From 0f54f56275c2ad794bbfdea1c3de66d8b218c3e5 Mon Sep 17 00:00:00 2001
From: Louis Dionne <ldionne.2 at gmail.com>
Date: Tue, 1 Apr 2025 14:15:38 -0400
Subject: [PATCH 5/5] Remove XFAILs that are apparently for incorrect reasons
 in string tests

---
 .../basic.string/string.capacity/allocation_size.pass.cpp   | 5 -----
 .../strings/basic.string/string.capacity/max_size.pass.cpp  | 6 ------
 2 files changed, 11 deletions(-)

diff --git a/libcxx/test/libcxx/strings/basic.string/string.capacity/allocation_size.pass.cpp b/libcxx/test/libcxx/strings/basic.string/string.capacity/allocation_size.pass.cpp
index 6f127e1b62b02..77da29225957b 100644
--- a/libcxx/test/libcxx/strings/basic.string/string.capacity/allocation_size.pass.cpp
+++ b/libcxx/test/libcxx/strings/basic.string/string.capacity/allocation_size.pass.cpp
@@ -8,11 +8,6 @@
 
 // <string>
 
-// This test demonstrates the smaller allocation sizes when the alignment
-// requirements of std::string are dropped from 16 to 8.
-//
-// XFAIL: using-built-library-before-llvm-19
-
 #include <algorithm>
 #include <cassert>
 #include <cstddef>
diff --git a/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp b/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
index f68f9e9d5fe29..ac660d8fe9941 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/max_size.pass.cpp
@@ -10,12 +10,6 @@
 
 // XFAIL: FROZEN-CXX03-HEADERS-FIXME
 
-// After changing the alignment of the allocated pointer from 16 to 8, the exception
-// thrown is no longer `bad_alloc` but instead length_error on systems using new
-// headers but a dylib that doesn't contain 04ce0ba.
-//
-// XFAIL: using-built-library-before-llvm-19
-
 // <string>
 
 // size_type max_size() const; // constexpr since C++20



More information about the llvm-commits mailing list