Skip to content

Path is inconsistent on windows when using git dependency with path dependencies #4314

Closed
@CodeDoctorDE

Description

@CodeDoctorDE

Environment

  • Dart version (run dart --version): Dart SDK version: 3.4.3 (stable) (Tue Jun 4 19:51:39 2024 +0000) on "windows_x64"
  • OS kind and version (e.g. "Windows 10, version 1809" or "macOS 12.4"): Windows 11
  • Are you using the Chinese community mirror or a corporate firewall? No

Maybe related to #449.

Problem

I use path dependencies in a git (see https://github.com/LinwoodDev/dart_pkgs/blob/b440166c38b927b6520f2835ceffb860b88faa30/packages/material_leap/pubspec.yaml#L18).

When using

material_leap:
    git:
      url: https://github.com/LinwoodDev/dart_pkgs.git
      ref: 0e04c453c2b6d4aa499f79e54bb1c0b7a9b2c42c
      path: packages/material_leap

The .lock file has:

dart_leap:
    dependency: transitive
    description:
      path: "packages\\dart_leap"
      ref: "0e04c453c2b6d4aa499f79e54bb1c0b7a9b2c42c"
      resolved-ref: "0e04c453c2b6d4aa499f79e54bb1c0b7a9b2c42c"
      url: "https://github.com/LinwoodDev/dart_pkgs.git"
    source: git
    version: "1.0.0"

Expected behavior

It should use path: "packages/dart_leap"

Actual behavior

It uses the backslash on windows.

--trace output

There is no error, it only fetches the dart_leap packages every time when using flutter pub get: Changed 1 dependency!.

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