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 isn't consistent wrt "automatic" files and vendoring #5806

Closed
glandium opened this issue Jul 26, 2018 · 5 comments · Fixed by #13713
Closed

Cargo isn't consistent wrt "automatic" files and vendoring #5806

glandium opened this issue Jul 26, 2018 · 5 comments · Fixed by #13713
Labels
A-build-scripts Area: build.rs scripts A-directory-source Area: directory sources (vendoring) Command-vendor

Comments

@glandium
Copy link
Contributor

Say you have a crate vendored. That crate doesn't have a build script. Now, there are two ways to add a build script. One involves adding an entry to Cargo.toml, which fails because of the checksum change in Cargo.toml, and another is to just add a build.rs file.

The latter silently succeeds (and yes, the build script is built and run).

Or is silently ignored if the crate was already built thanks to #5805.

@glandium
Copy link
Contributor Author

Also, because of #5805, further changes to build.rs are ignored once it's built the first time.

Cc: @alexcrichton

@alexcrichton
Copy link
Member

Yeah this isn't a great feature, but the checksum file is largely intended to be a roadblock to modifying vendored crates (instead nudging towards the correct way of doing so, [patch] and path dependencies). It wasn't ever designed to be a bulletproof solution

@0Grit
Copy link

0Grit commented Jan 14, 2019

@alexcrichton Is there a command that can validate the checksum of vendored git based crates?

@alexcrichton
Copy link
Member

Not currently, no, only registry crates have a checksum to verify

@ehuss ehuss added the A-directory-source Area: directory sources (vendoring) label Apr 6, 2020
@epage
Copy link
Contributor

epage commented Oct 31, 2023

Something I've been considering is to evaluate all package.auto* variables during publish which should also include changing an implicit build.rs to an explicit package.build field. This would mean dropping files into a vendored registry package should have no effect, making things consistent and getting us closer the checksum encompassing everything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-scripts Area: build.rs scripts A-directory-source Area: directory sources (vendoring) Command-vendor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants