From 21b0ec2fc6e17a0ba3921ed8146b7d410ce250c9 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 15 May 2020 11:33:59 -0400 Subject: [PATCH] [libc++] Do not rely on use_system_cxx_lib to specify the path of the library to run against This is already handled by setting cxx_runtime_root instead -- I don't see a reason to have two ways of setting the runtime path of the library we're running against. --- libcxx/docs/DesignDocs/AvailabilityMarkup.rst | 8 ++--- libcxx/docs/TestingLibcxx.rst | 8 +++-- libcxx/utils/ci/macos-backdeployment.sh | 3 +- libcxx/utils/libcxx/test/config.py | 44 ++++++--------------------- libcxx/utils/libcxx/test/target_info.py | 3 -- 5 files changed, 18 insertions(+), 48 deletions(-) diff --git a/libcxx/docs/DesignDocs/AvailabilityMarkup.rst b/libcxx/docs/DesignDocs/AvailabilityMarkup.rst index 586c793..87ad0ab 100644 --- a/libcxx/docs/DesignDocs/AvailabilityMarkup.rst +++ b/libcxx/docs/DesignDocs/AvailabilityMarkup.rst @@ -66,15 +66,11 @@ availability. * The `platform` parameter controls the deployment target. For example lit can be invoked with `--param=platform=macosx10.12`. Default is the current host. -* The `use_system_cxx_lib` parameter indicates to use another library than the - just built one. Invoking lit with `--param=use_system_cxx_lib=true` will run - the test-suite against the host system library. Alternatively a path to the - directory containing a specific prebuilt libc++ can be used, for example: - `--param=use_system_cxx_lib=/path/to/macOS/10.12/`. +* The `use_system_cxx_lib` parameter indicates that the test suite is being run + against a system library. Tests can be marked as XFAIL based on multiple features made available by lit: - * if `--param=platform=macosx10.12` is passed, the following features will be available: - availability=macosx diff --git a/libcxx/docs/TestingLibcxx.rst b/libcxx/docs/TestingLibcxx.rst index 78134bc..cc684e7 100644 --- a/libcxx/docs/TestingLibcxx.rst +++ b/libcxx/docs/TestingLibcxx.rst @@ -140,8 +140,7 @@ default. .. option:: cxx_library_root= Specify the directory of the libc++ library to be tested. By default the - library folder of the build directory is used. This option cannot be used - when use_system_cxx_lib is provided. + library folder of the build directory is used. .. option:: cxx_runtime_root= @@ -156,7 +155,10 @@ default. **Default**: False Enable or disable testing against the installed version of libc++ library. - Note: This does not use the installed headers. + This impacts whether the ``with_system_cxx_lib`` Lit feature is defined or + not. The ``cxx_library_root`` and ``cxx_runtime_root`` parameters should + still be used to specify the path of the library to link to and run against, + respectively. .. option:: use_lit_shell= diff --git a/libcxx/utils/ci/macos-backdeployment.sh b/libcxx/utils/ci/macos-backdeployment.sh index 8767f4b..71687c2 100755 --- a/libcxx/utils/ci/macos-backdeployment.sh +++ b/libcxx/utils/ci/macos-backdeployment.sh @@ -146,8 +146,9 @@ echo "@@@ Running tests for libc++ @@@" --param=cxx_headers="${LLVM_INSTALL_DIR}/include/c++/v1" \ --param=std="${STD}" \ --param=platform="macosx${DEPLOYMENT_TARGET}" \ + --param=cxx_library_root="${LIBCXX_ROOT_IN_SDK}" \ --param=cxx_runtime_root="${LIBCXX_ROOT_ON_DEPLOYMENT_TARGET}" \ --param=abi_library_path="${LIBCXXABI_ROOT_ON_DEPLOYMENT_TARGET}" \ - --param=use_system_cxx_lib="${LIBCXX_ROOT_IN_SDK}" \ + --param=use_system_cxx_lib="True" \ ${ADDITIONAL_LIT_ARGS} echo "@@@@@@" diff --git a/libcxx/utils/libcxx/test/config.py b/libcxx/utils/libcxx/test/config.py index b2d802b..86e59ef 100644 --- a/libcxx/utils/libcxx/test/config.py +++ b/libcxx/utils/libcxx/test/config.py @@ -74,7 +74,7 @@ class Configuration(object): self.debug_build = self.get_lit_bool('debug_build', default=False) self.exec_env = dict() self.use_target = False - self.use_system_cxx_lib = False + self.use_system_cxx_lib = self.get_lit_bool('use_system_cxx_lib', False) self.use_clang_verify = False self.long_tests = None @@ -123,7 +123,6 @@ class Configuration(object): def configure(self): self.configure_target_info() self.configure_executor() - self.configure_use_system_cxx_lib() self.configure_cxx() self.configure_triple() self.configure_deployment() @@ -263,23 +262,6 @@ class Configuration(object): else: self.libcxx_obj_root = self.project_obj_root - def configure_use_system_cxx_lib(self): - # This test suite supports testing against either the system library or - # the locally built one; the former mode is useful for testing ABI - # compatibility between the current headers and a shipping dynamic - # library. - # Default to testing against the locally built libc++ library. - self.use_system_cxx_lib = self.get_lit_conf('use_system_cxx_lib') - if self.use_system_cxx_lib == 'true': - self.use_system_cxx_lib = True - elif self.use_system_cxx_lib == 'false': - self.use_system_cxx_lib = False - elif self.use_system_cxx_lib: - assert os.path.isdir(self.use_system_cxx_lib), "the specified use_system_cxx_lib parameter (%s) is not a valid directory" % self.use_system_cxx_lib - self.use_system_cxx_lib = os.path.abspath(self.use_system_cxx_lib) - self.lit_config.note( - "inferred use_system_cxx_lib as: %r" % self.use_system_cxx_lib) - def configure_cxx_stdlib_under_test(self): self.cxx_stdlib_under_test = self.get_lit_conf( 'cxx_stdlib_under_test', 'libc++') @@ -547,24 +529,16 @@ class Configuration(object): self.cxx.link_flags += shlex.split(link_flags_str) def configure_link_flags_cxx_library_path(self): - if not self.use_system_cxx_lib: - if self.cxx_library_root: - self.cxx.link_flags += ['-L' + self.cxx_library_root] - if self.target_info.is_windows() and self.link_shared: - self.add_path(self.cxx.compile_env, self.cxx_library_root) - if self.cxx_runtime_root: - if not self.target_info.is_windows(): - self.cxx.link_flags += ['-Wl,-rpath,' + - self.cxx_runtime_root] - elif self.target_info.is_windows() and self.link_shared: - self.add_path(self.exec_env, self.cxx_runtime_root) - elif os.path.isdir(str(self.use_system_cxx_lib)): - self.cxx.link_flags += ['-L' + self.use_system_cxx_lib] + if self.cxx_library_root: + self.cxx.link_flags += ['-L' + self.cxx_library_root] + if self.target_info.is_windows() and self.link_shared: + self.add_path(self.cxx.compile_env, self.cxx_library_root) + if self.cxx_runtime_root: if not self.target_info.is_windows(): self.cxx.link_flags += ['-Wl,-rpath,' + - self.use_system_cxx_lib] - if self.target_info.is_windows() and self.link_shared: - self.add_path(self.cxx.compile_env, self.use_system_cxx_lib) + self.cxx_runtime_root] + elif self.target_info.is_windows() and self.link_shared: + self.add_path(self.exec_env, self.cxx_runtime_root) additional_flags = self.get_lit_conf('test_linker_flags') if additional_flags: self.cxx.link_flags += shlex.split(additional_flags) diff --git a/libcxx/utils/libcxx/test/target_info.py b/libcxx/utils/libcxx/test/target_info.py index b5b8a9d..503954d 100644 --- a/libcxx/utils/libcxx/test/target_info.py +++ b/libcxx/utils/libcxx/test/target_info.py @@ -162,9 +162,6 @@ class DarwinLocalTI(DefaultTargetInfo): # Configure the library path for libc++ if self.full_config.cxx_runtime_root: library_paths += [self.full_config.cxx_runtime_root] - elif self.full_config.use_system_cxx_lib: - if (os.path.isdir(str(self.full_config.use_system_cxx_lib))): - library_paths += [self.full_config.use_system_cxx_lib] # Configure the abi library path if self.full_config.abi_library_root: -- 2.7.4