Skip to content

Only pass a versioned prebuilt-modules for Mac Catalyst if it exists. #1695

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

Conversation

cwakamo
Copy link
Contributor

@cwakamo cwakamo commented Sep 16, 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 addresses rdar://problem/136047054.

@cwakamo cwakamo requested a review from artemcm September 16, 2024 00:34
@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 16, 2024

@swift-ci please test

Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test that creates a dummy directory for this and causes the driver to exercise this logic?

@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 16, 2024

For sure! Looks like I have a macOS-only test failure to fix anyways :)

Test Case '-[SwiftDriverTests.SwiftDriverTests testPrebuiltModuleCacheFlags]' started.
/Users/ec2-user/jenkins/workspace/pr-swift-driver-macos/branch-main/swift-driver/Tests/SwiftDriverTests/SwiftDriverTests.swift:7180: error: -[SwiftDriverTests.SwiftDriverTests testPrebuiltModuleCacheFlags] : XCTAssertTrue failed
Test Case '-[SwiftDriverTests.SwiftDriverTests testPrebuiltModuleCacheFlags]' failed (0.172 seconds).

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>.
@cwakamo cwakamo force-pushed the dev/check-for-existence-before-passing-Catalyst-prebuilt-modules branch from 2159196 to b1573ef Compare September 16, 2024 17:38
@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 16, 2024

@swift-ci please test

@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 16, 2024

@artemcm I pushed an update to the existing test, and made a slight change in behavior -- it now looks relative to the resource directory rather than relative to the Swift compiler executable, which IIRC matches the frontend's behavior.

@cwakamo
Copy link
Contributor Author

cwakamo commented Sep 17, 2024

@swift-ci please test Windows platform

@cwakamo cwakamo merged commit 3176929 into main Sep 17, 2024
3 checks passed
@cwakamo cwakamo deleted the dev/check-for-existence-before-passing-Catalyst-prebuilt-modules branch September 17, 2024 23:41
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