Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo vendor doesn't generate .cargo_vcs_info.json #11000

Open
yshui opened this issue Aug 17, 2022 · 1 comment
Open

cargo vendor doesn't generate .cargo_vcs_info.json #11000

yshui opened this issue Aug 17, 2022 · 1 comment
Labels

Comments

@yshui
Copy link

yshui commented Aug 17, 2022

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.

rust-skia/rust-skia#682

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

No response

@yshui yshui added the C-bug Category: bug label Aug 17, 2022
yshui added a commit to yshui/gentoo-overlay that referenced this issue Aug 18, 2022
Broken package: neovide, see:
rust-lang/cargo#11000

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
@weihanglo
Copy link
Member

weihanglo commented Aug 21, 2022

I'd say it looks like a bug since its first introduction1. 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 case2. 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).

Footnotes

  1. https://github.com/rust-lang/cargo/pull/1959

  2. https://github.com/rust-lang/cargo/blob/1ac83ba69614eb67c5255f36fd385f711b81e9e4/src/cargo/sources/path.rs#L119-L122

@ehuss ehuss changed the title cargo vendor doesn't not generate .cargo_vcs_info.json cargo vendor doesn't generate .cargo_vcs_info.json Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants