Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for the iOS deployment target (IPHONEOS_DEPLOYMENT_TARGET) when packaging native code assets, passing it from Xcode and validating it against the minimum supported iOS version. Feedback on the changes highlights two compilation issues: an invalid syntax pattern (?deploymentTarget) in the test file and a type mismatch where a double is passed to the Version constructor instead of an int.
|
I think we should aim for the version number that comes from the xcode build to flow into (Maybe we should do MacOS and iOS in the same PR? Aren't their constraints rather similar?) Here is an AI explanation on how to do this following a similar pattern as #181004 takes for wiring the ccompiler info from cmake to the build hooks: To wire the deployment target into Here is the step-by-step wiring across the 4 files: 1. Forward the Xcode build setting in
|
|
@dcharkes Agreed that the app deployment target should reach both build/link hooks and the packaged metadata, and that iOS and macOS should be handled together. The remaining precision prerequisite is in Once the API shape is agreed and available for Flutter to consume, the follow-up here is to use one resolved version per platform for build/link configuration and metadata, forward This Flutter patch currently only fixes iOS framework metadata. It does not yet implement full hook propagation or the macOS configuration change. |
An app targeting iOS 16.4 can bundle a native asset binary requiring 16.4, while Flutter writes 15.0 into the generated framework's
MinimumOSVersion. This PR forwards Xcode'sIPHONEOS_DEPLOYMENT_TARGETto assemble and preserves the full version in native framework metadata.Partially addresses #194145 (iOS framework packaging only). The broader issue stays open for hook configuration and macOS work. Related: #145104.
Upstream prerequisite: Full deployment-version propagation is proposed in dart-lang/native#3741 and draft dart-lang/native#3742. Once the API shape is agreed and released, Flutter can consume it and extend this PR to forward the complete iOS and macOS versions into build/link hooks, with consistent metadata and propagation/cache/default/error tests. The current Flutter patch remains limited to iOS framework metadata; the native API is not yet merged or released.
Missing/empty settings retain the existing 15.0 fallback. Settings below Flutter's iOS 15 baseline retain that floor. Major/minor/patch components are preserved; malformed input produces an actionable
ToolExitbefore framework copying. The define participates in the existing build-environment hash, so changing the target selects a new build configuration.Scope
Validation
5fc346839b) and master (a381eea6b1) using the reduced C-library reproducer in [native assets] Respect app deployment targets on iOS and macOS #194145. Five regression cases failed before the implementation.2688125b880and macOS 26.7.1 / Xcode 27.0: unsigned release device and debug simulator builds produce app/framework versions of 16.4, with binaryminos16.4 (both arm64/x86_64 simulator slices). Changing the app target to 17.2.1 without cleaning updates framework metadata to 17.2.1.71e4717a617adds only Dart/Skia DEPS rolls and an unrelated OverlayPortal change; none of the affected Flutter Tools paths changed. The targeted tests and analysis were repeated after merging that base without rewriting the published branch.No full Flutter suite, archive/App Store validation, device/simulator execution, or complete llamadart build without companions was performed. This remains a draft for design and contributor review.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.