Skip to content

Cargo packages duplicate files on case-insensitive file systems #13722

Open
@kornelski

Description

@kornelski

Problem

It seems that Cargo is excluding an already-packaged files using exact name comparison, which doesn't always match how the file system sees name equality.

   Archiving Cargo.lock
   Archiving Cargo.toml
   Archiving Cargo.toml.orig
   Archiving README.md
   Archiving readme.Md
   Archiving src/main.rs

Example crate:

https://docs.rs/crate/rosu/0.6.0/source/

Steps

[package]

readme = "README.md"
echo case > readme.Md
cargo package

The same applies to license-file, cargo.lock.

Possible Solution(s)

Theoretically there could be other gotchas of this kind, e.g. HFS+ file system on macOS forces file names to use NFD Unicode form, while most text has NFC form, which makes codepoint-by-codepoint comparisons not equal. However HFS+ is on its way out, so perhaps a simple case-insensitive comparison will suffice.

Notes

No response

Version

cargo 1.79.0-nightly (499a61ce7 2024-03-26)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions