[libcxx-commits] [libcxx] 768b50d - [libc++] Add a Lit configuration for running back-deployment tests
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Feb 8 08:14:29 PST 2022
Author: Louis Dionne
Date: 2022-02-08T11:13:58-05:00
New Revision: 768b50df296907e80313c43b981830b3799ef1db
URL: https://github.com/llvm/llvm-project/commit/768b50df296907e80313c43b981830b3799ef1db
DIFF: https://github.com/llvm/llvm-project/commit/768b50df296907e80313c43b981830b3799ef1db.diff
LOG: [libc++] Add a Lit configuration for running back-deployment tests
This testing configuration links tests against one libc++ shared library,
but runs them against another libc++ shared library. This makes sure that
we can build applications against the libc++ provided in a recent SDK and
back-deploy them to platforms containing older libc++ dylibs.
It also switches the Apple CI script to using that new configuration
instead of the legacy one.
Differential Revision: https://reviews.llvm.org/D119195
Added:
libcxx/test/configs/apple-libc++-backdeployment.cfg.in
Modified:
libcxx/utils/ci/run-buildbot
Removed:
################################################################################
diff --git a/libcxx/test/configs/apple-libc++-backdeployment.cfg.in b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
new file mode 100644
index 0000000000000..7e0e1c2e06880
--- /dev/null
+++ b/libcxx/test/configs/apple-libc++-backdeployment.cfg.in
@@ -0,0 +1,53 @@
+# 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
diff erent 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.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 -I %{libcxx}/test/support'
+))
+config.substitutions.append(('%{link_flags}',
+ '-nostdlib++ -L %{install}/lib -lc++'
+))
+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
+)
diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot
index 50a7ca8d2a97f..080c9643d309a 100755
--- a/libcxx/utils/ci/run-buildbot
+++ b/libcxx/utils/ci/run-buildbot
@@ -447,6 +447,7 @@ apple-system-backdeployment-*)
PARAMS+=";use_system_cxx_lib=True"
generate-cmake -C "${MONOREPO_ROOT}/libcxx/cmake/caches/Apple.cmake" \
+ -DLIBCXX_TEST_CONFIG="apple-libc++-backdeployment.cfg.in" \
-DLIBCXX_TEST_PARAMS="${PARAMS}" \
-DLIBCXXABI_TEST_PARAMS="${PARAMS}"
More information about the libcxx-commits
mailing list