cargo icon indicating copy to clipboard operation
cargo copied to clipboard

`cargo vendor` doesn't not generate `.cargo_vcs_info.json`

Open yshui opened this issue 2 years ago • 1 comments

Problem

I am not sure if this really is a bug. But rust-skia/skia-bindings' build script expects that there is either a .cargo_vcs_info.json in the crate directory, or the crate directory is a git repo. Because cargo vendor doesn't create a .cargo_vcs_info.json, skia-bindings fails to build.

https://github.com/rust-skia/rust-skia/issues/682

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

No response

yshui avatar Aug 17 '22 19:08 yshui

I'd say it looks like a bug since its first introduction^0. The original intent was skipping dot directories but seems to accidentally do that on dotfiles as well. Most of the time the bug won't occur because your crate need to

  • not be a git repo, or
  • not have include in Cargo.toml

to hit this unfortunate case^1. And this right happens to cargo vendor as vendored crates are not in a git repo.

Fixing this might be a breaking change, since someone might already depend on this heuristic rule and do some checksum integrity stuff. I am not sure whether it really breaks things when you found cargo package doing differently between versions.

To circumvent this, for the time being I suggest using include in crates you depends on. (It's a little intimidating to write an allow list though).

weihanglo avatar Aug 21 '22 13:08 weihanglo