Skip to content

Private git dependency on a tag now breaks when the package in git also has a path dependency on a package with another path dependency #4706

@rafaeltab

Description

@rafaeltab

Environment

Flutter 3.35.6 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9f455d2486 (5 weeks ago) • 2025-10-08 14:55:31 -0500
Engine • hash a5f2c36e367c13f868cfe98db5806f562c52c35e (revision d2913632a4) (1 months ago) • 2025-10-07 17:26:21.000Z
Tools • Dart 3.9.2 • DevTools 2.48.0

MacOS Sonoma 14.5 on a MacBook Pro with M2 Max CPU.

Problem

When using a dependency on a git package using a tag

some_package_name:
  git:
    url: *some_git
    tag_pattern: v{{version}}
    path: packages/some_package_name
  version: 10.3.0

Where the package you're depending on also has a path dependency, to a package that has another path dependency:

git:packages/some_package_name

name: some_package_name
description: "A package description"
version: 10.3.0
publish_to: none

environment:
  sdk: ">=3.9.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter
  some_other_package:
    path: ../some_other_package
  some_third_package:
    path: ../some_third_package

git:packages/some_other_package

name: some_other_package
description: "A package description"
version: 10.3.0
publish_to: none

environment:
  sdk: ">=3.9.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter
  some_third_package:
    path: ../some_third_package

git:packages/some_third_package

name: some_third_package
description: "A package description"
version: 10.3.0
publish_to: none

environment:
  sdk: ">=3.9.0 <4.0.0"

dependencies:
  flutter:
    sdk: flutter

It used to correctly install all packages. After doing a version update from flutter 3.27.4 to 3.35.6 it now breaks.

Expected behavior

Installation should succeed, and install all 3 packages from git at the version 10.3.0, which is from tag v10.3.0.

Actual behavior

It gives the follow error during flutter pub get

Because every version of some_third_package from git depends on some_other_package from git (any git url) at 7b3e19b6ec87dcb6e9112c97235722b087b67829 in packages/some_other_package and
  some_package_name >=(10.3.0) from git depends on some_other_package from git (any git url) at c11ed2da086edebf743144f4fe210d0afa6e9345 in packages/some_other_package,
  some_third_package from git is incompatible with some_package_name >=(10.3.0) from git

c11... is the SHA of the actual tag itself v10.3.0, and 7b3e... is the SHA of the commit that tag points to.

git rev-parse v10.3.0 in the git repo outputs c11e...
git checkout v10.3.0 && git rev-parse HEAD outputs 7b3e...

--verbose output

This is code from my job, so I don't think I can share the verbose output? If it is absolutely necessary, I could ask, but that would take time, so I'll make the issue without for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions