Skip to content

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

Closed

Description

@glandium

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.

Activity

  1. glandium commented on Jul 26, 2018

    @glandium
    ContributorAuthor

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

    Cc: @alexcrichton

  2. alexcrichton commented on Jul 26, 2018

    @alexcrichton
    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

  3. 0Grit commented on Jan 14, 2019

    @0Grit

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

  4. alexcrichton commented on Jan 14, 2019

    @alexcrichton
    Member

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

  5. epage commented on Oct 31, 2023

    @epage
    Contributor

    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.

  6. added a commit that references this issue on Apr 29, 2024
    ba6fb40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions