Skip to content

[code_assets] Preserve full Apple deployment versions - #3742

Merged
liamappelbe merged 11 commits into
dart-lang:mainfrom
leehack:apple-deployment-version-precision
Oct 30, 2026
Merged

liamappelbe merged 11 commits into
dart-lang:mainfrom
leehack:apple-deployment-version-precision

Conversation

@leehack

@leehack leehack commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

Apple native-asset hook configs currently expose only a major integer, so compilation loses deployment-target precision such as iOS 17.2.1 or macOS 14.4.1.

  • Add syntax-backed, comparable AppleVersion and deploymentVersion for the minimum supported OS, retaining legacy integer compatibility.
  • Generate numeric bounds validation to prevent overflow, and preserve full versions in CBuilder/CLinker, FFIgen, and Objective-C compiler inputs.
  • Cover invalid inputs, compatibility, cache invalidation, and actual Mach-O deployment versions in existing iOS/macOS native tests.

Flutter integration and package-declared minimum-version negotiation are separate work. Naming and FFIgen/Objective-C test-layout discussions remain open.

Validation

On macOS arm64, Dart 3.13.5, and Xcode 27.0:

  • 1,063 focused tests, real Clang/Swift binary checks, published 2.1.0 reader compatibility, and 12 example suites passed.
  • Generation, analysis, formatting, dependency/license checks, and metadata/publish validation passed.
  • dart tool/ci.dart --all: 2,879 passed, 10 skipped, four baseline Swift2objc integration failures. Swift2objc API extraction retains its baseline exit 255.
  • Latest upstream CI awaits maintainer approval. The previous Windows/dev run failed loading an unchanged test due to a test-runner connection error.

Related Issues

Fixes #3741. Flutter follow-up: flutter/flutter#194145 and #194146. Package-constraint work: #1500.

PR Checklist

  • Reviewed and followed the contributor guide.
  • Ran dart tool/ci.dart --all and resolved all issues. Baseline failures remain disclosed above.
  • All existing and new tests pass. Baseline failures remain disclosed above.
  • Solves the reported issue and includes regression tests.
  • Updated relevant changelogs.
  • Updated required package versions and dependency floors.

@codecov

codecov Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.84%. Comparing base (3cbe319) to head (c27ff59).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3742      +/-   ##
==========================================
- Coverage   87.94%   85.84%   -2.11%     
==========================================
  Files         310      322      +12     
  Lines       19848    20876    +1028     
==========================================
+ Hits        17456    17921     +465     
- Misses       2392     2955     +563     
Flag Coverage Δ
ffigen 91.36% <ø> (ø)
native_pkgs_macos 81.74% <100.00%> (-4.73%) ⬇️
native_pkgs_ubuntu 69.16% <100.00%> (-2.98%) ⬇️
native_pkgs_windows 72.11% <100.00%> (-3.37%) ⬇️
objective_c 62.86% <ø> (ø)
swiftgen 80.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
code_assets 95.31% <100.00%> (+0.35%) ⬆️
data_assets 91.56% <ø> (ø)
ffi 100.00% <ø> (ø)
ffigen 91.45% <ø> (ø)
hooks 86.40% <ø> (ø)
hooks_runner 90.52% <ø> (ø)
jni 66.34% <ø> (ø)
jni_flutter ∅ <ø> (∅)
jni_util 25.00% <ø> (ø)
jnigen 82.85% <ø> (ø)
json_syntax_generator 42.01% <100.00%> (∅)
native_test_helpers 85.71% <ø> (ø)
native_toolchain_c 95.99% <100.00%> (+0.01%) ⬆️
objective_c 79.53% <ø> (ø)
pub_formats ∅ <ø> (∅)
record_use 81.48% <ø> (ø)
snippet_tool 66.23% <ø> (ø)
swift2objc 92.95% <ø> (ø)
swiftgen 80.41% <ø> (ø)
test_case_selector 97.28% <ø> (ø)
Files with missing lines Coverage Δ
...code_assets/lib/src/code_assets/apple_version.dart 100.00% <100.00%> (ø)
pkgs/code_assets/lib/src/code_assets/config.dart 97.02% <100.00%> (+0.60%) ⬆️
pkgs/code_assets/lib/src/code_assets/testing.dart 100.00% <100.00%> (ø)
...enerator/lib/src/generator/property_generator.dart 23.64% <100.00%> (ø)
...json_syntax_generator/lib/src/model/dart_type.dart 45.16% <100.00%> (ø)
...ntax_generator/lib/src/parser/schema_analyzer.dart 47.41% <100.00%> (ø)
...ive_toolchain_c/lib/src/cbuilder/run_cbuilder.dart 97.92% <100.00%> (+0.06%) ⬆️

