Skip to content

Commit 6d1e4aa

Browse files
LouiseHsuGitHub Actions Bot
authored andcommitted
Prevent flutter build ios-framework --xcframework from copying Flutter.xcframework.dSYM into the App.framework folder. (flutter#157394)
Fixes flutter#157359 Prevents Flutter.xcframework.dSYM from being copied into the App.framework folder. I am not 100% positive if there are cases where it's valid to have multiple dSYMs in that folder, so I'm just string matching and filtering out `Flutter.xcframework.dSYM`
1 parent 2e2c358 commit 6d1e4aa

3 files changed

Lines changed: 19 additions & 7 deletions

File tree

‎dev/devicelab/bin/tasks/build_ios_framework_module_test.dart‎

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,25 @@ Future<void> _testBuildIosFramework(Directory projectDir, { bool isModule = fals
188188
'vm_snapshot_data',
189189
));
190190

191+
final String dsymPath = path.join(
192+
outputPath,
193+
mode,
194+
'App.xcframework',
195+
'ios-arm64',
196+
'dSYMs'
197+
);
198+
checkDirectoryExists(dsymPath);
199+
191200
final String appFrameworkDsymPath = path.join(
192-
outputPath,
193-
mode,
194-
'App.xcframework',
195-
'ios-arm64',
196-
'dSYMs',
197-
'App.framework.dSYM'
201+
dsymPath,
202+
'App.framework.dSYM'
198203
);
199204
checkDirectoryExists(appFrameworkDsymPath);
205+
206+
if (Directory(dsymPath).listSync().whereType<Directory>().length != 1) {
207+
throw TaskResult.failure('App.framework/dSYMs should ONLY contain App.xcframework.dSYM');
208+
}
209+
200210
await _checkDsym(path.join(
201211
appFrameworkDsymPath,
202212
'Contents',

‎packages/flutter_tools/lib/src/commands/build_ios_framework.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ abstract class BuildFrameworkCommand extends BuildSubCommand {
150150
...framework.parent
151151
.listSync()
152152
.where((FileSystemEntity entity) =>
153-
entity.basename.endsWith('dSYM'))
153+
entity.basename.endsWith('dSYM') && !entity.basename.startsWith('Flutter'))
154154
.map((FileSystemEntity entity) => <String>['-debug-symbols', entity.path])
155155
.expand<String>((List<String> parameter) => parameter),
156156
],

‎packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,8 @@ void main() {
558558
final Directory parentA = fileSystem.directory('FrameworkA')..createSync();
559559
final File dSYMA = parentA.childFile('FrameworkA.framework.dSYM')..createSync();
560560
final Directory frameworkA = parentA.childDirectory('FrameworkA.framework')..createSync();
561+
// Flutter.framework.dSYM should be correctly filtered out.
562+
parentA.childFile('Flutter.framework.dSYM').createSync();
561563

562564
final Directory parentB = fileSystem.directory('FrameworkB')..createSync();
563565
final File dSYMB = parentB.childFile('FrameworkB.framework.dSYM')..createSync();

0 commit comments

Comments
 (0)