Visitar URL original
Update "Rust - Cargo" example by smoelius · Pull Request #1799 · actions/cache · GitHub
Skip to content

Update "Rust - Cargo" example - #1799

Open
smoelius wants to merge 1 commit into
actions:mainfrom
smoelius:update-rust-cargo-example
Open

smoelius wants to merge 1 commit into
actions:mainfrom
smoelius:update-rust-cargo-example

Conversation

@smoelius

Copy link
Copy Markdown

This PR brings the "Rust - Cargo" example inline with the Cargo book.

Supersedes #1167.

Description

This PR adds entries for files .crates.toml and .crates2.json to the existing four directories:

* `.crates.toml`
* `.crates2.json`
* `bin/`
* `registry/index/`
* `registry/cache/`
* `git/db/`

Motivation and Context

Not having those files cached can cause spurious errors. For example, suppose one has cargo-expand@1.0.125 installed and one tries to install cargo-expand@1.0.126 with the command cargo install cargo-expand. With the files cached, the installation completes successfully. Without it, one could see an error like this:

error: binary `cargo-expand` already exists in destination

How Has This Been Tested?

Here are two workflows demonstrating the above claims:

For reference, here is a comparison of the two branches on which the workflows were run: smoelius/cache-experiment@main...with-crates-toml-crates2-json

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@smoelius
smoelius requested a review from a team as a code owner September 26, 2026 00:52

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant