[6.2 🍒][C++Interop] Do not query C++ Standard Library Swift overlays when building Swift modules which were built without C++ interop #81912
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 #81908
Explanation: Similarly to how this was fixed in [Dependency Scanning][C++Interop] Do not query
CxxStdlib
Swift overlay for textual modules which were not built with c++interop #81415 in the Dependency Scanner for builds using Explicitly-Built modules, this change causes Implicitly-Built module code path to also forego querying Swift overlayCxxStdlib
when the compiler is building a module with no declared "formal C++ interop mode".This change also temporarily hard-codes the
Darwin
module to always have no formal C++ interop mode, for the sake of compatibility withDarwin
Swift module textual interfaces which were constructed prior to the introduction of the-formal-cxx-interoperability-mode=
option.Scope: Builds with C++Interop feature enabled which depend on the
Darwin
module and other modules whose textual interfaces were originally built without C++Interop feature enabled.Risk: Low, this fix addresses the possibility (and actual presence) of a dependency cycle between Swift modules
Darwin
andCxxStdlib
by preventing query of C++ standard library Swift overlay when building Swift modules not built with C++Interop enabled, such asDarwin
. Without this fix in place, theCxxStdlib
Swift module textual interface cannot be built due to its dependency onDarwin
, which pulls in C++ headers.Problem: rdar://151805687
Reviewed By: @cachemeifyoucan
Original PR: [C++Interop] Do not query C++ Standard Library Swift overlays when building Swift modules which were built without C++ interop #81908