[libcxx-commits] [libcxx] 21b0ec2 - [libc++] Do not rely on use_system_cxx_lib to specify the path of the library to run against

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 15 10:01:53 PDT 2020


Author: Louis Dionne
Date: 2020-05-15T13:01:37-04:00
New Revision: 21b0ec2fc6e17a0ba3921ed8146b7d410ce250c9

URL: https://github.com/llvm/llvm-project/commit/21b0ec2fc6e17a0ba3921ed8146b7d410ce250c9
DIFF: https://github.com/llvm/llvm-project/commit/21b0ec2fc6e17a0ba3921ed8146b7d410ce250c9.diff

LOG: [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.

Added: 
    

Modified: 
    libcxx/docs/DesignDocs/AvailabilityMarkup.rst
    libcxx/docs/TestingLibcxx.rst
    libcxx/utils/ci/macos-backdeployment.sh
    libcxx/utils/libcxx/test/config.py
    libcxx/utils/libcxx/test/target_info.py

Removed: 
    


################################################################################
diff  --git a/libcxx/docs/DesignDocs/AvailabilityMarkup.rst b/libcxx/docs/DesignDocs/AvailabilityMarkup.rst
index 586c793e9541..87ad0abb62d7 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 78134bca8f84..cc684e7620e3 100644
--- a/libcxx/docs/TestingLibcxx.rst
+++ b/libcxx/docs/TestingLibcxx.rst
@@ -140,8 +140,7 @@ default.
 .. option:: cxx_library_root=<path/to/lib/>
 
   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=<path/to/lib/>
@@ -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=<bool>
 

diff  --git a/libcxx/utils/ci/macos-backdeployment.sh b/libcxx/utils/ci/macos-backdeployment.sh
index 8767f4b8fe9c..71687c2f521e 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 b2d802b65da9..86e59eff73bb 100644
--- a/libcxx/utils/libcxx/test/config.py
+++ b/libcxx/utils/libcxx/test/config.py
@@ -74,7 +74,7 @@ def __init__(self, lit_config, config):
         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 @@ def make_static_lib_name(self, name):
     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 @@ def configure_obj_root(self):
             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 @@ def configure_link_flags(self):
         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 b5b8a9ded804..503954d345ff 100644
--- a/libcxx/utils/libcxx/test/target_info.py
+++ b/libcxx/utils/libcxx/test/target_info.py
@@ -162,9 +162,6 @@ def configure_env(self, env):
         # 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:


        


More information about the libcxx-commits mailing list