[libcxx-commits] [libcxx] d7ca140 - [libc++] Attempt to fix spurious modules-related failures in the CI

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Nov 26 09:00:21 PST 2020


Author: Louis Dionne
Date: 2020-11-26T12:00:11-05:00
New Revision: d7ca140c0122a55a4042fb263ea3baaa501c361d

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

LOG: [libc++] Attempt to fix spurious modules-related failures in the CI

I'm not 100% sure what the issue actually is since I can't reproduce it
locally, however what I explain in the comment is my best attempt to
explain what's going on.

Differential Revision: https://reviews.llvm.org/D92131

Added: 
    

Modified: 
    libcxx/utils/libcxx/test/features.py

Removed: 
    


################################################################################
diff  --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py
index 2f9a048df345..3023caeea5d3 100644
--- a/libcxx/utils/libcxx/test/features.py
+++ b/libcxx/utils/libcxx/test/features.py
@@ -40,7 +40,15 @@
   Feature(name='has-fobjc-arc',                 when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
                                                                  sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
   Feature(name='objective-c++',                 when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
-  Feature(name='modules-support',               when=lambda cfg: hasCompileFlag(cfg, '-fmodules')),
+
+  # Note: We use a custom modules cache path to make sure that we don't reuse
+  #       the default one, which can be shared across builds. This is important
+  #       because we define macros in headers files, and a change in these macros
+  #       doesn't seem to invalidate modules cache entries, which means we could
+  #       build against now-invalid cached headers from a previous build.
+  Feature(name='modules-support',
+          when=lambda cfg: hasCompileFlag(cfg, '-fmodules'),
+          actions=lambda cfg: [AddCompileFlag('-fmodules-cache-path=%t/ModuleCache')]),
 
   Feature(name='non-lockfree-atomics',
           when=lambda cfg: sourceBuilds(cfg, """


        


More information about the libcxx-commits mailing list