Skip to content

🍒[cxx-interop] Do not install binary .swiftmodule files for the overlays #81410

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 1 commit into from
May 13, 2025

Conversation

egorzhdan
Copy link
Contributor

@egorzhdan egorzhdan commented May 9, 2025

  • Explanation: This fixes a deserialization failure in the compiler that occurred while loading the CxxStdlib overlay module. This was happening because the overlays were built against a different version of the Swift stdlib than is being used.
  • Scope: This changes the installation scripts to stop installing CxxStdlib.swiftmodule/<triple>.swiftmodule
  • Issues: rdar://150416863
  • Original PRs: [cxx-interop] Do not install binary .swiftmodule files for the overlays #81408
  • Risk: Medium, this changes CMake installation logic which might not be very well covered by tests. The compiler functionality for rebuilding of CxxStdlib module is covered by existing tests, since we are relying on it on Linux since Swift 6.1.
  • Testing: Manual testing done by removing these binaries from a toolchain.
  • Reviewers: @xymus @j-hui

@egorzhdan egorzhdan requested a review from a team as a code owner May 9, 2025 17:44
@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label May 9, 2025
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@DougGregor DougGregor enabled auto-merge May 9, 2025 19:37
…lays

This fixes a deserialization failure in the compiler that occurred while loading the CxxStdlib overlay module:
```
Cross-reference to module 'Swift'
... Optional
... some
... with type <τ_0_0 where τ_0_0 : ~Copyable, τ_0_0 : ~Escapable> (Optional<τ_0_0>.Type) -> (τ_0_0) -> Optional<τ_0_0>
```

This was happening because the overlays were built against a different version of the Swift stdlib than is being used. The compiler is able to rebuild the Cxx and CxxStdlib modules from their textual interfaces. Let's use that feature unconditionally in production toolchains to avoid this kind of binary incompatibilities.

rdar://150416863
(cherry picked from commit 16b2808)
@egorzhdan egorzhdan force-pushed the egorzhdan/6.2-do-not-install-swiftmodules branch from bceb994 to 10ab242 Compare May 12, 2025 18:30
@egorzhdan
Copy link
Contributor Author

@swift-ci please test

@DougGregor DougGregor merged commit 1072dbe into release/6.2 May 13, 2025
5 checks passed
@DougGregor DougGregor deleted the egorzhdan/6.2-do-not-install-swiftmodules branch May 13, 2025 02:28
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