Skip to content

Loosen restriction for building deprecated iOS targets #994

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
Jan 28, 2022

Conversation

cyndyishida
Copy link
Contributor

This patch loosens the restriction for building deprecated iOS targets
to only when the user attempts to compile a binary or emit IR.
This allows the compiler to continue building swift modules and
interfaces for newer deployment targets.

The error message is also slightly modified to allow the same message to
apply to different platforms.

resolves: rdar://87898177

Copy link
Contributor

@xymus xymus left a comment

Choose a reason for hiding this comment

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

This looks good, thank you!

@xymus
Copy link
Contributor

xymus commented Jan 26, 2022

I launched the tests from the compiler side because there's an equivalent check in the C++ driver so there could be tests affected there too.

XCTFail()
return
}
}

XCTAssertThrowsError(try Driver(args: ["swiftc", "-emit-module", "-c", "-target",
"armv7-apple-ios12.0", "foo.swift"])) { error in
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we test a version without the -c where there's no error?

@cyndyishida
Copy link
Contributor Author

@swift-ci please test

@cyndyishida cyndyishida force-pushed the backDeploymentBuilds branch 2 times, most recently from 4469731 to 1fe3ec5 Compare January 27, 2022 01:53
@cyndyishida
Copy link
Contributor Author

@swift-ci please test

return "iOS \(version) does not support 32-bit programs"
case .invalidDeploymentTargetForIR(let target):
return
"\(target) and above does not support emitting binaries or IR for 32-bit programs"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we pass through and print the specific architecture name in place of "32-bit" in order to be more generalized?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is updated to emit "iOS 11 and above does not support emitting binaries or IR for armv7" for armv7-apple-ios12

@cyndyishida
Copy link
Contributor Author

@swift-ci please test

This patch loosens the restriction for building deprecated iOS targets
to only when the user attempts to compile a binary or emit IR.
This allows the compiler to continue building swift modules and
interfaces for newer deployment targets.

The error message is also slightly modified to allow the same message to
apply to different platforms.

resolves: <rdar://87898177>
@cyndyishida
Copy link
Contributor Author

@swift-ci please test

@cyndyishida cyndyishida merged commit eca12ad into swiftlang:main Jan 28, 2022
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