rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.73k stars 2.42k forks source link

Vendoring from a git repository should include files as if they were published #7051

Open glandium opened 5 years ago

glandium commented 5 years ago

When we vendor forked versions of crates from git repositories in Firefox, cargo vendor adds plenty of files that wouldn't be there if the crate had been published on crates.io, like CI files, .gitignore, etc. Even Cargo.toml is normalized, and this makes vendoring more noisy than necessary.

See e.g. https://phabricator.services.mozilla.com/D18767 https://phabricator.services.mozilla.com/D20289

(originally filed as https://github.com/alexcrichton/cargo-vendor/issues/203)

stevenroose commented 4 years ago

@glandium question: how are you vendoring a git dependency? I can't seem to find what to include in the .cargo/config file to overwrite the git source with the vendored files.. (Even though cargo-vendor actually downloads the dependencies into the folder.)

glandium commented 4 years ago

With [patch.crates-io] in Cargo.toml. See https://phabricator.services.mozilla.com/D18767#change-rFeP59HZ8M0a