From 63dc645f6e29f8f4d5aa1c31fd749818dcd9b53d Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Mon, 16 Mar 2026 07:59:07 -0700 Subject: [PATCH] Bump VM packages to language version 3.12. This CL is part of an effort to bump the SDK requirement to `3.12.0-0` for all the packages in `pkg` that are not published to `pub`, so that we can get better testing of the "private named parameters" feature. (Packages that *are* published to `pub` can't be safely bumped yet, because SDK 3.12 hasn't been released, and I don't want to block those packages' ability to publish useful updates to customers.) This change covers the following packages, which are owned by OWNERS_VM: - pkg/dart2bytecode - pkg/dart2native - pkg/dtd_impl (jointly owned with OWNERS_DEVTOOLS) - pkg/mmap - pkg/observatory - pkg/vm Changes to `pubspec.yaml` files were made manually. Changes to `.dart` files were made automatically, using `dart fix`. Two kinds of changes were made: - Migrate to using private named parameters where it is possible to do so without changing semantics. Note that this migration is conservative; see https://github.com/dart-lang/sdk/issues/58607 for details. - Migrate to using null aware elements. Tested: Standard trybots Change-Id: I1666e5771a34ef3c30ceeadced3d505d6a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487942 Auto-Submit: Paul Berry Commit-Queue: Paul Berry Reviewed-by: Daco Harkes --- pkg/dart2bytecode/pubspec.yaml | 2 +- pkg/dart2native/lib/dart2native.dart | 2 +- pkg/dart2native/lib/generate.dart | 43 +++++++------------ pkg/dart2native/pubspec.yaml | 2 +- pkg/dtd_impl/lib/src/dart_tooling_daemon.dart | 8 ++-- pkg/dtd_impl/lib/src/dtd_client.dart | 4 +- pkg/dtd_impl/pubspec.yaml | 2 +- pkg/mmap/pubspec.yaml | 2 +- pkg/observatory/pubspec.yaml | 2 +- pkg/vm/pubspec.yaml | 2 +- 10 files changed, 27 insertions(+), 42 deletions(-) diff --git a/pkg/dart2bytecode/pubspec.yaml b/pkg/dart2bytecode/pubspec.yaml index 770e9d2e609..fec26b89503 100644 --- a/pkg/dart2bytecode/pubspec.yaml +++ b/pkg/dart2bytecode/pubspec.yaml @@ -3,7 +3,7 @@ name: dart2bytecode publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace diff --git a/pkg/dart2native/lib/dart2native.dart b/pkg/dart2native/lib/dart2native.dart index 23a2af467cb..5abdf1a1b9b 100644 --- a/pkg/dart2native/lib/dart2native.dart +++ b/pkg/dart2native/lib/dart2native.dart @@ -123,7 +123,7 @@ Future generateKernelHelper({ if (depFile != null) '--depfile=$depFile', '--output=$kernelFile', ...extraGenKernelOptions, - if (sourceFile != null) sourceFile, + ?sourceFile, ]; return Process.run(sdk.dartAotRuntime, args); } diff --git a/pkg/dart2native/lib/generate.dart b/pkg/dart2native/lib/generate.dart index a5f191257ae..776c69fc0e8 100644 --- a/pkg/dart2native/lib/generate.dart +++ b/pkg/dart2native/lib/generate.dart @@ -166,39 +166,26 @@ class _Generator { final String _targetDartAotRuntime; _Generator({ - required String genSnapshot, - required String targetDartAotRuntime, + required this._genSnapshot, + required this._targetDartAotRuntime, required String sourceFile, - required List defines, - required Kind kind, - String? outputFile, - String? debugFile, + required this._defines, + required this._kind, + this._outputFile, + this._debugFile, String? packages, - OS? targetOS, - String? depFile, - required String enableExperiment, - required bool enableAsserts, - required bool verbose, - required String verbosity, + this._targetOS, + this._depFile, + required this._enableExperiment, + required this._enableAsserts, + required this._verbose, + required this._verbosity, required Directory tempDir, - bool progressUpdatesOnStderr = false, - }) : _kind = kind, - _verbose = verbose, - _tempDir = tempDir, - _verbosity = verbosity, - _enableAsserts = enableAsserts, - _enableExperiment = enableExperiment, - _targetOS = targetOS, - _debugFile = debugFile, - _outputFile = outputFile, - _defines = defines, - _depFile = depFile, - _progressUpdatesOnStderr = progressUpdatesOnStderr, + this._progressUpdatesOnStderr = false, + }) : _tempDir = tempDir, _programKernelFile = path.join(tempDir.path, 'program.dill'), _sourcePath = _normalize(sourceFile)!, - _packages = _normalize(packages), - _genSnapshot = genSnapshot, - _targetDartAotRuntime = targetDartAotRuntime { + _packages = _normalize(packages) { if (_kind == Kind.exe) { if (_targetOS == null) { throw ArgumentError('targetOS must be specified for executables.'); diff --git a/pkg/dart2native/pubspec.yaml b/pkg/dart2native/pubspec.yaml index f660fec250c..f2d0cb481cd 100644 --- a/pkg/dart2native/pubspec.yaml +++ b/pkg/dart2native/pubspec.yaml @@ -3,7 +3,7 @@ name: dart2native publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace diff --git a/pkg/dtd_impl/lib/src/dart_tooling_daemon.dart b/pkg/dtd_impl/lib/src/dart_tooling_daemon.dart index e8cca09730a..1ea4b2e275f 100644 --- a/pkg/dtd_impl/lib/src/dart_tooling_daemon.dart +++ b/pkg/dtd_impl/lib/src/dart_tooling_daemon.dart @@ -180,13 +180,11 @@ class DartToolingDaemon { required this.secret, required bool unrestrictedMode, bool disableServiceAuthCodes = false, - bool ipv6 = false, - bool shouldLogRequests = false, + this._ipv6 = false, + this._shouldLogRequests = false, bool useFakeAnalytics = false, this.pingInterval, - }) : _ipv6 = ipv6, - _uriAuthCode = disableServiceAuthCodes ? null : _generateSecret(), - _shouldLogRequests = shouldLogRequests { + }) : _uriAuthCode = disableServiceAuthCodes ? null : _generateSecret() { streamManager = DTDStreamManager(this); clientManager = DTDClientManager(); diff --git a/pkg/dtd_impl/lib/src/dtd_client.dart b/pkg/dtd_impl/lib/src/dtd_client.dart index c44f5171ce6..732ddcaef1b 100644 --- a/pkg/dtd_impl/lib/src/dtd_client.dart +++ b/pkg/dtd_impl/lib/src/dtd_client.dart @@ -352,9 +352,9 @@ class DTDClient extends Client { Map? capabilities, }) { return { - if (service != null) DtdParameters.service: service, + DtdParameters.service: ?service, DtdParameters.method: method, - if (capabilities != null) DtdParameters.capabilities: capabilities, + DtdParameters.capabilities: ?capabilities, }; } diff --git a/pkg/dtd_impl/pubspec.yaml b/pkg/dtd_impl/pubspec.yaml index 123fcd525a2..0cd504e81a2 100644 --- a/pkg/dtd_impl/pubspec.yaml +++ b/pkg/dtd_impl/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/dart-lang/sdk/tree/main/pkg/dtd_impl publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace diff --git a/pkg/mmap/pubspec.yaml b/pkg/mmap/pubspec.yaml index 5ccf2c7de19..44e0a0e014f 100644 --- a/pkg/mmap/pubspec.yaml +++ b/pkg/mmap/pubspec.yaml @@ -4,7 +4,7 @@ name: mmap publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace diff --git a/pkg/observatory/pubspec.yaml b/pkg/observatory/pubspec.yaml index ccebb3abf33..b36e613d2b7 100644 --- a/pkg/observatory/pubspec.yaml +++ b/pkg/observatory/pubspec.yaml @@ -2,7 +2,7 @@ name: observatory publish_to: none environment: - sdk: ^3.8.0 + sdk: '^3.12.0-0' dependencies: args: any diff --git a/pkg/vm/pubspec.yaml b/pkg/vm/pubspec.yaml index c2b09dd2e12..ea2d1146792 100644 --- a/pkg/vm/pubspec.yaml +++ b/pkg/vm/pubspec.yaml @@ -4,7 +4,7 @@ description: VM specific Dart code and helper scripts publish_to: none environment: - sdk: ^3.7.0 + sdk: '^3.12.0-0' resolution: workspace