Skip to content

[6.0] Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. #1697

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

Conversation

cwakamo
Copy link
Contributor

@cwakamo cwakamo commented Sep 18, 2024

Some clients still have unversioned prebuilt modules, but SwiftDriver assumed that the versioned path would always exist for macOS (at least for the purposes of passing it when compiling for Mac Catalyst).

This change duplicates some logic from the Swift frontend to check for the existence of the versioned macOS prebuilt modules directory before passing it, optionally stripping off trailing .0 version components.

This change also updates the driver so that it passes a prebuilt modules directory relative to the resource directory rather than relative to the compiler binary, also matching the Swift frontend's behavior.

This addresses rdar://problem/136047054.

(cherry picked from commit b1573ef)

Some clients still have unversioned prebuilt modules, but SwiftDriver assumed
that the versioned path would always exist for macOS (at least for the purposes
of passing it when compiling for Mac Catalyst).

This change duplicates some logic from the Swift frontend to check for the
existence of the versioned macOS prebuilt modules directory before passing it,
optionally stripping off trailing `.0` version components.

This change also updates the driver so that it passes a prebuilt modules directory
relative to the resource directory rather than relative to the compiler binary, also
matching the Swift frontend's behavior.

This addresses <rdar://problem/136047054>.

(cherry picked from commit b1573ef)
@cwakamo cwakamo changed the title Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. [6.0] Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. Sep 18, 2024
@DougGregor
Copy link
Member

@swift-ci please test

@DougGregor
Copy link
Member

@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 18, 2024

  • Explanation: This change ensures that swift-driver passes a prebuilt-modules directory for Mac Catalyst that exists instead of blindly passing a versioned prebuilt-modules directory. (Some clients still do not have a versioned prebuilt-modules directory due to the fact that the C++ driver doesn't support it correctly for Mac Catalyst.)
  • Scope: Affects compilation for Mac Catalyst only.
  • Issue: rdar://problem/136047054
  • Original PR: Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. #1695
  • Risk: The risk is that Catalyst compilation will no longer use the prebuilt modules because it's pointed at the wrong path, but this is mitigated by the presence of tests which ensure that the driver passes the correct path for Catalyst in both the versioned and unversioned cases.
  • Testing: Unit tests have been added; this has also been tested manually with a client that previously did not work due to the unconditional use of the versioned prebuilt-modules directory.
  • Reviewer: @artemcm reviewed the original change.

@artemcm artemcm requested a review from nkcsgexi September 24, 2024 17:46
@cwakamo cwakamo merged commit 2e92299 into swiftlang:release/6.0 Sep 24, 2024
3 checks passed
@cwakamo cwakamo deleted the dev/check-for-existence-before-passing-Catalyst-prebuilt-modules-6.0 branch September 24, 2024 22:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants