-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[ Tool ] Fix update-packages not accounting for path dependencies #179951
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
Conversation
Each project's `pubspec.yaml` is copied into a temporary directory before trying to determine which packages can be updated, but this `pubspec.yaml` is currently deleted immediately after the dependencies have been determined for the single package. This means that projects that have path dependencies on other projects in the repository don't have their dependencies updated properly as the path dependencies fail to resolve. This change updates the `update-packages` logic to copy each project's `pubspec.yaml` to a temporary directory with a consistent relative directory structure. The `_upgrade` function has been updated to support processing multiple projects before deleting the temporary directory, allowing for projects with path dependencies on each other to have their pubspecs placed in the correct relative directories for them to resolve correctly. Fixes flutter#179941
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.
Code Review
This pull request refactors the update-packages command to correctly handle path dependencies between projects by processing multiple projects' pubspec.yaml files within a shared temporary directory structure. The overall approach is sound and directly addresses the issue of path resolution. However, I've identified a critical issue in how the temporary directory structure is created that will cause it to fail on non-Windows platforms. My review includes a suggested fix for this issue. The test updates are a great addition for ensuring this functionality remains stable.
|
autosubmit label was removed for flutter/flutter/179951, because Pull request flutter/flutter/179951 is not in a mergeable state. |
Each project's
pubspec.yamlis copied into a temporary directory before trying to determine which packages can be updated, but thispubspec.yamlis currently deleted immediately after the dependencies have been determined for the single package. This means that projects that have path dependencies on other projects in the repository don't have their dependencies updated properly as the path dependencies fail to resolve.This change updates the
update-packageslogic to copy each project'spubspec.yamlto a temporary directory with a consistent relative directory structure. The_upgradefunction has been updated to support processing multiple projects before deleting the temporary directory, allowing for projects with path dependencies on each other to have their pubspecs placed in the correct relative directories for them to resolve correctly.Fixes #179941