-
Couldn't load subscription status.
- Fork 32
Add workflow to build packages for iOS. #169
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
Add workflow to build packages for iOS. #169
Conversation
Add workflow to build packages for iOS on a macOS VM. Can't run tests at this time, but we can at least confirm source compiles.
5c049c8 to
ae72e5b
Compare
| ios_build_command: | ||
| type: string | ||
| description: "macOS command to build the package for iOS" | ||
| default: "xcrun swift build --build-tests --sdk \"$(xcrun --sdk iphoneos --show-sdk-path)\" --triple arm64-apple-ios" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO, it would be better to use $(xcrun -f swift) instead of xcrun swift.
xcrun swift is fine with packages that do not contain executableTarget, but it causes the following errors with packages that contain executableTarget:
clang: warning: using sysroot for 'MacOSX' but targeting 'iPhone' [-Wincompatible-sysroot]
To prevent this, you can use $(xcrun -f swift) instead of xcrun swift.
Related discussion: https://forums.swift.org/t/getting-incompatible-sysroot-warning-when-compiling-for-ios-with-sdk-and-target-set/80584
You can easily reproduce this issue by the following steps:
mkdir foo && cd foo
swift package init --type executable --name Foo
xcrun swift build --sdk "$(xcrun --sdk iphoneos --show-sdk-path)" --triple arm64-apple-iosEnable iOS GitHub Actions workflow added in swiftlang/github-workflows#169.
Enable iOS GitHub Actions workflow added in swiftlang/github-workflows#169. ### Checklist: - [x] Code and documentation should follow the style of the [Style Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md). - [x] If public symbols are renamed or modified, DocC references should be updated.
Add workflow to build packages for iOS on a macOS VM. Can't run tests at this time, but we can at least confirm source compiles.