[6.2 🍒][Dependency Scanning][C++Interop] Do not query CxxStdlib
Swift overlay for textual modules which were not built with c++interop
#81416
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of #81415
Explanation: When we discover a textual module dependency which is a module which was not originally built from source using C++ interop (specifying
-formal-cxx-interoperability-mode=off
), avoid looking up the C++ standard library Swift overlay for it. This is required for the case of theDarwin
module, for example, which includes headers which map to C++ stdlib headers when the compiler is operating in C++ interop mode, but the C++ standard library Swift overlay module itself depends on 'Darwin', which results in a cycle. To resolve such situations, we can rely on the fact that Swift textual interfaces of modules which were not built with C++ interop must be able to build without importing the C++ standard library Swift overlay, so we avoid specifying it as a dependency for such modules. The primary source module, as well as Swift textual module dependencies which were built with C++ interop will continue getting a direct depedency of the 'CxxStdlib' Swift module.Scope: C++Interop-enabled builds using Explicitly-Built modules which rely on Apple SDKs.
Risk: Low, this change removes module dependency on
CxxStdlib
for certain Swift modules which, in expectation, are guaranteed to be buildable without this module dependency.Issue: rdar://150222155
Reviewed By: @egorzhdan, @cachemeifyoucan
Original PR: [Dependency Scanning][C++Interop] Do not query
CxxStdlib
Swift overlay for textual modules which were not built with c++interop #81415