[libcxx-commits] [PATCH] D119466: [libc++abi] Add a from-scratch testing config for Apple backdeployment

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 10 11:56:21 PST 2022


ldionne created this revision.
Herald added a subscriber: arichardson.
ldionne requested review of this revision.
Herald added projects: libc++, libc++abi.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
Herald added a reviewer: libc++abi.

We added one for libc++ recently, and this patch adds one for libc++abi.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D119466

Files:
  libcxx/utils/ci/run-buildbot
  libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in


Index: libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
===================================================================
--- /dev/null
+++ libcxxabi/test/configs/apple-libc++abi-backdeployment.cfg.in
@@ -0,0 +1,54 @@
+# 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.newconfig, 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.
+        """),
+]
+
+config.substitutions.append(('%{flags}',
+    '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
+))
+config.substitutions.append(('%{compile_flags}',
+    '-nostdinc++ -isystem %{install}/include/c++/v1 -DLIBCXXABI_NO_TIMER -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS ' +
+    '-I %{libcxx}/test/support -I %{libcxx}/src'
+))
+config.substitutions.append(('%{link_flags}',
+    '-nostdlib++ -L %{install}/lib -lc++ -lc++abi'
+))
+config.substitutions.append(('%{exec}',
+    '%{executor} --execdir %T --env DYLD_LIBRARY_PATH="%{cxx-runtime-root}:%{abi-runtime-root}" -- '
+))
+
+libcxx.test.newconfig.configure(
+    libcxx.test.params.DEFAULT_PARAMETERS + BACKDEPLOYMENT_PARAMETERS,
+    libcxx.test.features.DEFAULT_FEATURES,
+    config,
+    lit_config
+)
Index: libcxx/utils/ci/run-buildbot
===================================================================
--- libcxx/utils/ci/run-buildbot
+++ libcxx/utils/ci/run-buildbot
@@ -448,6 +448,7 @@
 
     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" \
                    -DLIBCXX_TEST_PARAMS="${PARAMS}" \
                    -DLIBCXXABI_TEST_PARAMS="${PARAMS}"
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119466.407627.patch
Type: text/x-patch
Size: 3234 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220210/5d12fcd5/attachment.bin>


More information about the libcxx-commits mailing list