Andrew Kolos 268cd08ffd
[CP-stable] Bump package:dds from version 4.2.4+1 to 4.2.4+2 (#155789)
CP Issue: https://github.com/flutter/flutter/issues/155837

Hopefully resolves the majority of the remaining `RPCError` crashes occurring on stable (context: https://github.com/flutter/flutter/issues/153471).

## Context and what is happening here
1. flutter_tools on the stable channel depends on package:dds@4.2.4+1
2. package:dds has a fix for these type of crashes, but was landed in [package:dds@4.2.6](212e49fda6)
3. I've created and published a 4.2.4+2 version of package:dds that patches the 4.2.6 fix into 4.2.4+1.
4. This PR makes flutter_tools depend on this new 4.2.4+2 version.

## Verifying this change

Unfortunately, I have not found a way to reproduce this particular crash (neither organically or inorganically through code modification). I am still decently confident this will fix any of the crashes (from https://github.com/flutter/flutter/issues/153471) that include `_withErrorHandling` in their stack trace.

However, we can at least be confident that this shouldn't _break_ anything new. The code change is very small.

The easiest way to check what code is being changed here is to `git diff` the version of package:dds we are bumping from and the one we are bumping to: `git diff /Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/ /Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2`. While I accidentally chose the incorrect base commit when creating 4.2.4+2, the dart code changes should still be minimal:

<details>

<summary>full diff (your IDE probably has a "diff" language mode to make this human-readable)</summary>

<pre>
diff --git a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/CHANGELOG.md b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/CHANGELOG.md
index a515f931cc..72cd187fbc 100644
--- a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/CHANGELOG.md
+++ b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 4.2.4+2
+- [DAP] Fixed an issue where "Service connection disposed" errors may go unhandled during termination/shutdown.Uint8List` from `dart:typed_data`.
+- Added `package:dds/dds_launcher.dart`, a library which can be used to launch DDS instances using `dart development-service`.
+
 # 4.2.4+1
 - Added missing type to `Event` in `postEvent`.
 - [DAP] Instaces with both fields and getters of the same name will no longer show duplicates in `variables` responses.
@@ -310,8 +314,8 @@ Hot-fix release of changes in 3.1.2 without the changes in 3.1.1
 # 1.7.0
 - Added `package:dds/vm_service_extensions.dart`, which adds DDS functionality to
   `package:vm_service` when imported.
-  - Added `onEventWithHistory` method and `onLoggingEventWithHistory`, 
-    `onStdoutEventWithHistory`, `onStderrEventWithHistory`, and 
+  - Added `onEventWithHistory` method and `onLoggingEventWithHistory`,
+    `onStdoutEventWithHistory`, `onStderrEventWithHistory`, and
     `onExtensionEventWithHistory` getters.
 - Added `getStreamHistory` RPC.
 
diff --git a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/CONTRIBUTING.md b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/CONTRIBUTING.md
index ddad214772..de7603b2f2 100644
--- a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/CONTRIBUTING.md
+++ b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/CONTRIBUTING.md
@@ -22,6 +22,14 @@ Then you can call `_fileLog('some print debugging message')`, and the log messag
 
 To get logging output in real time, run `tail -f /tmp/dds.log`.
 
+## Running DDS tests
+
+From the `$DART_SDK_ROOT` directory, run:
+
+```shell
+ dart --packages=.dart_tool/package_config.json pkg/dds/test/path/to/your_test.dart
+```
+
 ## Making changes to `package:dds` and `package:devtools_shared`
 
 **If you do not need to build the Dart SDK** to test your changes, you
@@ -38,7 +46,7 @@ dependency_overrides:
 to adding the dependency override above, you will need to add a symbolic link
 to your local `devtools_shared` directory:
 
-From the `sdk/` directory, run:
+From the `$DART_SDK_ROOT` directory, run:
 ```shell
 rm -rf third_party/devtools/devtools_shared;
 ln -s /absolute_path_to/devtools/packages/devtools_shared third_party/devtools/devtools_shared
@@ -51,3 +59,42 @@ To delete the symbolic link after you are done with development, run:
 ```shell
 rm -rf third_party/devtools/devtools_shared
 ```
+
+## Making changes to `package:dds` and `devtools_app`
+
+To test any changes made in `devtools_app`, you will need to first build DevTools.
+
+- If you have not already, make sure to [set-up your DevTools development environment](https://github.com/flutter/devtools/blob/master/CONTRIBUTING.md#set-up-your-devtools-environment) so that you can use the `devtools_tool` command.
+
+- Then build DevTools with `devtools_tool build`.
+
+In the SDK, add a symbolic link to your local `devtools/packages/devtools_app/build/web` directory.
+
+From the `$DART_SDK_ROOT` directory, run:
+
+```shell
+rm -rf third_party/devtools/web;
+ln -s /absolute_path_to/devtools/devtools/packages/devtools_app/build/web third_party/devtools/web
+```
+
+**WARNING**: do not run `gclient sync -D` while the symbolic link is present,
+as this could cause issues with your local `devtools_app` code.
+
+Then, build the Dart SDK.
+
+From the `$DART_SDK_ROOT` directory, run:
+
+```shell
+./tools/build.py -mrelease -ax64 create_sdk
+```
+
+To delete the symbolic link after you are done with development, run:
+
+**WARNING**: do not run `gclient sync -D` while the symbolic link is present,
+as this could cause issues with your local `devtools_app` code.
+
+```shell
+rm -rf third_party/devtools/web
+```
+
+Then, run `gclient sync` to pull down the checked in version of DevTools.
diff --git a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/lib/src/dap/adapters/dart.dart b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/lib/src/dap/adapters/dart.dart
index 51228f24be..1a0a1f6287 100644
--- a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/lib/src/dap/adapters/dart.dart
+++ b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/lib/src/dap/adapters/dart.dart
@@ -2845,7 +2845,8 @@ abstract class DartDebugAdapter<TL extends LaunchRequestArguments,
         // errors because these can always occur during shutdown if we were
         // just starting to send (or had just sent) a request.
         if (e.message.contains("The client is closed") ||
-            e.message.contains("The client closed with pending request")) {
+            e.message.contains("The client closed with pending request") ||
+            e.message.contains("Service connection disposed")) {
           return null;
         }
       }
diff --git a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/lib/src/dds_cli_entrypoint.dart b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/lib/src/dds_cli_entrypoint.dart
index 1680cba55c..8546707a5e 100644
--- a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/lib/src/dds_cli_entrypoint.dart
+++ b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/lib/src/dds_cli_entrypoint.dart
@@ -129,7 +129,6 @@ ${argParser.usage}
           'uri': dtdInfo.uri,
         },
     }));
