From 58c7fb250dad210baab0bc9644a87ff995828daa Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Mon, 5 Jan 2026 15:43:26 -0800 Subject: [PATCH 1/3] Fix `dt serve` command as part of the release process --- pubspec.lock | 4 ++-- tool/RELEASE_INSTRUCTIONS.md | 34 +++++++++++++++++++++++++++++----- tool/lib/commands/run.dart | 2 +- tool/lib/commands/serve.dart | 16 ++++++++-------- tool/lib/commands/shared.dart | 6 +++--- 5 files changed, 43 insertions(+), 19 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index c6ab1cdb244..7127d25f17d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" checked_yaml: dependency: transitive description: diff --git a/tool/RELEASE_INSTRUCTIONS.md b/tool/RELEASE_INSTRUCTIONS.md index 7a3de257ae0..1856a7ae465 100644 --- a/tool/RELEASE_INSTRUCTIONS.md +++ b/tool/RELEASE_INSTRUCTIONS.md @@ -127,13 +127,37 @@ version bumps. ### 3) Test the release PR -1. Build DevTools in release mode and serve it from a locally running DevTools -server instance: +1. Build the Dart SDK locally + + ```shell + cd $LOCAL_DART_SDK && \ + gclient sync -D && \ + ./tools/build.py -mrelease create_sdk; + ``` + +2. Copy the newly-built Dart executable path. + - for Macs with ARM-based processors (M chips): + ```shell + xcodebuild/ReleaseARM64/dart-sdk/bin/dart devtools + ``` + - for Macs with x64-based processors (Intel chips): + ```shell + xcodebuild/ReleaseX64/dart-sdk/bin/dart devtools + ``` + + - For non-Macs: + ```shell + out/ReleaseX64/dart-sdk/bin/dart devtools + ``` + +3. Build DevTools in release mode and serve it from a locally running DevTools +server instance using the executable path you just copied, e.g.: + ```shell - dt serve + dt serve --dart-sdk-override=$LOCAL_DART_SDK/xcodebuild/ReleaseARM64/dart-sdk/bin/dart ``` -2. Launch DevTools and verify that everything generally works. +4. Launch DevTools and verify that everything generally works. - open the page in a browser (http://localhost:53432) - `flutter run` an application - connect to the running app from DevTools @@ -147,7 +171,7 @@ server instance: - the bug fixes, - use this commit hash for the following steps. -3. Once the build is in good shape, +5. Once the build is in good shape, - revert any local changes. ```shell git checkout . && \ diff --git a/tool/lib/commands/run.dart b/tool/lib/commands/run.dart index 4183865a2ae..0d368d78f9d 100644 --- a/tool/lib/commands/run.dart +++ b/tool/lib/commands/run.dart @@ -17,7 +17,7 @@ class RunCommand extends Command { RunCommand() { argParser ..addDebugServerFlag() - ..addServeWithSdkOption(); + ..addDartSdkOverrideOption(); } @override diff --git a/tool/lib/commands/serve.dart b/tool/lib/commands/serve.dart index 722229c36f3..959e2680f8a 100644 --- a/tool/lib/commands/serve.dart +++ b/tool/lib/commands/serve.dart @@ -86,7 +86,7 @@ class ServeCommand extends Command { ' directly from the DevTools server.', ) ..addDebugServerFlag() - ..addServeWithSdkOption() + ..addDartSdkOverrideOption() ..addUpdateFlutterFlag() ..addUpdatePerfettoFlag() ..addPubGetFlag() @@ -154,12 +154,13 @@ class ServeCommand extends Command { results[SharedCommandArgs.updatePerfetto.flagName] as bool; final useWasm = results[SharedCommandArgs.wasm.flagName] as bool; final noStripWasm = results[SharedCommandArgs.noStripWasm.flagName] as bool; - final noMinifyWasm = results[SharedCommandArgs.noMinifyWasm.flagName] as bool; + final noMinifyWasm = + results[SharedCommandArgs.noMinifyWasm.flagName] as bool; final runPubGet = results[SharedCommandArgs.pubGet.flagName] as bool; final devToolsAppBuildMode = results[SharedCommandArgs.buildMode.flagName] as String; - final serveWithDartSdk = - results[SharedCommandArgs.serveWithDartSdk.flagName] as String?; + final dartSdkOverride = + results[SharedCommandArgs.dartSdkOverride.flagName] as String?; final forMachine = results[_machineFlag] as bool; // TODO(https://github.com/flutter/devtools/issues/8643): Support running in @@ -193,7 +194,7 @@ class ServeCommand extends Command { ) ..removeWhere( (element) => element.startsWith( - valueAsArg(SharedCommandArgs.serveWithDartSdk.flagName), + valueAsArg(SharedCommandArgs.dartSdkOverride.flagName), ), ); @@ -240,10 +241,9 @@ class ServeCommand extends Command { } logStatus('completed building DevTools: $devToolsBuildLocation'); } - logStatus('running pub get for DDS in the local dart sdk'); await processManager.runProcess( - CliCommand.dart(['pub', 'get']), + CliCommand.dart(['pub', 'get'], sdkOverride: dartSdkOverride), workingDirectory: path.join(localDartSdkLocation, 'pkg', 'dds'), ); @@ -304,7 +304,7 @@ class ServeCommand extends Command { // to pass `--machine` (etc.) so that this script can behave the same as // the "dart devtools" command for testing local DevTools/server changes. ...remainingArguments, - ], sdkOverride: serveWithDartSdk); + ], sdkOverride: dartSdkOverride); if (forMachine) { // If --machine flag is true, then the output is a tool-readable JSON. // Therefore, skip reading the process output and instead just run the diff --git a/tool/lib/commands/shared.dart b/tool/lib/commands/shared.dart index b353d1caa33..ccfb5fb2f59 100644 --- a/tool/lib/commands/shared.dart +++ b/tool/lib/commands/shared.dart @@ -104,9 +104,9 @@ extension BuildCommandArgsExtension on ArgParser { ); } - void addServeWithSdkOption() { + void addDartSdkOverrideOption() { addOption( - SharedCommandArgs.serveWithDartSdk.flagName, + SharedCommandArgs.dartSdkOverride.flagName, help: 'Uses the specified Dart SDK to serve the DevTools server', valueHelp: '/Users/me/absolute_path_to/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart', @@ -122,7 +122,7 @@ enum SharedCommandArgs { noStripWasm('no-strip-wasm'), noMinifyWasm('no-minify-wasm'), runApp('run-app'), - serveWithDartSdk('serve-with-dart-sdk'), + dartSdkOverride('dart-sdk-override'), updateFlutter('update-flutter'), updateOnPath('update-on-path'), updatePerfetto('update-perfetto'); From e7ad66ab06cd9626f7108858b602b0d81f6eb013 Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Tue, 13 Jan 2026 10:28:43 -0800 Subject: [PATCH 2/3] Revert "Fix `dt serve` command as part of the release process" This reverts commit 58c7fb250dad210baab0bc9644a87ff995828daa. --- pubspec.lock | 4 ++-- tool/RELEASE_INSTRUCTIONS.md | 34 +++++----------------------------- tool/lib/commands/run.dart | 2 +- tool/lib/commands/serve.dart | 16 ++++++++-------- tool/lib/commands/shared.dart | 6 +++--- 5 files changed, 19 insertions(+), 43 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 7127d25f17d..c6ab1cdb244 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -109,10 +109,10 @@ packages: dependency: transitive description: name: characters - sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b + sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 url: "https://pub.dev" source: hosted - version: "1.4.1" + version: "1.4.0" checked_yaml: dependency: transitive description: diff --git a/tool/RELEASE_INSTRUCTIONS.md b/tool/RELEASE_INSTRUCTIONS.md index 1856a7ae465..7a3de257ae0 100644 --- a/tool/RELEASE_INSTRUCTIONS.md +++ b/tool/RELEASE_INSTRUCTIONS.md @@ -127,37 +127,13 @@ version bumps. ### 3) Test the release PR -1. Build the Dart SDK locally - - ```shell - cd $LOCAL_DART_SDK && \ - gclient sync -D && \ - ./tools/build.py -mrelease create_sdk; - ``` - -2. Copy the newly-built Dart executable path. - - for Macs with ARM-based processors (M chips): - ```shell - xcodebuild/ReleaseARM64/dart-sdk/bin/dart devtools - ``` - - for Macs with x64-based processors (Intel chips): - ```shell - xcodebuild/ReleaseX64/dart-sdk/bin/dart devtools - ``` - - - For non-Macs: - ```shell - out/ReleaseX64/dart-sdk/bin/dart devtools - ``` - -3. Build DevTools in release mode and serve it from a locally running DevTools -server instance using the executable path you just copied, e.g.: - +1. Build DevTools in release mode and serve it from a locally running DevTools +server instance: ```shell - dt serve --dart-sdk-override=$LOCAL_DART_SDK/xcodebuild/ReleaseARM64/dart-sdk/bin/dart + dt serve ``` -4. Launch DevTools and verify that everything generally works. +2. Launch DevTools and verify that everything generally works. - open the page in a browser (http://localhost:53432) - `flutter run` an application - connect to the running app from DevTools @@ -171,7 +147,7 @@ server instance using the executable path you just copied, e.g.: - the bug fixes, - use this commit hash for the following steps. -5. Once the build is in good shape, +3. Once the build is in good shape, - revert any local changes. ```shell git checkout . && \ diff --git a/tool/lib/commands/run.dart b/tool/lib/commands/run.dart index 0d368d78f9d..4183865a2ae 100644 --- a/tool/lib/commands/run.dart +++ b/tool/lib/commands/run.dart @@ -17,7 +17,7 @@ class RunCommand extends Command { RunCommand() { argParser ..addDebugServerFlag() - ..addDartSdkOverrideOption(); + ..addServeWithSdkOption(); } @override diff --git a/tool/lib/commands/serve.dart b/tool/lib/commands/serve.dart index 959e2680f8a..722229c36f3 100644 --- a/tool/lib/commands/serve.dart +++ b/tool/lib/commands/serve.dart @@ -86,7 +86,7 @@ class ServeCommand extends Command { ' directly from the DevTools server.', ) ..addDebugServerFlag() - ..addDartSdkOverrideOption() + ..addServeWithSdkOption() ..addUpdateFlutterFlag() ..addUpdatePerfettoFlag() ..addPubGetFlag() @@ -154,13 +154,12 @@ class ServeCommand extends Command { results[SharedCommandArgs.updatePerfetto.flagName] as bool; final useWasm = results[SharedCommandArgs.wasm.flagName] as bool; final noStripWasm = results[SharedCommandArgs.noStripWasm.flagName] as bool; - final noMinifyWasm = - results[SharedCommandArgs.noMinifyWasm.flagName] as bool; + final noMinifyWasm = results[SharedCommandArgs.noMinifyWasm.flagName] as bool; final runPubGet = results[SharedCommandArgs.pubGet.flagName] as bool; final devToolsAppBuildMode = results[SharedCommandArgs.buildMode.flagName] as String; - final dartSdkOverride = - results[SharedCommandArgs.dartSdkOverride.flagName] as String?; + final serveWithDartSdk = + results[SharedCommandArgs.serveWithDartSdk.flagName] as String?; final forMachine = results[_machineFlag] as bool; // TODO(https://github.com/flutter/devtools/issues/8643): Support running in @@ -194,7 +193,7 @@ class ServeCommand extends Command { ) ..removeWhere( (element) => element.startsWith( - valueAsArg(SharedCommandArgs.dartSdkOverride.flagName), + valueAsArg(SharedCommandArgs.serveWithDartSdk.flagName), ), ); @@ -241,9 +240,10 @@ class ServeCommand extends Command { } logStatus('completed building DevTools: $devToolsBuildLocation'); } + logStatus('running pub get for DDS in the local dart sdk'); await processManager.runProcess( - CliCommand.dart(['pub', 'get'], sdkOverride: dartSdkOverride), + CliCommand.dart(['pub', 'get']), workingDirectory: path.join(localDartSdkLocation, 'pkg', 'dds'), ); @@ -304,7 +304,7 @@ class ServeCommand extends Command { // to pass `--machine` (etc.) so that this script can behave the same as // the "dart devtools" command for testing local DevTools/server changes. ...remainingArguments, - ], sdkOverride: dartSdkOverride); + ], sdkOverride: serveWithDartSdk); if (forMachine) { // If --machine flag is true, then the output is a tool-readable JSON. // Therefore, skip reading the process output and instead just run the diff --git a/tool/lib/commands/shared.dart b/tool/lib/commands/shared.dart index ccfb5fb2f59..b353d1caa33 100644 --- a/tool/lib/commands/shared.dart +++ b/tool/lib/commands/shared.dart @@ -104,9 +104,9 @@ extension BuildCommandArgsExtension on ArgParser { ); } - void addDartSdkOverrideOption() { + void addServeWithSdkOption() { addOption( - SharedCommandArgs.dartSdkOverride.flagName, + SharedCommandArgs.serveWithDartSdk.flagName, help: 'Uses the specified Dart SDK to serve the DevTools server', valueHelp: '/Users/me/absolute_path_to/sdk/xcodebuild/ReleaseX64/dart-sdk/bin/dart', @@ -122,7 +122,7 @@ enum SharedCommandArgs { noStripWasm('no-strip-wasm'), noMinifyWasm('no-minify-wasm'), runApp('run-app'), - dartSdkOverride('dart-sdk-override'), + serveWithDartSdk('serve-with-dart-sdk'), updateFlutter('update-flutter'), updateOnPath('update-on-path'), updatePerfetto('update-perfetto'); From 838abe931efe61f4b732b908c2931428b3b4861d Mon Sep 17 00:00:00 2001 From: Elliott Brooks <21270878+elliette@users.noreply.github.com> Date: Tue, 13 Jan 2026 10:31:03 -0800 Subject: [PATCH 3/3] Actually use gclient sync instead of running pub get in the SDK --- tool/lib/commands/serve.dart | 9 +++++---- tool/lib/utils.dart | 8 ++++++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tool/lib/commands/serve.dart b/tool/lib/commands/serve.dart index 722229c36f3..6e3243efe82 100644 --- a/tool/lib/commands/serve.dart +++ b/tool/lib/commands/serve.dart @@ -154,7 +154,8 @@ class ServeCommand extends Command { results[SharedCommandArgs.updatePerfetto.flagName] as bool; final useWasm = results[SharedCommandArgs.wasm.flagName] as bool; final noStripWasm = results[SharedCommandArgs.noStripWasm.flagName] as bool; - final noMinifyWasm = results[SharedCommandArgs.noMinifyWasm.flagName] as bool; + final noMinifyWasm = + results[SharedCommandArgs.noMinifyWasm.flagName] as bool; final runPubGet = results[SharedCommandArgs.pubGet.flagName] as bool; final devToolsAppBuildMode = results[SharedCommandArgs.buildMode.flagName] as String; @@ -241,10 +242,10 @@ class ServeCommand extends Command { logStatus('completed building DevTools: $devToolsBuildLocation'); } - logStatus('running pub get for DDS in the local dart sdk'); + logStatus('running gclient sync in the local dart sdk'); await processManager.runProcess( - CliCommand.dart(['pub', 'get']), - workingDirectory: path.join(localDartSdkLocation, 'pkg', 'dds'), + CliCommand.gclient(['sync']), + workingDirectory: localDartSdkLocation, ); logStatus('serving DevTools with a local devtools server...'); diff --git a/tool/lib/utils.dart b/tool/lib/utils.dart index e0c15a8f07c..467bea8665c 100644 --- a/tool/lib/utils.dart +++ b/tool/lib/utils.dart @@ -81,6 +81,14 @@ class CliCommand { return CliCommand('git', args, throwOnException: throwOnException); } + /// CliCommand helper for running gclient commands. + factory CliCommand.gclient( + List args, { + bool throwOnException = true, + }) { + return CliCommand('gclient', args, throwOnException: throwOnException); + } + factory CliCommand.tool(List args, {bool throwOnException = true}) { var toolPath = Platform.script.toFilePath(); if (!File(toolPath).existsSync()) {