Skip to content

Revert: [tool][engine] Enable experimental VM service by default - #197481

Merged
cbracken merged 1 commit into
flutter:masterfrom
flutteractionsbot:revert-190100-1795730279
Nov 26, 2026
Merged

cbracken merged 1 commit into
flutter:masterfrom
flutteractionsbot:revert-190100-1795730279

Conversation

@flutteractionsbot

Copy link
Copy Markdown
Contributor

Reverts: [tool][engine] Enable experimental VM service by default

Initiated by: @cbracken

Reason for reverting: Windows bots all failing https://ci.chromium.org/ui/p/flutter/builders/prod/Windows%20flutter_gallery_win_desktop__start_up/24708/overview

Original PR Author: @bkonyi

Reviewed By: @jyameo

The original PR description is provided below:

This change enables the new modular VM service (pkg/dart_runtime_service_vm) by default across the engine and flutter_tools, transitioning its build and packaging to align with the app's execution mode:

  • Debug (JIT): The VM service is built and delivered as a kernel snapshot (vmservice_snapshot.dill).
  • Profile (AOT): The VM service is built and delivered as a native shared library (libvmservice_snapshot.so on Android/Linux, libvmservice_snapshot.dll on Windows) or framework (VMService.framework on iOS/macOS).

Engine changes:

  • Updates GN build rules across Android, iOS, macOS, Windows, Linux, and Fuchsia to compile and package the VM service snapshots (vmservice_snapshot.dill in debug mode, and VMService.framework or libvmservice_snapshot in profile mode).
  • Updates dart_isolate.cc and dart_service_isolate.cc to boot the VM service directly from its entrypoint root library without dart:vmservice_io lookups.
  • Extracts kernel path probing into DartIsolate::ResolveVMServiceKernel.

Tool changes:

  • Updates build targets (DebugIosApplicationBundle, ProfileIosApplicationBundle, DebugMacOSBundleFlutterAssets, ProfileMacOSBundleFlutterAssets, UnpackLinux, UnpackWindows) to bundle vmservice_snapshot.dill in debug mode and VMService.framework / libvmservice_snapshot in profile mode.
  • Transitions artifact resolution (Artifact.vmserviceFramework and Artifact.vmserviceKernelDill) to support cross-compilation bundling.