-    stderr.close();
   } catch (e, st) {
     writeErrorResponse(e, st);
   } finally {
diff --git a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/pubspec.yaml b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/pubspec.yaml
index c159257a1a..e136322d54 100644
--- a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/pubspec.yaml
+++ b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/pubspec.yaml
@@ -1,5 +1,5 @@
 name: dds
-version: 4.2.4+1
+version: 4.2.4+2
 description: >-
   A library used to spawn the Dart Developer Service, used to communicate with
   a Dart VM Service instance.

</pre>

</details>

You might have notice this extraneous change in particular:

```diff
diff --git a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/lib/src/dds_cli_entrypoint.dart b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/lib/src/dds_cli_entrypoint.dart
index 1680cba55c..8546707a5e 100644
--- a/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+1/lib/src/dds_cli_entrypoint.dart
+++ b/Users/andrewkolos/.pub-cache/hosted/pub.dev/dds-4.2.4+2/lib/src/dds_cli_entrypoint.dart
@@ -129,7 +129,6 @@ ${argParser.usage}
           'uri': dtdInfo.uri,
         },
     }));
-    stderr.close();
   } catch (e, st) {
     writeErrorResponse(e, st);
   } finally {
```

This is is from 56416078a0. As you can see, there is already a `stderr.close` call in the finally block, so this change is just a refactor and safe to be in this cherry-pick.
2024-10-01 12:57:21 +00:00
…
2024-06-17 17:26:08 +00:00

Flutter

Flutter CI Status Discord badge Twitter handle codecov CII Best Practices OpenSSF Scorecard SLSA 1

Flutter is Google's SDK for crafting beautiful, fast user experiences for mobile, web, and desktop from a single codebase. Flutter works with existing code, is used by developers and organizations around the world, and is free and open source.

Documentation

For announcements about new releases, follow the flutter-announce@googlegroups.com mailing list. Our documentation also tracks breaking changes across releases.

Terms of service

The Flutter tool may occasionally download resources from Google servers. By downloading or using the Flutter SDK, you agree to the Google Terms of Service: https://policies.google.com/terms

For example, when installed from GitHub (as opposed to from a prepackaged archive), the Flutter tool will download the Dart SDK from Google servers immediately when first run, as it is used to execute the flutter tool itself. This will also occur when Flutter is upgraded (e.g. by running the flutter upgrade command).

About Flutter

We think Flutter will help you create beautiful, fast apps, with a productive, extensible and open development model, whether you're targeting iOS or Android, web, Windows, macOS, Linux or embedding it as the UI toolkit for a platform of your choice.

Beautiful user experiences

We want to enable designers to deliver their full creative vision without being forced to water it down due to limitations of the underlying framework. Flutter's layered architecture gives you control over every pixel on the screen and its powerful compositing capabilities let you overlay and animate graphics, video, text, and controls without limitation. Flutter includes a full set of widgets that deliver pixel-perfect experiences whether you're building for iOS (Cupertino) or other platforms (Material), along with support for customizing or creating entirely new visual components.

Reflectly hero image

Fast results

Flutter is fast. It's powered by hardware-accelerated 2D graphics libraries like Skia (that underpins Chrome and Android) and Impeller. We architected Flutter to support glitch-free, jank-free graphics at the native speed of your device.

Flutter code is powered by the world-class Dart platform, which enables compilation to 32-bit and 64-bit ARM machine code for iOS and Android, JavaScript and WebAssembly for the web, as well as Intel x64 and ARM for desktop devices.

Dart diagram

Productive development

Flutter offers stateful hot reload, allowing you to make changes to your code and see the results instantly without restarting your app or losing its state.

Hot reload animation

Extensible and open model

Flutter works with any development tool (or none at all), and also includes editor plug-ins for both Visual Studio Code and IntelliJ / Android Studio. Flutter provides tens of thousands of packages to speed your development, regardless of your target platform. And accessing other native code is easy, with support for both FFI (on Android, on iOS, on macOS, and on Windows) as well as platform-specific APIs.

Flutter is a fully open-source project, and we welcome contributions. Information on how to get started can be found in our contributor guide.

Languages
Dart 75%
C++ 16.5%
Objective-C++ 2.9%
Java 2.8%
Objective-C 0.7%
Other 1.9%