[libcxx-commits] [libcxx] r355451 - [libc++] Only add dylib-related features when using the system's libc++

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 5 14:42:45 PST 2019


Author: ldionne
Date: Tue Mar  5 14:42:45 2019
New Revision: 355451

URL: http://llvm.org/viewvc/llvm-project?rev=355451&view=rev
Log:
[libc++] Only add dylib-related features when using the system's libc++

Otherwise, when testing trunk libc++ on an older system, lit will think
that the dylib features are disabled. Ideally, we'd have a notion of
running the tests with/without a deployment target (or, equivalently,
a deployment target representing trunk where everything is as recent
as can be). Since we always have a deployment target right now (which
defaults to the current system), we only enable those features when
we're going to also be testing with the system libc++.

We also need to disable the availability markup when we are not running
a system library flavor, because availability markup does not make sense
when building against the trunk libc++ (which has everything regardless
of what the current system is).

This is a re-application of r353319, which had been reverted due to
CI breakage. This time around, I made sure it didn't break our internal
CI before submitting.

This is also a partial undoing of r348296, in spirit at least. However,
with this patch, availability markup is enabled based on whether we're
using a system library or not, whereas previously one could enable
it or disable it arbitrarily. This was confusing as it led to testing
configurations that don't make sense (such as testing a system library
without availability markup, or trunk testing with availability markup).

Modified:
    libcxx/trunk/utils/libcxx/test/config.py

Modified: libcxx/trunk/utils/libcxx/test/config.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/config.py?rev=355451&r1=355450&r2=355451&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/config.py (original)
+++ libcxx/trunk/utils/libcxx/test/config.py Tue Mar  5 14:42:45 2019
@@ -1149,17 +1149,24 @@ class Configuration(object):
         self.lit_config.note(
             "computed target_triple as: %r" % self.config.target_triple)
 
-        # Throwing bad_optional_access, bad_variant_access and bad_any_cast is
-        # supported starting in macosx10.14.
-        if name == 'macosx' and version in ('10.%s' % v for v in range(7, 14)):
-            self.config.available_features.add('dylib-has-no-bad_optional_access')
-            self.lit_config.note("throwing bad_optional_access is not supported by the deployment target")
+        # If we're testing a system libc++ as opposed to the upstream LLVM one,
+        # take the version of the system libc++ into account to compute which
+        # features are enabled/disabled. Otherwise, disable availability markup,
+        # which is not relevant for non-shipped flavors of libc++.
+        if self.use_system_cxx_lib:
+            # Throwing bad_optional_access, bad_variant_access and bad_any_cast is
+            # supported starting in macosx10.14.
+            if name == 'macosx' and version in ('10.%s' % v for v in range(7, 14)):
+                self.config.available_features.add('dylib-has-no-bad_optional_access')
+                self.lit_config.note("throwing bad_optional_access is not supported by the deployment target")
 
-            self.config.available_features.add('dylib-has-no-bad_variant_access')
-            self.lit_config.note("throwing bad_variant_access is not supported by the deployment target")
+                self.config.available_features.add('dylib-has-no-bad_variant_access')
+                self.lit_config.note("throwing bad_variant_access is not supported by the deployment target")
 
-            self.config.available_features.add('dylib-has-no-bad_any_cast')
-            self.lit_config.note("throwing bad_any_cast is not supported by the deployment target")
+                self.config.available_features.add('dylib-has-no-bad_any_cast')
+                self.lit_config.note("throwing bad_any_cast is not supported by the deployment target")
+        else:
+            self.cxx.flags += ['-D_LIBCPP_DISABLE_AVAILABILITY']
 
     def configure_env(self):
         self.target_info.configure_env(self.exec_env)




More information about the libcxx-commits mailing list