Skip to content

Conversation

sigurdm
Copy link
Contributor

@sigurdm sigurdm commented Aug 28, 2025

This is the same heuristic check that dart run uses to ensure that the resolution is usable.

Attempt to fix #1447

The command is hidden for now, we are unsure how we want to recommend end-users use it. But it will be available for vscode and others to use.

@sigurdm
Copy link
Contributor Author

sigurdm commented Aug 28, 2025

cc @DanTup

@sigurdm sigurdm requested a review from szakarias August 28, 2025 14:15
@DanTup
Copy link

DanTup commented Aug 28, 2025

Neat, thank you! :-)

What's the behaviour for this in a Pub Workspace - is the check for the overall workspace, or just the package in which it's invoked for?

@sigurdm
Copy link
Contributor Author

sigurdm commented Aug 29, 2025

The check is for the overall workspace resolution, in a workspace everything is always resolved together.

I'll add a test demonstrating this.

@DanTup
Copy link

DanTup commented Aug 29, 2025

The check is for the overall workspace resolution

Perfect, thank you!

@sigurdm sigurdm changed the title Expose --check-up-to-date in pub get command pub check-resolution-up-to-date Aug 29, 2025
@sigurdm
Copy link
Contributor Author

sigurdm commented Aug 29, 2025

@szakarias suggested we make this a hidden command instead.
It is not clear we want end-users to use this in general, or be confused about this option.

Copy link
Contributor

@szakarias szakarias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comments.

}) async {
/// If any of the timestamps are out of order, the resolution in
/// pubspec.lock is validated against constraints of all pubspec.yamls, and
/// the packages of `.dart_tool/package_config.json` is validated against
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// the packages of `.dart_tool/package_config.json` is validated against
/// the packages of `.dart_tool/package_config.json` are validated against

///
/// `.dart_tool/package_config.json` is read parsed. In the case of `dart
/// run` this is acceptable: we speculate that it brings it to the file
/// system cache and the dart VM is going to read the file anyways.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// system cache and the dart VM is going to read the file anyways.
/// system cache and the dart VM is going to read the file anyway.

Copy link
Contributor

@szakarias szakarias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

sigurdm and others added 4 commits September 1, 2025 09:11
Co-authored-by: Sarah Zakarias <zarah@google.com>
Co-authored-by: Sarah Zakarias <zarah@google.com>
Co-authored-by: Sarah Zakarias <zarah@google.com>
Co-authored-by: Sarah Zakarias <zarah@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add the ability to check if "pub get" needs running

3 participants