-
Notifications
You must be signed in to change notification settings - Fork 233
command pub check-resolution-up-to-date
#4655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
cc @DanTup |
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? |
The check is for the overall workspace resolution, in a workspace everything is always resolved together. I'll add a test demonstrating this. |
Perfect, thank you! |
pub get
pub check-resolution-up-to-date
@szakarias suggested we make this a hidden command instead. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// `.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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// 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. |
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// Whether or not the `.dart_tool/package_config.json` file is was | |
/// Whether or not the `.dart_tool/package_config.json` file was |
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.