Skip to content

Commit

Permalink
Set compile test iOS app target version to not embed Swift runtime (#…
Browse files Browse the repository at this point in the history
…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 flutter/flutter#139605
  • Loading branch information
jmagman authored Dec 15, 2023
1 parent f0051d8 commit 0cd2ea9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion dev/devicelab/lib/tasks/perf_tests.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0cd2ea9

Please sign in to comment.