Skip to content

cargo vendor is not consistent about paths and symbolic links on Windows vs. other platforms #14965

Open
@glandium

Description

Problem

About paths:
when a crate contains paths for e.g. dependencies in a workspace, cargo vendor uses / on Unices and \ on Windows, changing whatever the original path was.

About symbolic links:
when a crate contains symbolic links to another file in a workspace, cargo vendor expands the content on Unices and replaces it with the path of the link target on Windows.

Steps

  1. cargo new foo
  2. cd foo
  3. cargo add libz-rs-sys
  4. cargo vendor

On Linux or Mac, you end up with a proper vendor/libz-rs-sys/LICENSE file, and vendor/libz-rs-sys/Cargo.toml has dependencies.zlib-rs.path = "../zlib-rs".
On Windows, vendor/libz-rs-sys/LICENSE literally contains ../LICENSE, and vendor/libz-rs-sys/Cargo.toml has dependencies.zlib-rs.path = "..\zlib-rs".

Possible Solution(s)

cargo vendor should be consistent, wherever it's run.

Notes

No response

Version


Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-vendorO-windowsOS: WindowsS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions