Skip to content

[CP] Special case message from global run when incompatibility stems from sdk package #57054

@sigurdm

Description

@sigurdm

Commit(s) to merge

dart-lang/pub#4419
Merged to sdk main in https://dart-review.googlesource.com/c/sdk/+/393742

Target

beta

Prepared changelist for beta/stable

https://dart-review.googlesource.com/c/sdk/+/394261

Issue Description

When running a dart pub global run of an activated package that has dependencies not compatible with current sdk (most likely due to a new package:_macros version'

Will (now, after #56930) give a message like:

The package `protoc_plugin` as currently activated cannot resolve to the same packages.

Try reactivating the package.
`dart pub global activate protoc_plugin`

This can be a bit confusing, as it doesn't explain what went wrong.

This is a follow-up to #56930

What is the fix

We add a summary of the packages that would have to change for the current activation to be valid.

> _macros 0.3.3 from sdk dart (was 0.3.2 from sdk dart)

And if we can detect that the incompatibility stems from a change in an sdk package version we give a specific error message:

The current activation of `protoc_plugin` is not compatible with your current SDK.

Why cherry-pick

To improve the error message when upgrading to dart 3.6.0

Risk

medium-low

Issue link(s)

dart-lang/pub#4406

Extra Info

No response

Metadata

Metadata

Labels

area-dart-cliUse area-dart-cli for issues related to the 'dart' command like tool.cherry-pick-approvedLabel for approved cherrypick requestcherry-pick-mergedCherry-pick has been merged to the stable or beta branch.cherry-pick-reviewIssue that need cherry pick triage to approvetype-enhancementA request for a change that isn't a bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions