diff --git a/utils/kernel-service/BUILD.gn b/utils/kernel-service/BUILD.gn index 86326ad1f28..c437931ac77 100644 --- a/utils/kernel-service/BUILD.gn +++ b/utils/kernel-service/BUILD.gn @@ -67,6 +67,13 @@ aot_snapshot("frontend_server_aot") { main_dart = "../../pkg/frontend_server/bin/frontend_server_starter.dart" name = "frontend_server_aot" output = "$root_out_dir/frontend_server_aot.dart.snapshot" + + # dartaotruntime has dart_product_config applied to it, so it is built in + # product mode in both release and product builds, and is only built in debug + # mode in debug builds. The following line ensures that the dartaotruntime and + # frontend_server_aot snapshot in an SDK build are always compatible with + # each other. + force_product_mode = !dart_debug } template("kernel_service_dill") {