Skip to content

Drop unknown platforms when generating PIF #9021

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

owenv
Copy link
Contributor

@owenv owenv commented Aug 14, 2025

Some existing packages use .when(platforms: [.custom("DoesNotExist")]) to unconditionally deactivate settings. Stop asserting on these unknown platforms

@owenv
Copy link
Contributor Author

owenv commented Aug 14, 2025

@swift-ci test

@@ -962,7 +964,11 @@ extension ProjectModel.BuildSettings.MultipleValueSetting {
}

extension ProjectModel.BuildSettings.Platform {
init(from platform: PackageModel.Platform) {
enum Error: Swift.Error {
case unexpectedPlatform(String)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: it's really "unknown" not "unexpected"

@@ -584,11 +586,16 @@ public final class PackagePIFBuilder {
let arm64ePlatforms: [PackageModel.Platform] = [.iOS, .macOS, .visionOS]
for arm64ePlatform in arm64ePlatforms {
if self.delegate.shouldPackagesBuildForARM64e(platform: arm64ePlatform) {
let pifPlatform: ProjectModel.BuildSettings.Platform = switch arm64ePlatform {
let pifPlatform: ProjectModel.BuildSettings.Platform
switch arm64ePlatform {
case .iOS:
Copy link
Contributor

Choose a reason for hiding this comment

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

You can just drop this iOS-specific branch. Here it's trying to exclude the simulator platform, but in swiftlang/swift-build#538 I fixed it to completely ignore arm64e for simulator platforms since that arch doesn't exist there, so the workaround is no longer necessary.

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