Unverified Commit 0cd2ea96 authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Set compile test iOS app target version to not embed Swift runtime (#140188)

ObjC->Swift plugin migration caused a size regression in the gallery app because the Swift runtime was also pulled in.  

The gallery app minimum target version is iOS 11.0, which predates Swift ABI compatibility.  Pre iOS 12.2 apps embedded the Swift runtime since there wasn't one available to use in the OS.  

Add  `FLUTTER_XCODE_IPHONEOS_DEPLOYMENT_TARGET` to the compile perf test environment, which gets translated by the tool to an Xcode build setting:
```
[2023-12-14 15:52:14.797318] [STDOUT] stdout:                IPHONEOS_DEPLOYMENT_TARGET = 12.2
```

On my machine on main
```
    "release_size_bytes": 43717389,
```
becomes
```
    "release_size_bytes": 40679432,
```

Fixes https://github.com/flutter/flutter/issues/139605
parent f0051d8b
......@@ -1687,7 +1687,17 @@ class CompileTest {
options.add('--tree-shake-icons');
options.add('--split-debug-info=infos/');
watch.start();
await flutter('build', options: options);
await flutter(
'build',
options: options,
environment: <String, String> {
// iOS 12.1 and lower did not have Swift ABI compatibility so Swift apps embedded the Swift runtime.
// https://developer.apple.com/documentation/xcode-release-notes/swift-5-release-notes-for-xcode-10_2#App-Thinning
// The gallery pulls in Swift plugins. Set lowest version to 12.2 to avoid benchmark noise.
// This should be removed when when Flutter's minimum supported version is >12.2.
'FLUTTER_XCODE_IPHONEOS_DEPLOYMENT_TARGET': '12.2',
},
);
watch.stop();
final Directory buildDirectory = dir(path.join(
cwd,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment