diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn index f218fffc33..1d5609ac60 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/BUILD.gn @@ -349,21 +349,11 @@ template("jit_runner") { "$snapshot_gen_dir/vm_isolate_snapshot${product_suffix}.bin") dest = "vm_snapshot_data.bin" }, - { - path = rebase_path( - "$snapshot_gen_dir/vm_snapshot_instructions${product_suffix}.bin") - dest = "vm_snapshot_instructions.bin" - }, { path = rebase_path( "$snapshot_gen_dir/isolate_snapshot${product_suffix}.bin") dest = "isolate_core_snapshot_data.bin" }, - { - path = rebase_path( - "$snapshot_gen_dir/isolate_snapshot_instructions${product_suffix}.bin") - dest = "isolate_core_snapshot_instructions.bin" - }, ] _vulkan_icds = [] diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc index 7e6ffab05f..a10b003167 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/component_v2.cc @@ -409,19 +409,10 @@ ComponentV2::ComponentV2( return MakeFileMapping("/pkg/data/vm_snapshot_data.bin", false /* executable */); }; - settings_.vm_snapshot_instr = []() { - return MakeFileMapping("/pkg/data/vm_snapshot_instructions.bin", - true /* executable */); - }; - settings_.isolate_snapshot_data = []() { return MakeFileMapping("/pkg/data/isolate_core_snapshot_data.bin", false /* executable */); }; - settings_.isolate_snapshot_instr = [] { - return MakeFileMapping("/pkg/data/isolate_core_snapshot_instructions.bin", - true /* executable */); - }; } #if defined(DART_PRODUCT) @@ -487,10 +478,6 @@ ComponentV2::ComponentV2( settings_.dart_flags = {}; - // Run in unsound null safety mode as some packages used in Integration - // testing have not been migrated yet. - settings_.dart_flags.push_back("--no-sound-null-safety"); - // Don't collect CPU samples from Dart VM C++ code. settings_.dart_flags.push_back("--no_profile_vm"); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn index 7564a3584e..bc9853d5cd 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/kernel/BUILD.gn @@ -44,17 +44,11 @@ template("core_snapshot") { inputs = [ platform_dill ] vm_snapshot_data = "$target_gen_dir/vm_isolate_snapshot${suffix}.bin" - vm_snapshot_instructions = - "$target_gen_dir/vm_snapshot_instructions${suffix}.bin" isolate_snapshot_data = "$target_gen_dir/isolate_snapshot${suffix}.bin" - isolate_snapshot_instructions = - "$target_gen_dir/isolate_snapshot_instructions${suffix}.bin" snapshot_profile = "$target_gen_dir/snapshot_profile${suffix}.json" outputs = [ vm_snapshot_data, - vm_snapshot_instructions, isolate_snapshot_data, - isolate_snapshot_instructions, snapshot_profile, ] @@ -68,14 +62,10 @@ template("core_snapshot") { args = [ "--enable_mirrors=false", "--deterministic", - "--snapshot_kind=core-jit", + "--snapshot_kind=core", "--vm_snapshot_data=" + rebase_path(vm_snapshot_data, root_build_dir), - "--vm_snapshot_instructions=" + - rebase_path(vm_snapshot_instructions, root_build_dir), "--isolate_snapshot_data=" + rebase_path(isolate_snapshot_data, root_build_dir), - "--isolate_snapshot_instructions=" + - rebase_path(isolate_snapshot_instructions, root_build_dir), "--write_v8_snapshot_profile_to=" + rebase_path(snapshot_profile, root_build_dir), ] diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn index 342c45e780..a70b06ce1a 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/BUILD.gn @@ -13,6 +13,7 @@ dart_library("lib") { package_name = "text-input-view" sources = [ "text_input_view.dart" ] deps = [ "//flutter/shell/platform/fuchsia/dart:args" ] + null_safe = true } flutter_component("component") { @@ -21,7 +22,7 @@ flutter_component("component") { manifest = rebase_path("meta/text-input-view.cml") main_package = "text-input-view" main_dart = "text_input_view.dart" - + sound_null_safety = true deps = [ ":lib" ] } diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/lib/text_input_view.dart b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/lib/text_input_view.dart index a1e5c32261..d3a318e3b2 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/lib/text_input_view.dart +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/tests/integration/text-input/text-input-view/lib/text_input_view.dart @@ -26,9 +26,11 @@ final Map hidToKey = { }; int main() { - print('Launching text-input-view'); + final bool soundNullSafety = [null] is! List; + print('Launching text-input-view. Sound null safety: $soundNullSafety'); TestApp app = TestApp(); app.run(); + return 0; } class TestApp { @@ -37,8 +39,9 @@ class TestApp { void run() { // Set up window callbacks - window.onPlatformMessage = (String name, ByteData data, PlatformMessageResponseCallback callback) { - this.decodeAndReportPlatformMessage(name, data); + window.onPlatformMessage = + (String name, ByteData? data, PlatformMessageResponseCallback? callback) { + this.decodeAndReportPlatformMessage(name, data!); }; window.onMetricsChanged = () { window.scheduleFrame(); @@ -81,7 +84,7 @@ class TestApp { if (name == "flutter/keyevent" && decodedJson["type"] == "keydown") { if (hidToKey[decodedJson["hidUsage"]] != null) { - _reportTextInput(hidToKey[decodedJson["hidUsage"]]); + _reportTextInput(hidToKey[decodedJson["hidUsage"]!]!); } } @@ -91,10 +94,14 @@ class TestApp { void _reportTextInput(String text) { print('text-input-view reporting keyboard input to KeyboardInputListener'); - final message = utf8.encode(json.encode({ - 'method': 'KeyboardInputListener.ReportTextInput', - 'text': text, - })).buffer.asByteData(); - PlatformDispatcher.instance.sendPlatformMessage('fuchsia/input_test', message, null); + final message = utf8 + .encode(json.encode({ + 'method': 'KeyboardInputListener.ReportTextInput', + 'text': text, + })) + .buffer + .asByteData(); + PlatformDispatcher.instance + .sendPlatformMessage('fuchsia/input_test', message, null); } } diff --git a/engine/src/flutter/tools/fuchsia/dart/kernel/dart_kernel.gni b/engine/src/flutter/tools/fuchsia/dart/kernel/dart_kernel.gni index 01de51578d..aa7c908cc5 100644 --- a/engine/src/flutter/tools/fuchsia/dart/kernel/dart_kernel.gni +++ b/engine/src/flutter/tools/fuchsia/dart/kernel/dart_kernel.gni @@ -134,7 +134,10 @@ template("_convert_kernel_manifest") { # link_platform (optional) # Whether the kernel compiler should link the current platform.dill into # the build. If false, the --no-link-platform flag will be passed to the -# compiler. Defaults to false +# compiler. Defaults to false. +# +# sound_null_safety (optional) +# Whether to generate sound null safe kernel. template("dart_kernel") { assert(defined(invoker.platform_name), "dart_kernel() requires platform_name") assert(defined(invoker.packages_path), @@ -258,7 +261,6 @@ template("dart_kernel") { } args += [ "--verbosity=warning", - "--no-sound-null-safety", "--target", invoker.platform_name, "--platform", @@ -278,6 +280,10 @@ template("dart_kernel") { rebase_path(_kernel_path, root_build_dir), ] + if (!defined(invoker.sound_null_safety) || !invoker.sound_null_safety) { + args += [ "--no-sound-null-safety" ] + } + # TODO(richkadel): It should be possible to remove all of the build rules # related to `generate_manifest`. Without the following two flags, the # `gen_kernel` step will produce one large `.dil` file, instead of multiple diff --git a/engine/src/flutter/tools/fuchsia/flutter/flutter_component.gni b/engine/src/flutter/tools/fuchsia/flutter/flutter_component.gni index 3e43e1634a..a2393f6499 100644 --- a/engine/src/flutter/tools/fuchsia/flutter/flutter_component.gni +++ b/engine/src/flutter/tools/fuchsia/flutter/flutter_component.gni @@ -84,6 +84,9 @@ import("//flutter/tools/fuchsia/flutter/internal/flutter_dart_component.gni") # Specifies the parameters for building the component. # See //flutter/tools/fuchsia/flutter/flutter_build_config.gni for predefined configs. # +# sound_null_safety (optional) +# Whether to generate sound null safe Dart kernel. +# # deps # testonly # visibility diff --git a/engine/src/flutter/tools/fuchsia/flutter/internal/flutter_dart_component.gni b/engine/src/flutter/tools/fuchsia/flutter/internal/flutter_dart_component.gni index 49529d23c0..35e616a0ce 100644 --- a/engine/src/flutter/tools/fuchsia/flutter/internal/flutter_dart_component.gni +++ b/engine/src/flutter/tools/fuchsia/flutter/internal/flutter_dart_component.gni @@ -48,6 +48,9 @@ import("//flutter/tools/fuchsia/gn-sdk/component.gni") # Type: boolean # Default: false # +# sound_null_safety (optional) +# If true, generate sound null safe Dart kernel. +# # deps # testonly # visibility @@ -144,6 +147,7 @@ template("flutter_dart_component") { "visibility", "main_dart", "main_package", + "sound_null_safety", ]) deps = [ ":$_dart_package_config_target_name" ]