Skip to content

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

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
Copy link
Contributor Author

cwakamo commented Sep 18, 2024

@swift-ci please test

@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.

@shahmishal shahmishal changed the base branch from release/6.0.1 to release/6.0.2 September 20, 2024 05:23
@cwakamo cwakamo changed the title [6.0.1] Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. [6.0.2] Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. Sep 20, 2024
@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 23, 2024

Closing this PR without merging so as not to add undue risk to the 6.0.2 release. Will continue to pursue this for release/6.0 for future 6.0.x releases however.

@cwakamo cwakamo closed this Sep 23, 2024
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.

2 participants