Skip to content

Suggested cache set is insufficient for cargo install #8841

@wchargin

Description

@wchargin

From the “Cargo Home” docs page (live, source), referring to what
directories should be cached in CI:

It should be sufficient to only cache the following directories across builds:

  • bin/
  • registry/index/
  • registry/cache/
  • git/db/

This doesn’t seem to be sufficient when the job runs cargo install to
install tools, like Cargo subcommands (e.g., cargo-raze). If a job
installs a binary and only caches these directories, a re-run of the job
will fail at cargo install time with

error: binary `cargo-raze` already exists in destination
Add --force to overwrite

because the binary exists but Cargo has no record that it has been
installed. Sample failure:
https://github.com/tensorflow/tensorboard/runs/1367174061

It sufficed for me to also cache .crates.toml and .crates2.json.
Maybe only the former is needed; I included the latter to be safe.
Especially since these are dotfiles, it would be nice to document that
they, too, should be cached.

I would submit a patch, but I don’t know exactly what the right
recommendation is.


cargo version 1.47.0 on Linux (Debian/Ubuntu)

Activity

wchargin

wchargin commented on Nov 8, 2020

@wchargin
Author

@rustbot modify labels: A-documenting-cargo-itself

rustbot

rustbot commented on Nov 8, 2020

@rustbot
Collaborator

Error: The feature relabel is not enabled in this repository.
To enable it add its section in the triagebot.toml in the root of the repository.

Please let @rust-lang/release know if you're having trouble with this bot.

added a commit that references this issue on Dec 18, 2022
weihanglo

weihanglo commented on Oct 11, 2024

@weihanglo
Member

This has been fixed by #11592

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

        Participants

        @ehuss@wchargin@weihanglo@rustbot

        Issue actions

          Suggested cache set is insufficient for `cargo install` · Issue #8841 · rust-lang/cargo