... and 8 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dcharkes dcharkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks! Yeah I noticed the same issue with the CodeConfig, you beat me to it to make a PR! 😄

I think we should deprecate the major version int API and provide an API that uses String or Version. (But we don't have a Version class available, so maybe just String)

WDYT?

@leehack

leehack commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks! Yeah I noticed the same issue with the CodeConfig, you beat me to it to make a PR! 😄

I think we should deprecate the major version int API and provide an API that uses String or Version. (But we don't have a Version class available, so maybe just String)

WDYT?

Yeah. I like the idea. Updated the PR based on that. Please let me know if you like this direction.

Comment thread pkgs/ffigen/CHANGELOG.md Resolved
Comment thread pkgs/ffigen/pubspec.yaml Resolved
Comment thread pkgs/hooks/test/checksum_test.dart Resolved
Comment thread pkgs/objective_c/CHANGELOG.md Resolved
@dcharkes
dcharkes marked this pull request as ready for review October 13, 2026 15:01

@dcharkes dcharkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Okay, I think we're getting there. I did a full review of the PR.

@leehack
leehack requested a review from dcharkes October 14, 2026 12:51
Comment thread pkgs/data_assets/CHANGELOG.md Resolved

@liamappelbe liamappelbe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FFIgen and objective_c changes LGTM

@liamappelbe
liamappelbe merged commit d58a8f5 into dart-lang:main Oct 30, 2026
63 of 66 checks passed
copybara-service Bot pushed a commit to dart-lang/sdk that referenced this pull request Nov 3, 2026
Revisions updated by `dart tools/rev_sdk_deps.dart`.

core (https://github.com/dart-lang/core/compare/d7bd45c..24e09c4):
  24e09c4c  Sun Nov 1 21:12:19 2026 +0000  dependabot[bot]  Bump the github-actions group with 4 updates (dart-lang/core#1037)
  87ac1b4c  Fri Oct 30 16:02:43 2026 +0100  Michael Thomsen  [os_detect] Deprecate package:os_detect in favor of package:platform (dart-lang/core#1003)
  8debf335  Fri Oct 30 01:57:36 2026 +0530  Sahaja Pallapothula  Clarify Characters equality and Unicode normalization (dart-lang/core#1031)

ecosystem (https://github.com/dart-lang/ecosystem/compare/24b9ba8..f8faabf):
  f8faabf  Sun Nov 1 18:16:20 2026 +0000  dependabot[bot]  Bump the github-actions group with 2 updates (dart-lang/ecosystem#481)
  27c2fc8  Sat Oct 31 12:36:53 2026 +0100  Moritz  Fix publish workflow pins, add tag_prefix to health, and update docs (dart-lang/ecosystem#480)
  05641a9  Sat Oct 31 09:56:42 2026 +0100  Moritz  Restore deprecated publish.yaml workflow and firehose CLI entrypoint (dart-lang/ecosystem#479)
  78abf72  Fri Oct 30 08:24:07 2026 -0700  Kevin Moore  fix(repo_manage): use pub_semver for changelog -wip transitions (dart-lang/ecosystem#475)
  0bfa654  Fri Oct 30 09:33:57 2026 +0100  Moritz  Move publish check to health workflow and use individual package publishing workflows from `setup-dart` (dart-lang/ecosystem#454)
  adf7979  Thu Oct 29 23:46:49 2026 -0700  Kevin Moore  test(firehose): use hasLength, containsPair, and isFalse (dart-lang/ecosystem#477)

http (https://github.com/dart-lang/http/compare/c76dfb3..8c0d66a):
  8c0d66a  Fri Oct 30 09:54:41 2026 -0700  Brian Quinlan  chore(cupertino_http): check ffigen generation (dart-lang/http#2044)
  c8737d1  Fri Oct 30 09:11:46 2026 +0100  Moritz  chore(http): run Firefox tests with -headless instead of xvfb-run (dart-lang/http#2033)
  05d0b18  Fri Oct 30 07:08:19 2026 +0100  Moritz  fix(http2): make StreamException a StreamTransportException and forward ALPN errors to onError (dart-lang/http#2009)

i18n (https://github.com/dart-lang/i18n/compare/4c7b4ad..7475ce6):
  7475ce64  Sat Oct 31 02:49:28 2026 +0100  Moritz  [intl4x] Fix NumberFormat.percent ignoring digits (dart-lang/i18n#1115)

shelf (https://github.com/dart-lang/shelf/compare/62d3e4e..9946de5):
  9946de5  Sun Nov 1 12:27:59 2026 +0000  dependabot[bot]  build(deps): bump the github-actions group with 3 updates (dart-lang/shelf#554)

test (https://github.com/dart-lang/test/compare/6d74720..2a9e017):
  2a9e0175  Sun Nov 1 03:47:24 2026 +0000  dependabot[bot]  Bump the github-actions group with 6 updates (dart-lang/test#2813)
  55cd5cd5  Fri Oct 30 13:43:47 2026 -0700  Nate Bosch  Migrate publishing workflows from firehose to setup-dart (dart-lang/test#2812)
  10dc78c0  Fri Oct 30 11:21:53 2026 -0700  Nate Bosch  [checks] Describe what the stream did in failures (dart-lang/test#2811)
  c11ad06d  Fri Oct 30 08:59:57 2026 -0700  Nate Bosch  [checks] Add CheckFailure.describeNested (dart-lang/test#2793)
  0137b43e  Fri Oct 30 05:40:43 2026 +0530  Shriraj Jadhav  [checks] Use the Iterable.last member for the last expectation (dart-lang/test#2807)
  50c9f454  Thu Oct 29 15:11:39 2026 -0700  Nate Bosch  [checks] Collapse clauses for described conditions (dart-lang/test#2794)

tools (https://github.com/dart-lang/tools/compare/3980dca..1579f8d):
  1579f8d69  Mon Nov 2 02:44:58 2026 +0530  Joshua  fix(coverage): reject package: and dart: URIs outside known roots in Resolver (dart-lang/tools#2764)
  f869fdca4  Sun Nov 1 10:26:34 2026 +0100  dart-ecosystem-bot[bot]  [boring] Update BoringSSL to ed9209cf (dart-lang/tools#2774)
  d10e2b87f  Sun Nov 1 10:26:11 2026 +0100  dart-ecosystem-bot[bot]  [boring] Pin the prebuilt binaries of boring-binaries-20261101-33e9e69722af (dart-lang/tools#2777)
  33e9e6972  Sun Nov 1 05:56:30 2026 +0000  dependabot[bot]  build(deps): bump the github-actions group with 4 updates (dart-lang/tools#2775)
  f84d0d0d2  Sun Nov 1 05:36:12 2026 +0000  dependabot[bot]  build(deps): bump ffigen from 22.0.0 to 23.0.0 in /pkgs/boring (dart-lang/tools#2776)
  14ad5e515  Fri Oct 30 10:48:58 2026 -0700  Kevin Moore  [mime] Harden BoundMultipartStream error routing, headers, and epilogue (dart-lang/tools#2629)
  7a780d48c  Fri Oct 30 12:57:03 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid rescanning failed plain-text runs in InlineParser (dart-lang/tools#2757)
  3671d33a9  Fri Oct 30 12:56:48 2026 +0100  Jonas Finnemann Jensen  [markdown] Index footnote definitions and labels on Document for O(1) lookup (dart-lang/tools#2760)
  6f38e9fda  Fri Oct 30 12:56:09 2026 +0100  Jonas Finnemann Jensen  [markdown] Bound the domain of extended URL autolinks to DNS limits (dart-lang/tools#2759)
  aa0c38544  Fri Oct 30 12:20:40 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid quadratic removeRange in _combineAdjacentText (dart-lang/tools#2758)
  f425baf46  Fri Oct 30 11:16:28 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid rescanning failed space runs in LineBreakSyntax (dart-lang/tools#2756)
  c7eafbec3  Fri Oct 30 11:09:45 2026 +0100  Jonas Finnemann Jensen  [markdown] Reject '<' in AutolinkSyntax (dart-lang/tools#2755)
  86ed0f902  Fri Oct 30 11:08:25 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid quadratic backtracking in headerPattern (dart-lang/tools#2754)
  8ea07517f  Fri Oct 30 07:45:42 2026 +0100  Moritz  [boring] Regenerate the x509-limbo expected failures in the refresh job (dart-lang/tools#2712)
  40235c365  Thu Oct 29 14:46:17 2026 +0100  Jonas Finnemann Jensen  [markdown] Make HtmlBlockSyntax.parseChildLines iterative (dart-lang/tools#2749)
  0ff03f643  Thu Oct 29 14:41:33 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid re-escaping nested image alt text in ImageSyntax.createNode (dart-lang/tools#2752)
  784654d01  Thu Oct 29 14:37:11 2026 +0100  Jonas Finnemann Jensen  [markdown] Add test cases covering parser and renderer edge cases (dart-lang/tools#2753)
  4f2718ad8  Thu Oct 29 14:36:52 2026 +0100  Jonas Finnemann Jensen  [markdown] Make Document._parseInlineContent iterative (dart-lang/tools#2750)
  cac1421d5  Thu Oct 29 14:17:06 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid quadratic duplicate heading ID probing in HtmlRenderer (dart-lang/tools#2748)
  66880bcd3  Thu Oct 29 14:11:27 2026 +0100  Jonas Finnemann Jensen  [markdown] Check footnote label and empty map before scanning footnote keys (dart-lang/tools#2751)
  7f8696523  Thu Oct 29 14:07:06 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid quadratic blank-line lookahead in CodeBlockSyntax (dart-lang/tools#2747)
  9da6bb291  Thu Oct 29 14:03:04 2026 +0100  Jonas Finnemann Jensen  [markdown] Avoid exponential and quadratic backtracking in tablePattern (dart-lang/tools#2746)

dartdoc is held back at db94437, before dart-lang/dartdoc#4312, because its
mock SDK version changes conflict in the google3 3-way merge with the hotfix
in cl/1005963642.

native is held back at e0ca7c6, before dart-lang/native#3742, because
deprecating `MacOSCodeConfig(targetVersion: ...)` causes a fatal
`deprecated_member_use` diagnostic in `pkg/dartdev/lib/src/native_assets.dart`.

web is held back at 4e60e61, before dart-lang/web#596, because it changes
`package:web` signatures (e.g. `innerHTML=`, `parseFromString`, `Worker()`)
from `JSAny` to `String` in ways that break callers in google3.

Change-Id: I53d2cbde741c45b8fd33bca42742549819dd332b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/572780
Reviewed-by: Brian Quinlan <[email protected]>
Commit-Queue: Nate Bosch <[email protected]>
copybara-service Bot pushed a commit to dart-lang/sdk that referenced this pull request Nov 4, 2026
Revisions updated by `dart tools/rev_sdk_deps.dart native`.

native (https://github.com/dart-lang/native/compare/e0ca7c6..b442038):
  b442038de  Mon Nov 2 10:46:15 2026 -0800  Brian Quinlan  [objective_c] support `scheduleInRunLoop:forMode:` (dart-lang/native#3763)
  264318e75  Fri Oct 30 12:49:03 2026 -0700  Brian Quinlan  [objective_c] fix `toNSInputStream` double copy (dart-lang/native#3762)
  63f3e8641  Fri Oct 30 12:09:04 2026 -0700  Brian Quinlan  [objective_c] avoid an extra copy in `toNSData`  (dart-lang/native#3761)
  ad203b01d  Fri Oct 30 11:48:15 2026 -0700  Brian Quinlan  [objective_c] increase read chunk size (dart-lang/native#3760)
  fa112d95b  Fri Oct 30 09:14:23 2026 -0700  Brian Quinlan  [objective_c] Fix a `NSInputStream` hang (dart-lang/native#3751)
  035f4ef38  Fri Oct 30 09:23:30 2026 +0100  Michael Goderbauer  [jnigen] Fix race conditions in tests (dart-lang/native#3767)
  d58a8f514  Fri Oct 30 00:57:49 2026 -0400  Jhin Lee  [code_assets] Preserve full Apple deployment versions (dart-lang/native#3742)

Migrate `MacOSCodeConfig` in `pkg/dartdev/lib/src/native_assets.dart` from the
deprecated `targetVersion` parameter to `deploymentVersion: AppleVersion(...)`.

Change-Id: I2df469fc05bda2c1db051f43e803fe5145f7c246
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/573102
Auto-Submit: Nate Bosch <[email protected]>
Reviewed-by: Nicholas Shahan <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>
Commit-Queue: Ben Konyi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[code_assets] Preserve minor and patch components of Apple deployment targets

3 participants