Skip to content

Conversation

@bkonyi
Copy link
Contributor

@bkonyi bkonyi commented Dec 16, 2025

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 #179941

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
@bkonyi bkonyi requested a review from jtmcdole December 16, 2025 18:06
@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Dec 16, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 16, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 16, 2025
@auto-submit
Copy link
Contributor

auto-submit bot commented Dec 16, 2025

autosubmit label was removed for flutter/flutter/179951, because Pull request flutter/flutter/179951 is not in a mergeable state.

@bkonyi bkonyi added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 16, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Dec 16, 2025
Merged via the queue into flutter:master with commit 6634f14 Dec 16, 2025
141 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Dec 16, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Dec 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

widget_preview_scaffold blocking packages_autoroller

2 participants