From bd0b10802b2c3f7dce7afdcf64487e151dc2c932 Mon Sep 17 00:00:00 2001 From: Paul Berry Date: Mon, 16 Mar 2026 10:32:47 -0700 Subject: [PATCH] Bump infra 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_INFRA: - pkg/smith - pkg/status_file - pkg/test_runner Changes to `pubspec.yaml` files were made manually. Changes to `.dart` files were made automatically (with some exceptions), using `dart fix` to 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. The exceptions are: - pkg/test_runner/lib/src/compiler_configuration.dart - pkg/test_runner/lib/src/path.dart These files contained code that triggered the `use_null_aware_elements` lint, so I manually fixed the instances of the lint. (The lint didn't previously fire because the test runner used to be on language version 3.5.0, which was before the "null aware elements" feature existed.) Change-Id: Ia5d99ba5fc2d5aacbec5b091348be1d26a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/487882 Commit-Queue: Paul Berry Reviewed-by: Ryan Macnak --- pkg/smith/pubspec.yaml | 2 +- pkg/status_file/lib/expectation.dart | 5 ++--- pkg/status_file/pubspec.yaml | 2 +- pkg/test_runner/lib/src/command.dart | 5 ++--- pkg/test_runner/lib/src/compiler_configuration.dart | 2 +- pkg/test_runner/lib/src/configuration.dart | 5 ++--- pkg/test_runner/lib/src/path.dart | 2 +- pkg/test_runner/pubspec.yaml | 2 +- 8 files changed, 11 insertions(+), 14 deletions(-) diff --git a/pkg/smith/pubspec.yaml b/pkg/smith/pubspec.yaml index 92b76a5c714..444539ed0ec 100644 --- a/pkg/smith/pubspec.yaml +++ b/pkg/smith/pubspec.yaml @@ -4,7 +4,7 @@ description: Shared code for working with the Dart SDK's tests and test runner. publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace diff --git a/pkg/status_file/lib/expectation.dart b/pkg/status_file/lib/expectation.dart index 8898b7911d7..d4b4ce23bec 100644 --- a/pkg/status_file/lib/expectation.dart +++ b/pkg/status_file/lib/expectation.dart @@ -205,9 +205,8 @@ class Expectation { /// Whether this expectation is a test outcome. If not, it's a "meta marker". final bool isOutcome; - Expectation._(this._name, {Expectation? group, bool isMeta = false}) - : _group = group, - isOutcome = !isMeta; + Expectation._(this._name, {this._group, bool isMeta = false}) + : isOutcome = !isMeta; bool canBeOutcomeOf(Expectation expectation) { Expectation? outcome = this; diff --git a/pkg/status_file/pubspec.yaml b/pkg/status_file/pubspec.yaml index f3193fd88c8..a271d70fdbe 100644 --- a/pkg/status_file/pubspec.yaml +++ b/pkg/status_file/pubspec.yaml @@ -3,7 +3,7 @@ name: status_file publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace diff --git a/pkg/test_runner/lib/src/command.dart b/pkg/test_runner/lib/src/command.dart index a81fb51c83f..6607328efe3 100644 --- a/pkg/test_runner/lib/src/command.dart +++ b/pkg/test_runner/lib/src/command.dart @@ -170,11 +170,10 @@ class CompilationCommand extends ProcessCommand { String executable, List arguments, Map environmentOverrides, - {required bool alwaysCompile, + {required this._alwaysCompile, String? workingDirectory, int index = 0}) - : _alwaysCompile = alwaysCompile, - super(displayName, executable, arguments, environmentOverrides, + : super(displayName, executable, arguments, environmentOverrides, workingDirectory, index); @override diff --git a/pkg/test_runner/lib/src/compiler_configuration.dart b/pkg/test_runner/lib/src/compiler_configuration.dart index bb79cc36e44..77c37e5df84 100644 --- a/pkg/test_runner/lib/src/compiler_configuration.dart +++ b/pkg/test_runner/lib/src/compiler_configuration.dart @@ -1116,7 +1116,7 @@ class PrecompilerCompilerConfiguration extends CompilerConfiguration } var args = [ - if (target != null) ...target, + ...?target, ...ldFlags, shared, '-o', diff --git a/pkg/test_runner/lib/src/configuration.dart b/pkg/test_runner/lib/src/configuration.dart index dea6e14ab3d..9d606015c6c 100644 --- a/pkg/test_runner/lib/src/configuration.dart +++ b/pkg/test_runner/lib/src/configuration.dart @@ -33,7 +33,7 @@ class TestConfiguration { this.build = false, this.testList = const [], this.deflakeInfoMap = const {}, - int repeat = 1, + this._repeat = 1, this.batch = false, this.copyCoreDumps = false, this.rr = false, @@ -76,8 +76,7 @@ class TestConfiguration { : packages = packages ?? Repository.uri .resolve('.dart_tool/package_config.json') - .toFilePath(), - _repeat = repeat; + .toFilePath(); final Map selectors; final Progress progress; diff --git a/pkg/test_runner/lib/src/path.dart b/pkg/test_runner/lib/src/path.dart index de23bc5d86a..ac3a5c4b487 100644 --- a/pkg/test_runner/lib/src/path.dart +++ b/pkg/test_runner/lib/src/path.dart @@ -240,7 +240,7 @@ class Path { var segmentsToJoin = [ if (isAbs) '', - if (drive != null) drive, + ?drive, if (newSegs.isEmpty) ...[ if (isAbs) '' else '.' ] else ...[ diff --git a/pkg/test_runner/pubspec.yaml b/pkg/test_runner/pubspec.yaml index 4402b547ff9..cc8e545a00a 100644 --- a/pkg/test_runner/pubspec.yaml +++ b/pkg/test_runner/pubspec.yaml @@ -7,7 +7,7 @@ name: test_runner publish_to: none environment: - sdk: ^3.5.0 + sdk: '^3.12.0-0' resolution: workspace