Testing

  • Engine: dart_isolate_unittests.cc (CanCreateServiceIsolate, CanResolveVMServiceKernel) validates C++ service isolate bootstrap and kernel resolution.
  • Flutter Tools: Unit tests in packages/flutter_tools/test/general.shard/build_system/targets/*_test.dart verify snapshot bundling for debug and profile across Android, iOS, macOS, Linux, and Windows; xcode_backend_test.dart verifies nested codesigning.
  • E2E / Integration: Existing integration tests, driver tests, and devicelab runs rely on flutter run / flutter attach connecting to the VM service to drive the application on real devices and emulators.

Fixes #191966

@flutteractionsbot
flutteractionsbot requested review from a team as code owners November 26, 2026 21:58
@flutteractionsbot
flutteractionsbot requested review from okorohelijah and removed request for a team November 26, 2026 21:58
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Nov 26, 2026
@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests platform-android Android applications specifically platform-ios iOS applications specifically tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. platform-macos Building on or for macOS specifically platform-fuchsia Fuchsia code specifically platform-windows Building on or for Windows specifically platform-linux Building on or for Linux specifically a: desktop Running on desktop f: integration_test The flutter/packages/integration_test plugin team-android Owned by Android platform team team-ios Owned by iOS platform team team-macos Owned by the macOS platform team team-windows Owned by the Windows platform team team-linux Owned by the Linux platform team labels Nov 26, 2026
@cbracken cbracken added the emergency Jump the queue; land PR in front of all others; only use for emergencies label Nov 26, 2026
@flutter-dashboard

Copy link
Copy Markdown

Detected the emergency label.

If you add the autosubmit label, the bot will wait until all presubmits pass but ignore the tree status, allowing fixes for tree breakages while still validating that they don't break any existing presubmits.

The "Merge" button is also unlocked. To bypass presubmits as well as the tree status, press the GitHub "Add to Merge Queue".

@cbracken
cbracken added this pull request to the merge queue Nov 26, 2026
Merged via the queue into flutter:master with commit ba17b71 Nov 26, 2026
19 of 22 checks passed
@flutteractionsbot
flutteractionsbot deleted the revert-190100-1795730279 branch November 26, 2026 22:30
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Nov 27, 2026
flutter/flutter@82ec424...43150a8

2026-11-27 [email protected] Windows: fix for popup descendent of popup closing the whole tree when the 2nd popup gains focus (flutter/flutter#196911)
2026-11-27 [email protected] Roll Skia from d693d85a4b77 to fe34f20b9689 (1 revision) (flutter/flutter#197491)
2026-11-27 [email protected] Roll Dart SDK from 691817e0ec3b to 5c3e102fc422 (1 revision) (flutter/flutter#197489)
2026-11-27 [email protected] Roll Fuchsia Linux SDK from 0bgCrr76CM4IqPO0v... to cBAjguERWwvY6tFtz... (flutter/flutter#197488)
2026-11-27 [email protected] [flutter_tools] Delete AppContext and legacy test context shims (flutter/flutter#197412)
2026-11-26 [email protected] Revert: [tool][engine] Enable experimental VM service by default (flutter/flutter#197481)
2026-11-26 [email protected] iOS: Remove engine includes from the platform views controller headers (flutter/flutter#197429)
2026-11-26 [email protected] [tool][engine] Enable experimental VM service by default (flutter/flutter#190100)
2026-11-26 [email protected] Add trust gate flags for "flutter analyze" (flutter/flutter#196415)
2026-11-26 [email protected] Roll Dart SDK from 7fcaf46b0308 to 691817e0ec3b (1 revision) (flutter/flutter#197475)
2026-11-26 [email protected] [Windows] Fix MASM flags in Windows GN `tool("asm")` (flutter/flutter#197464)
2026-11-26 [email protected] Roll Skia from cef5963c1bb2 to d693d85a4b77 (2 revisions) (flutter/flutter#197469)
2026-11-26 [email protected] Roll Packages from 105a874 to da586f5 (3 revisions) (flutter/flutter#197471)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-flutter__flutter that referenced this pull request Nov 27, 2026
…ter#197483)

Relands [flutter#190100](flutter#190100)
(reverted in [flutter#197481](flutter#197481))
with a fix for Windows and Linux desktop profile-mode bundling on
existing projects.

### Root cause
[flutter#190100](flutter#190100) added the
`install(FILES ... libvmservice_snapshot.{dll,so} ...)` rule only to the
new-project `CMakeLists.txt.tmpl` templates. Existing Windows and Linux
apps (including DeviceLab apps such as `flutter_gallery` and
`flutter_view`) have checked-in `CMakeLists.txt` files without that
rule, so `UnpackWindows`/`UnpackLinux` unpacked the library into
`flutter/ephemeral/`, but CMake `INSTALL` never copied it to the app
bundle. At startup, `DartVMData::GetServiceIsolateSnapshot()` fell back
to the app snapshot and failed in `DartServiceIsolate::Startup`. The
template rule also omitted `CONFIGURATIONS Profile`, risking stale
bundling into subsequent Release builds.

### Fix
- Emit the `install(FILES ...)` rule in `writeGeneratedCmakeConfig`
(`packages/flutter_tools/lib/src/cmake.dart`) for `WindowsProject`
(`data/libvmservice_snapshot.dll`) and `LinuxProject`
(`lib/libvmservice_snapshot.so`) with `CONFIGURATIONS Profile`,
`COMPONENT Runtime`, and `OPTIONAL`.
- On CMake 3.19+, defer the `install()` call to `${PROJECT_SOURCE_DIR}`
via `cmake_language(DEFER ...)` so it runs after parent bundle cleanup
rules (such as Linux `file(REMOVE_RECURSE ...)` when
`cmake_minimum_required` is 3.14+ / `CMP0082` NEW).
- Revert the `CMakeLists.txt.tmpl` changes from
[flutter#190100](flutter#190100).
- Add unit tests in
`packages/flutter_tools/test/general.shard/cmake_test.dart` and
integration tests in
`packages/flutter_tools/test/integration.shard/flutter_build_windows_test.dart`
and
`packages/flutter_tools/test/integration.shard/flutter_build_linux_test.dart`
(covering profile bundling, release exclusion, and CMake 3.14 ordering).

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=/
```

Fixes flutter#191966
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: desktop Running on desktop a: tests "flutter test", flutter_test, or one of our tests CICD Run CI/CD emergency Jump the queue; land PR in front of all others; only use for emergencies engine flutter/engine related. See also e: labels. f: integration_test The flutter/packages/integration_test plugin framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically platform-fuchsia Fuchsia code specifically platform-ios iOS applications specifically platform-linux Building on or for Linux specifically platform-macos Building on or for macOS specifically platform-windows Building on or for Windows specifically team-android Owned by Android platform team team-ios Owned by iOS platform team team-linux Owned by the Linux platform team team-macos Owned by the macOS platform team team-windows Owned by the Windows platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[engine] Enable new modular VM service (dart_runtime_service_vm) by default

3 participants