From 4229fffd02b01d26b17557c445aedca81aa08bde Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Tue, 29 Apr 2025 08:48:25 -0700 Subject: [PATCH 1/4] fix: save dispatch table info in supplement --- packages/flutter_tools/lib/src/base/build.dart | 15 +++++++++++---- .../lib/src/build_system/targets/common.dart | 2 ++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/flutter_tools/lib/src/base/build.dart b/packages/flutter_tools/lib/src/base/build.dart index ccb9e1dcfc724..87db5142fb1d7 100644 --- a/packages/flutter_tools/lib/src/base/build.dart +++ b/packages/flutter_tools/lib/src/base/build.dart @@ -129,20 +129,27 @@ class AOTSnapshotter { final Directory outputDir = _fileSystem.directory(outputPath); outputDir.createSync(recursive: true); - final List dumpClassTableLinkInfoArgs = [ + // Currently we only use the linker on iOS, but we will eventually split out + // the concept of "optimizes patch snapshot" from "uses linker" and probably + // only uses the linker on iOS, but optimize patch snapshots everywhere. + // TODO(eseidel): TargetPlatform.darwin doesn't use the linker. + bool usesLinker = (platform == TargetPlatform.ios || platform == TargetPlatform.darwin); + final List dumpLinkInfoArgs = [ // Shorebird dumps the class table information during snapshot compilation which is later used during linking. '--print_class_table_link_debug_info_to=${_fileSystem.path.join(outputDir.parent.path, 'App.class_table.json')}', '--print_class_table_link_info_to=${_fileSystem.path.join(outputDir.parent.path, 'App.ct.link')}', '--print_field_table_link_debug_info_to=${_fileSystem.path.join(outputDir.parent.path, 'App.field_table.json')}', '--print_field_table_link_info_to=${_fileSystem.path.join(outputDir.parent.path, 'App.ft.link')}', + '--print_dispatch_table_link_debug_info_to=${_fileSystem.path.join(outputDir.parent.path, 'App.dispatch_table.json')}', + '--print_dispatch_table_link_info_to=${_fileSystem.path.join(outputDir.parent.path, 'App.dt.link')}', ]; final List genSnapshotArgs = [ // Shorebird uses --deterministic to improve snapshot stability and increase linking. '--deterministic', - // Only use the default Shorebird gen_snapshot args on iOS. - if (platform == TargetPlatform.ios || platform == TargetPlatform.darwin) - ...dumpClassTableLinkInfoArgs, + // Only save LinkInfo if we're using the linker. + if (usesLinker) + ...dumpLinkInfoArgs, ]; final bool targetingApplePlatform = diff --git a/packages/flutter_tools/lib/src/build_system/targets/common.dart b/packages/flutter_tools/lib/src/build_system/targets/common.dart index fa75bff9bc4b7..953ad0c0c8b91 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/common.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/common.dart @@ -486,6 +486,8 @@ abstract final class LinkSupplement { // into the shorebird directory. maybeCopy('App.ct.link'); maybeCopy('App.class_table.json'); + maybeCopy('App.dt.link'); + maybeCopy('App.dispatch_table.json'); maybeCopy('App.ft.link'); maybeCopy('App.field_table.json'); } From b81393e15cfa11155b28916eac57c6a0132759fa Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Wed, 30 Apr 2025 14:03:28 -0700 Subject: [PATCH 2/4] chore: roll dart to 2a7a9ebe09fab3371da108a8383fdefd914631dd --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 1aca4272db78a..3d8578ea4f506 100644 --- a/DEPS +++ b/DEPS @@ -17,7 +17,7 @@ vars = { 'skia_git': 'https://skia.googlesource.com', 'llvm_git': 'https://llvm.googlesource.com', 'skia_revision': 'e7b8d078851fd505475fe74359e31a421e6968ea', - "dart_sdk_revision": "bcca0e4e042c1c7cfe995a2e636eeb4fc01012f6", + "dart_sdk_revision": "2a7a9ebe09fab3371da108a8383fdefd914631dd", "dart_sdk_git": "git@github.com:shorebirdtech/dart-sdk.git", "updater_git": "https://github.com/shorebirdtech/updater.git", "updater_rev": "ab23721e35d2e740026def44e1469e17e3440c83", From f370128802e4e4e984440422b37265e41d337cc3 Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 1 May 2025 14:35:48 -0700 Subject: [PATCH 3/4] chore: roll dart to cde4a4dfcfb4771b322a8ca71ae3700188a09662 --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index 3d8578ea4f506..bee5db510dd13 100644 --- a/DEPS +++ b/DEPS @@ -17,7 +17,7 @@ vars = { 'skia_git': 'https://skia.googlesource.com', 'llvm_git': 'https://llvm.googlesource.com', 'skia_revision': 'e7b8d078851fd505475fe74359e31a421e6968ea', - "dart_sdk_revision": "2a7a9ebe09fab3371da108a8383fdefd914631dd", + "dart_sdk_revision": "cde4a4dfcfb4771b322a8ca71ae3700188a09662", "dart_sdk_git": "git@github.com:shorebirdtech/dart-sdk.git", "updater_git": "https://github.com/shorebirdtech/updater.git", "updater_rev": "ab23721e35d2e740026def44e1469e17e3440c83", From 32ccdd791a4cb8a7381ce8f21c4d928915fc074a Mon Sep 17 00:00:00 2001 From: Eric Seidel Date: Thu, 1 May 2025 15:05:34 -0700 Subject: [PATCH 4/4] chore: roll dart to 2d2db80620f5ab42e5260f61663795e1ae13cf0e --- DEPS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DEPS b/DEPS index bee5db510dd13..d8e5919a9f2c6 100644 --- a/DEPS +++ b/DEPS @@ -17,7 +17,7 @@ vars = { 'skia_git': 'https://skia.googlesource.com', 'llvm_git': 'https://llvm.googlesource.com', 'skia_revision': 'e7b8d078851fd505475fe74359e31a421e6968ea', - "dart_sdk_revision": "cde4a4dfcfb4771b322a8ca71ae3700188a09662", + "dart_sdk_revision": "2d2db80620f5ab42e5260f61663795e1ae13cf0e", "dart_sdk_git": "git@github.com:shorebirdtech/dart-sdk.git", "updater_git": "https://github.com/shorebirdtech/updater.git", "updater_rev": "ab23721e35d2e740026def44e1469e17e3440c83",