-
Notifications
You must be signed in to change notification settings - Fork 16
feat: Add iOS platform support #153
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -113,3 +113,70 @@ jobs: | |||||||||||||||
| github.ref_name == 'main' | ||||||||||||||||
| run: | | ||||||||||||||||
| docker compose push ubuntu | ||||||||||||||||
|
|
||||||||||||||||
| ios: | ||||||||||||||||
| name: iOS | ||||||||||||||||
| runs-on: macos-15 | ||||||||||||||||
| timeout-minutes: 15 | ||||||||||||||||
| steps: | ||||||||||||||||
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||||||||||||||||
| - uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0 | ||||||||||||||||
| with: | ||||||||||||||||
| go-version: "stable" | ||||||||||||||||
| - name: Generate test data | ||||||||||||||||
| run: | | ||||||||||||||||
| cd data-generator/swift-datagen | ||||||||||||||||
| go run . | ||||||||||||||||
| cp *.arrow ../../Tests/ArrowTests/ | ||||||||||||||||
| - name: Select iOS Simulator | ||||||||||||||||
| run: | | ||||||||||||||||
| # Pick the first iPhone on the newest available iOS. | ||||||||||||||||
| # | ||||||||||||||||
| # Example pipeline on macos-15 runner | ||||||||||||||||
| # | ||||||||||||||||
| # xcrun simctl list devices available (filtered to iPhone): | ||||||||||||||||
| # -- iOS 18.5 -- | ||||||||||||||||
| # iPhone 16 Pro (E8B81AE5-...) (Shutdown) | ||||||||||||||||
| # iPhone 16 (394B9336-...) (Shutdown) | ||||||||||||||||
| # -- iOS 18.6 -- | ||||||||||||||||
| # iPhone 16 Pro (37C8BF13-...) (Shutdown) | ||||||||||||||||
| # iPhone 16 (E040B4E8-...) (Shutdown) | ||||||||||||||||
| # -- iOS 26.2 -- | ||||||||||||||||
| # iPhone 17 Pro (20A8DB5D-...) (Shutdown) | ||||||||||||||||
| # iPhone 16 (02BBE218-...) (Shutdown) | ||||||||||||||||
| # | ||||||||||||||||
| # -> awk: prefix each iPhone line with its iOS version | ||||||||||||||||
| # 18.5 iPhone 16 Pro (E8B81AE5-...) (Shutdown) | ||||||||||||||||
| # 18.5 iPhone 16 (394B9336-...) (Shutdown) | ||||||||||||||||
| # 18.6 iPhone 16 Pro (37C8BF13-...) (Shutdown) | ||||||||||||||||
| # 26.2 iPhone 17 Pro (20A8DB5D-...) (Shutdown) | ||||||||||||||||
| # 26.2 iPhone 16 (02BBE218-...) (Shutdown) | ||||||||||||||||
| # | ||||||||||||||||
| # -> sort -t. -k1,1nr -k2,2nr: sort by iOS version descending | ||||||||||||||||
| # 26.2 iPhone 17 Pro (20A8DB5D-...) (Shutdown) | ||||||||||||||||
| # 26.2 iPhone 16 (02BBE218-...) (Shutdown) | ||||||||||||||||
| # 18.6 iPhone 16 Pro (37C8BF13-...) (Shutdown) | ||||||||||||||||
| # 18.5 iPhone 16 Pro (E8B81AE5-...) (Shutdown) | ||||||||||||||||
| # | ||||||||||||||||
| # -> head -1: take the first line (newest iOS) | ||||||||||||||||
| # 26.2 iPhone 17 Pro (20A8DB5D-...) (Shutdown) | ||||||||||||||||
| # | ||||||||||||||||
| # -> grep -oE: extract the simulator UDID | ||||||||||||||||
| # 20A8DB5D-3B2A-48CF-BA79-07E054563A31 | ||||||||||||||||
| SIMULATOR_ID=$(xcrun simctl list devices available 2>/dev/null | \ | ||||||||||||||||
| awk '/-- iOS/{os=$3} /iPhone/{print os, $0}' | \ | ||||||||||||||||
| sort -t. -k1,1nr -k2,2nr | head -1 | \ | ||||||||||||||||
| grep -oE '[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}') | ||||||||||||||||
| if [ -z "$SIMULATOR_ID" ]; then | ||||||||||||||||
| echo "Error: no iPhone simulator found" | ||||||||||||||||
| xcrun simctl list devices available | ||||||||||||||||
| exit 1 | ||||||||||||||||
| fi | ||||||||||||||||
| echo "SIMULATOR_ID=$SIMULATOR_ID" >> "$GITHUB_ENV" | ||||||||||||||||
| echo "Selected simulator: $SIMULATOR_ID" | ||||||||||||||||
| - name: Test on iOS Simulator | ||||||||||||||||
| run: | | ||||||||||||||||
| xcodebuild test \ | ||||||||||||||||
| -scheme Arrow-Package \ | ||||||||||||||||
| -destination "platform=iOS Simulator,id=$SIMULATOR_ID" \ | ||||||||||||||||
| -only-testing ArrowTests | ||||||||||||||||
|
||||||||||||||||
| -only-testing ArrowTests | |
| -only-testing ArrowTests | |
| - name: Build ArrowFlight for iOS Simulator | |
| run: | | |
| xcodebuild build \ | |
| -scheme ArrowFlight \ | |
| -destination "platform=iOS Simulator,id=$SIMULATOR_ID" |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,7 +23,8 @@ import PackageDescription | |||||||||||
| let package = Package( | ||||||||||||
| name: "Arrow", | ||||||||||||
| platforms: [ | ||||||||||||
| .macOS(.v10_15) | ||||||||||||
| .macOS(.v10_15), | ||||||||||||
| .iOS(.v15) | ||||||||||||
| ], | ||||||||||||
|
Comment on lines
23
to
28
|
||||||||||||
| products: [ | ||||||||||||
| .library( | ||||||||||||
|
|
@@ -70,6 +71,11 @@ let package = Package( | |||||||||||
| .testTarget( | ||||||||||||
| name: "ArrowTests", | ||||||||||||
| dependencies: ["Arrow", "ArrowC"], | ||||||||||||
| resources: [ | ||||||||||||
| .copy("testdata_bool.arrow"), | ||||||||||||
| .copy("testdata_double.arrow"), | ||||||||||||
| .copy("testdata_struct.arrow") | ||||||||||||
|
Comment on lines
+75
to
+77
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we copy them from
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unfortunately SwiftPM's .copy() only accepts paths within the target's source directory, so referencing ../../data-generator/swift-datagen/ isn't possible. Instead I've committed the three generated .arrow files directly (they're small -- 650 to 810 bytes). This ensures the package resolves cleanly without needing to run the Go generator first. The CI still regenerates them, so if the generator changes, any drift will be caught.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. But we don't want to add auto generated files into this repository. |
||||||||||||
| ], | ||||||||||||
|
Comment on lines
+74
to
+78
|
||||||||||||
| resources: [ | |
| .copy("testdata_bool.arrow"), | |
| .copy("testdata_double.arrow"), | |
| .copy("testdata_struct.arrow") | |
| ], |
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.
I've committed the three .arrow files. The CI still regenerates them from the Go data generator, so the data should be fresh. This is the only way I was able to find.
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -106,8 +106,14 @@ func checkStructRecordBatch(_ result: Result<ArrowReader.ArrowReaderResult, Arro | |||||||||||
| return recordBatches | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| func currentDirectory(path: String = #file) -> URL { | ||||||||||||
| return URL(fileURLWithPath: path).deletingLastPathComponent() | ||||||||||||
| func testDataURL(_ filename: String) throws -> URL { | ||||||||||||
| guard let url = Bundle.module.url(forResource: filename, withExtension: "arrow") else { | ||||||||||||
| throw ArrowError.ioError( | ||||||||||||
| "Test data file \(filename).arrow not found in bundle. " | ||||||||||||
| + "Run the Go data generator first." | ||||||||||||
|
Comment on lines
+112
to
+113
|
||||||||||||
| "Test data file \(filename).arrow not found in bundle. " | |
| + "Run the Go data generator first." | |
| "Test data file \(filename).arrow not found in test bundle. " | |
| + "Verify that the .arrow test resources are correctly declared in Package.swift, " | |
| + "and run the Go data generator only when regenerating or updating the committed test data." |
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.
Could you add a comment that shows example output of
xcrun ...and each filter something like the following?It'll help us when the command line doesn't work as expected.
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.
Added a example from real macos-15 runner output.
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.
can we also add real device run it would would mostly fail on real device