Skip to content

🍒[cxx-interop] Do not emit C++ interop flag in textual interfaces #77989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 18, 2024

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented Dec 5, 2024

Explanation: This makes sure that the compiler does not emit -enable-experimental-cxx-interop/-cxx-interoperability-mode flags in .swiftinterface files. Those flags were breaking explicit module builds. The module can still be rebuilt from its textual interface if C++ interop was enabled in the current compilation.
Scope: This alters the logic that emits and reads compiler flags from .swiftinterface files.
Risk: Medium, this changes the textual interfaces emitted by the compiler, which can theoretically have adverse effects on dependencies of the current module.
Testing: This is covered by compiler tests.
Issue: rdar://140203932
Reviewer: @artemcm @Xazax-hun

Original PR: #77754

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Dec 5, 2024
@egorzhdan egorzhdan requested a review from a team as a code owner December 5, 2024 19:58
@egorzhdan
Copy link
Contributor Author

Please test with following PR:

swiftlang/swift-driver#1748

@swift-ci please test

…lays

If a Swift module built with library evolution enabled is an overlay of a C++ module, allow referring to the non-resilient C++ symbols from the Swift code.

Overlays are usually built and shipped along with the C/C++ modules, so library evolution is less of a concern there. A developer providing a Swift overlay for a C++ library would expect to be able to refer to the symbols from the C++ library within the overlay.

(cherry picked from commit f420456)
… overlay

This fixes a CI job that is building the Swift stdlib with a recent nightly compiler.

rdar://140850172

(cherry picked from commit b6488d3)
This makes sure that the compiler does not emit `-enable-experimental-cxx-interop`/`-cxx-interoperability-mode` flags in `.swiftinterface` files. Those flags were breaking explicit module builds. The module can still be rebuilt from its textual interface if C++ interop was enabled in the current compilation.

rdar://140203932
(cherry picked from commit 7ae2beb)
@egorzhdan egorzhdan force-pushed the egorzhdan/6.1-swiftinterface-no-cxx-flag branch from ee513eb to f95338d Compare December 6, 2024 14:47
@egorzhdan
Copy link
Contributor Author

Please test with following PR:

swiftlang/swift-driver#1748

@swift-ci please test

1 similar comment
@egorzhdan
Copy link
Contributor Author

Please test with following PR:

swiftlang/swift-driver#1748

@swift-ci please test

@egorzhdan egorzhdan merged commit 32ca643 into release/6.1 Dec 18, 2024
5 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/6.1-swiftinterface-no-cxx-flag branch December 18, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants