Skip to content

Commit d7ca140

Browse files
committed
[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
1 parent 20c926e commit d7ca140

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

libcxx/utils/libcxx/test/features.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,15 @@
4040
Feature(name='has-fobjc-arc', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
4141
sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
4242
Feature(name='objective-c++', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
43-
Feature(name='modules-support', when=lambda cfg: hasCompileFlag(cfg, '-fmodules')),
43+
44+
# Note: We use a custom modules cache path to make sure that we don't reuse
45+
# the default one, which can be shared across builds. This is important
46+
# because we define macros in headers files, and a change in these macros
47+
# doesn't seem to invalidate modules cache entries, which means we could
48+
# build against now-invalid cached headers from a previous build.
49+
Feature(name='modules-support',
50+
when=lambda cfg: hasCompileFlag(cfg, '-fmodules'),
51+
actions=lambda cfg: [AddCompileFlag('-fmodules-cache-path=%t/ModuleCache')]),
4452

4553
Feature(name='non-lockfree-atomics',
4654
when=lambda cfg: sourceBuilds(cfg, """

0 commit comments

Comments
 (0)