Repository navigation
CI: typecheck the Apple sources on every pull request - #398
Merged
Merged
Conversation
No workflow job built the darwin sources: the pull request checks are Windows, Linux, Android, Chrome and pana, so a Swift change was only verified by whoever ran it locally. That is how the guards added in #394 could reach review with nothing but a local typecheck behind them. Add a macOS job that downloads Flutter's macOS and iOS engine frameworks and typechecks the shared plugin sources against each: the files branch with #if os(...) and import FlutterMacOS or Flutter, so a single platform's module only proves that platform's branch. It also runs the three isolated Apple helpers (write ownership, discovery progress, central restoration ownership), which compile one source file each with counted assertions.
fotiDim
force-pushed
the
ci/apple-typecheck
branch
2 times, most recently
from
November 23, 2026 11:14
d445a83 to
8c12197
Compare
The job failed twice on the runner. First the hosted SDK's engine directory existed without the macOS framework, so precache skipped the download. Then, once it did download, the framework turned out to be a slice inside FlutterMacOS.xcframework rather than a bare FlutterMacOS.framework beside the engine artifacts — and the directory is named after the host arch (darwin-x64, darwin-arm64). Move the typecheck into .github/scripts/typecheck_apple.sh, which locates the macOS framework in either layout under the arch-named directory, resolves the iOS flutter.xcframework/ios-arm64 slice, forces the precache download when either is missing, and prints the engine listing if they still are not found. The two workflow steps only call it, with --download-only for the fetch step. Verified locally against both layouts: the installed SDK's bare framework and a simulated runner tree with FlutterMacOS.xcframework/macos-arm64_x86_64.
fotiDim
force-pushed
the
ci/apple-typecheck
branch
from
November 23, 2026 11:20
8c12197 to
6a3a64c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nothing in CI compiles
darwin/today: the pull request workflow runs Windows + Linux builds, Dart tests, Android unit tests, Chrome tests and pana, and never touches Swift. The Apple guards in #396 therefore had no automated proof behind them — only a localswiftc -typecheck.This adds a
macos-latestjob with two steps.Typecheck, per platform. The plugin sources are shared by iOS and macOS and branch on
#if os(...), importingFlutterMacOSon one side andFlutteron the other. A single-platform check only proves one branch, so the job downloads both engine frameworks (flutter precache --macos --ios) and typechecks against each:-target $(uname -m)-apple-macos10.15,-F …/engine/darwin-x64(the engine framework there is universal, so it covers both runner architectures).-target arm64-apple-ios13.1,-F …/engine/ios/Flutter.xcframework/ios-arm64.Targets match the podspec (
s.ios.deployment_target = '13.1',s.osx.deployment_target = '10.15'). No Pods, no codesigning, no example build — just the compiler.The isolated helpers.
darwin/universal_ble/Tests/run_write_ownership_test.sh,run_discovery_progress_test.shandrun_central_restoration_owner_test.sheach compile one source file with counted assertions and currently run nowhere in CI.Verified locally on the same commands the job runs: both typechecks pass and the helpers report 31/31, 24/24 and 28/28.
This is deliberately a compile-level gate, not a behavioral one — the CoreBluetooth paths still need the device smoke test described in #396.