Skip to content

[5.3][ModuleInterface] Prefer the swiftmodule in the SDK over the prebuilt-module cache #32432

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
Jun 17, 2020

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jun 17, 2020

Fix the search order for module interfaces to respect the documented behavior:

  1. Local cache
  2. Next to the .swiftinterface
  3. Prebuilt cache

Fixing the order of the last two allows the XcodeDefault compiler to prioritize swiftmodule files with SPI information.


  • Explanation:
    The compiler was picking swiftmodules from the prebuilt-module cache over those next to the swiftinterface files. The prebuilt-modules are public so then don't have SPI information. As such, even when SPI was available to a project the compiler couldn't see it.
  • Scope of Issue: Affects an internal project building with the default toolchain while using SPI.
  • Origination: Around the introduction of the prebuilt-modules cache, however this issue was made visible by the addition of Swift SPI.
  • Risk: Relatively low. The fix respects the intended behavior as it was originally documented. While it affects the module loading order of all projects most projects don't build with both the prebuilt-cache and swiftmodule files next to the swiftinterface files.
  • Reviewed By: Xi Ge
  • Resolves: rdar://problem/64097455
  • Cherry-pick Of: [ModuleInterface] Prefer the swiftmodule in the SDK over the prebuilt-cache #32423

…-cache

Fix the search order for module interfaces to respect the documented
behavior:

1. Local cache
2. Next to the .swiftinterface
3. Prebuilt cache

Fixing the order of the last two allows the XcodeDefault compiler to
prioritize swiftmodule files with SPI information.

rdar://problem/64097455
@xymus xymus added the r5.3 label Jun 17, 2020
@xymus xymus requested a review from a team as a code owner June 17, 2020 16:03
@xymus
Copy link
Contributor Author

xymus commented Jun 17, 2020

@swift-ci Please test

@xymus
Copy link
Contributor Author

xymus commented Jun 17, 2020

@swift-ci Please nominate

@tkremenek tkremenek merged commit 5a77383 into swiftlang:release/5.3 Jun 17, 2020
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants