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.

/// 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
/// pubspec.lock. We do this extra round of checking to accomodate for cases
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
/// pubspec.lock. We do this extra round of checking to accomodate for cases
/// pubspec.lock. We do this extra round of checking to accommodate for cases

}) 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

/// work as possible. Specifically we avoid parsing any yaml when the
/// timestamps are in the right order.
///
/// `.dart_tool/package_config.json` is read parsed. In the case of `dart
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
/// `.dart_tool/package_config.json` is read parsed. In the case of `dart
/// `.dart_tool/package_config.json` is read and parsed. In the case of `dart

///
/// `.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!

@@ -0,0 +1,107 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
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
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file

return false;
}
return true;
/// Whether or not the `.dart_tool/package_config.json` file is was
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
/// Whether or not the `.dart_tool/package_config.json` file is was
/// Whether or not the `.dart_tool/package_config.json` file was

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