Repository navigation
Reland [tool][engine] Enable experimental VM service by default - #197483
Merged
auto-submit[bot] merged 3 commits intoNov 27, 2026
Merged
auto-submit[bot] merged 3 commits into
auto-submit[bot] merged 3 commits into
Conversation
…ult (flutter#197481)" This reverts commit ba17b71.
Move the Windows (`libvmservice_snapshot.dll`) and Linux
(`libvmservice_snapshot.so`) profile-mode VM service install rules from
the app `CMakeLists.txt.tmpl` templates into `generated_config.cmake`
generated by `writeGeneratedCmakeConfig`.
Existing Windows and Linux projects (including DeviceLab apps such as
`flutter_gallery` and `flutter_view`) have checked-in `CMakeLists.txt`
files that did not receive the template install rule, causing profile
builds to omit `libvmservice_snapshot.{dll,so}` and fail at startup when
`DartVMData::GetServiceIsolateSnapshot()` fell back to the app snapshot.
The previous template rule also lacked `CONFIGURATIONS Profile`, which
risked bundling a stale snapshot library into subsequent Release builds.
On CMake 3.19+, defer the `install()` call to the end of
`${PROJECT_SOURCE_DIR}` via `cmake_language(DEFER ...)` so it runs after
parent bundle cleanup rules (such as Linux `file(REMOVE_RECURSE ...)`
under `CMP0082` NEW).
Previous output:
```
[IMPORTANT:flutter/shell/platform/embedder/embedder_surface_gl_impeller.cc(127)] Using the Impeller rendering backend (OpenGLESSDF).
[ERROR:flutter/runtime/dart_isolate.cc(1095)] DartServiceIsolate::Startup failed: Unhandled exception:
NoSuchMethodError: No top-level setter '_ip=' declared.
Receiver: top-level
Tried calling: _ip="127.0.0.1"
#0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:174)
```
Current output:
```
[IMPORTANT:flutter/shell/platform/embedder/embedder_surface_gl_impeller.cc(127)] Using the Impeller rendering backend (OpenGLESSDF).
The Dart VM service is listening on http://127.0.0.1:45591/3O4DhxOyHcE=/
```
bkonyi
marked this pull request as ready for review
November 26, 2026 23:25
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Flutter engine and tools to package and load the Dart VM Service snapshot across all platforms. In debug mode, the VM service is bundled as a kernel snapshot (vmservice_snapshot.dill), while in profile mode, it is packaged as a precompiled AOT library (such as VMService.framework on iOS and macOS, or shared libraries on Windows and Linux). The build systems, including GN, CMake, and Xcode backend scripts, are updated to handle, thin, codesign, and install these new artifacts. Feedback on the changes suggests refactoring the path resolution in macos.dart to use the more idiomatic childDirectory and childFile APIs instead of manual path joining.
- Use `childDirectory`/`childFile` in `UnpackMacOSVmService.build` in `packages/flutter_tools/lib/src/build_system/targets/macos.dart`, matching `UnpackIosVmService`. - Add `test/integration.shard/flutter_build_linux_test.dart` entries to `dev/bots/tool_test_durations.json` (`linux`: 56, `macos`: 0, `windows`: 0) to satisfy `tool_test_durations_test.dart`.
jyameo
approved these changes
Nov 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relands #190100 (reverted in #197481) with a fix for Windows and Linux desktop profile-mode bundling on existing projects.
Root cause
#190100 added the
install(FILES ... libvmservice_snapshot.{dll,so} ...)rule only to the new-projectCMakeLists.txt.tmpltemplates. Existing Windows and Linux apps (including DeviceLab apps such asflutter_galleryandflutter_view) have checked-inCMakeLists.txtfiles without that rule, soUnpackWindows/UnpackLinuxunpacked the library intoflutter/ephemeral/, but CMakeINSTALLnever copied it to the app bundle. At startup,DartVMData::GetServiceIsolateSnapshot()fell back to the app snapshot and failed inDartServiceIsolate::Startup. The template rule also omittedCONFIGURATIONS Profile, risking stale bundling into subsequent Release builds.Fix
install(FILES ...)rule inwriteGeneratedCmakeConfig(packages/flutter_tools/lib/src/cmake.dart) forWindowsProject(data/libvmservice_snapshot.dll) andLinuxProject(lib/libvmservice_snapshot.so) withCONFIGURATIONS Profile,COMPONENT Runtime, andOPTIONAL.install()call to${PROJECT_SOURCE_DIR}viacmake_language(DEFER ...)so it runs after parent bundle cleanup rules (such as Linuxfile(REMOVE_RECURSE ...)whencmake_minimum_requiredis 3.14+ /CMP0082NEW).CMakeLists.txt.tmplchanges from #190100.packages/flutter_tools/test/general.shard/cmake_test.dartand integration tests inpackages/flutter_tools/test/integration.shard/flutter_build_windows_test.dartandpackages/flutter_tools/test/integration.shard/flutter_build_linux_test.dart(covering profile bundling, release exclusion, and CMake 3.14 ordering).Previous output:
Current output:
Fixes #191966