[M] Change in dart/sdk[main]: [migrate] Support Dart 3 backwards compatibility.

0 views
Skip to first unread message

Kallen Tu (Gerrit)

unread,
Jul 14, 2026, 5:49:41 PM (2 days ago) Jul 14
to Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Brian Wilkerson

Kallen Tu voted and added 1 comment

Votes added by Kallen Tu

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 2 (Latest):
Kallen Tu . resolved

I don't really see us getting around this since we don't import the pub package itself. But the migration tool doesn't work smoothly without this special case since so many packages aren't migrated.

Open in Gerrit

Related details

Attention is currently required from:
  • Brian Wilkerson
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4eff59843668ebb9cff1a13c7f3ad54fec64a547
Gerrit-Change-Number: 524200
Gerrit-PatchSet: 2
Gerrit-Owner: Kallen Tu <kall...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
Gerrit-Attention: Brian Wilkerson <brianwi...@google.com>
Gerrit-Comment-Date: Tue, 14 Jul 2026 21:49:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
open
diffy

Brian Wilkerson (Gerrit)

unread,
Jul 15, 2026, 2:54:14 PM (13 hours ago) Jul 15
to Kallen Tu, Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org
Attention needed from Kallen Tu

Brian Wilkerson voted and added 1 comment

Votes added by Brian Wilkerson

Code-Review+1

1 comment

File pkg/analysis_server/lib/src/utilities/pubspec.dart
Line 28, Patchset 2 (Latest): // Apply Dart 3 package compatibility re-interpretation:
Brian Wilkerson . unresolved

I don't think I ever knew that this was a thing. Could you include the URL from the CL comment (https://dart.dev/resources/dart-3-migration#dart-3-backwards-compatibility) in this comment for future reference?

Open in Gerrit

Related details

Attention is currently required from:
  • Kallen Tu
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4eff59843668ebb9cff1a13c7f3ad54fec64a547
Gerrit-Change-Number: 524200
Gerrit-PatchSet: 2
Gerrit-Owner: Kallen Tu <kall...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
Gerrit-Attention: Kallen Tu <kall...@google.com>
Gerrit-Comment-Date: Wed, 15 Jul 2026 18:54:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
open
diffy

Kallen Tu (Gerrit)

unread,
Jul 15, 2026, 3:39:37 PM (12 hours ago) Jul 15
to Brian Wilkerson, dart-...@luci-project-accounts.iam.gserviceaccount.com, dart-analys...@google.com, rev...@dartlang.org

Kallen Tu voted and added 1 comment

Votes added by Kallen Tu

Commit-Queue+2

1 comment

File pkg/analysis_server/lib/src/utilities/pubspec.dart
Line 28, Patchset 2: // Apply Dart 3 package compatibility re-interpretation:
Brian Wilkerson . resolved

I don't think I ever knew that this was a thing. Could you include the URL from the CL comment (https://dart.dev/resources/dart-3-migration#dart-3-backwards-compatibility) in this comment for future reference?

Kallen Tu

Can do. Added.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4eff59843668ebb9cff1a13c7f3ad54fec64a547
Gerrit-Change-Number: 524200
Gerrit-PatchSet: 3
Gerrit-Comment-Date: Wed, 15 Jul 2026 19:39:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Brian Wilkerson <brianwi...@google.com>
satisfied_requirement
open
diffy

dart-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)

unread,
Jul 15, 2026, 4:06:26 PM (12 hours ago) Jul 15
to Kallen Tu, Brian Wilkerson, dart-analys...@google.com, rev...@dartlang.org

dart-...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

Unreviewed changes

2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: pkg/analysis_server/lib/src/utilities/pubspec.dart
Insertions: 1, Deletions: 0.

@@ -29,6 +29,7 @@
// If the package is null-safe (min SDK >= 2.12.0) and has max constraint
// <3.0.0 (which is parsed as max: 3.0.0-0, includeMax: false),
// re-interpret the max constraint as <4.0.0.
+ // https://dart.dev/resources/dart-3-migration#dart-3-backwards-compatibility
if (constraint is VersionRange) {
var min = constraint.min;
var max = constraint.max;
```

Change information

Commit message:
[migrate] Support Dart 3 backwards compatibility.

Pub reinterprets `<3.0.0` as `<4.0.0` when the lower constraint is
`2.12` or higher which allows users to use Dart 3 sound null safety
with packages that support 2.12 null safety.
https://dart.dev/resources/dart-3-migration#dart-3-backwards-compatibility

Currently, the migrate tool doesn't take this into consideration and
will flag the constraint as a dependency error.
This CL will add the extra case onto the check.
Change-Id: I4eff59843668ebb9cff1a13c7f3ad54fec64a547
Reviewed-by: Brian Wilkerson <brianwi...@google.com>
Commit-Queue: Kallen Tu <kall...@google.com>
Files:
  • M pkg/analysis_server/lib/src/utilities/pubspec.dart
  • M pkg/analysis_server/test/lsp/migrate_test.dart
Change size: M
Delta: 2 files changed, 62 insertions(+), 0 deletions(-)
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Brian Wilkerson
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: sdk
Gerrit-Branch: main
Gerrit-Change-Id: I4eff59843668ebb9cff1a13c7f3ad54fec64a547
Gerrit-Change-Number: 524200
Gerrit-PatchSet: 4
Gerrit-Owner: Kallen Tu <kall...@google.com>
Gerrit-Reviewer: Brian Wilkerson <brianwi...@google.com>
Gerrit-Reviewer: Kallen Tu <kall...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages