Skip to content

docs: link rust cache issue#482

Closed
risu729 wants to merge 3 commits into
jdx:mainfrom
risu729:docs/rust-cache-known-issue
Closed

docs: link rust cache issue#482
risu729 wants to merge 3 commits into
jdx:mainfrom
risu729:docs/rust-cache-known-issue

Conversation

@risu729
Copy link
Copy Markdown
Contributor

@risu729 risu729 commented May 18, 2026

Summary

  • add a short README link to the known Rust cache issue
  • avoid documenting a workaround in the README

Test plan

  • mise run lint
  • git diff --check

@risu729
Copy link
Copy Markdown
Contributor Author

risu729 commented May 18, 2026

CI note: the failing Check dist/, build, and test-redacted-env jobs are failing during the setup mise install step before this README-only change is exercised. The error is:

aube@1.9.1 has no provenance verification on linux-x64, but aube@1.6.2 had github-attestations

That appears unrelated to this PR; the local README change was checked with mise run lint and git diff --check.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a section to the README documentation regarding Rust toolchain caching to prevent issues with missing components like clippy or rustfmt. The review feedback highlights the need for cross-platform compatibility in the shell examples, clarifies that the suggested paths depend on the mise data directory location, and identifies that the cache-bin option for Swatinem/rust-cache is invalid and should be removed along with its explanation.

Comment thread README.md
Comment on lines +112 to +113
- name: Configure mise Rust homes
run: |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The shell command group syntax { ... } and the use of ${HOME} are specific to POSIX-compliant shells (like bash or sh). This step will fail on Windows runners where the default shell is PowerShell. To ensure this example works across all platforms supported by mise-action, it is recommended to explicitly specify the shell.

Suggested change
- name: Configure mise Rust homes
run: |
- name: Configure mise Rust homes
shell: bash
run: |

Comment thread README.md
Comment on lines +115 to +116
echo "MISE_RUSTUP_HOME=${HOME}/.local/share/mise/rustup"
echo "MISE_CARGO_HOME=${HOME}/.local/share/mise/cargo"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The paths ${HOME}/.local/share/mise/rustup and ${HOME}/.local/share/mise/cargo assume the default mise data directory. If a user has customized their installation using the mise_dir input, MISE_DATA_DIR, or XDG_DATA_HOME, these paths will be outside the directory cached by mise-action, and the workaround will not function. It is worth adding a note that these paths must be subdirectories of the actual mise data directory being cached.

Comment thread README.md
Comment on lines +124 to +126
- uses: Swatinem/rust-cache@v2
with:
cache-bin: "false"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The cache-bin input is not a valid option for Swatinem/rust-cache@v2. Additionally, rust-cache does not cache the Cargo binary directory (~/.cargo/bin) by default, so this setting is unnecessary. Including it will result in a warning from GitHub Actions regarding an unknown input.

Suggested change
- uses: Swatinem/rust-cache@v2
with:
cache-bin: "false"
- uses: Swatinem/rust-cache@v2

Comment thread README.md Outdated
Comment on lines +132 to +133
Cargo registry, git dependency, and `target` build caches; `cache-bin: "false"`
keeps Cargo binaries owned by the mise cache instead of both caches.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since cache-bin is not a valid input for Swatinem/rust-cache, this part of the explanation should be removed to avoid confusion. Furthermore, moving CARGO_HOME inside the mise data directory means mise-action will already be caching the Cargo registry and git dependencies. While rust-cache will also attempt to cache these (creating some redundancy), its primary remaining value in this setup is caching the project's target directory.

Suggested change
Cargo registry, git dependency, and `target` build caches; `cache-bin: "false"`
keeps Cargo binaries owned by the mise cache instead of both caches.
Cargo registry, git dependency, and target build caches.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR adds a new "Rust Toolchain Caches" section to the README that explains why mise's Rust installations can silently lose rustup components when the mise cache is restored, and provides a workflow-level workaround.

  • Documents the root cause: mise caches installs/rust but the actual toolchains and proxy binaries live in RUSTUP_HOME/CARGO_HOME, which by default are outside the cached directory.
  • Shows how to redirect MISE_RUSTUP_HOME and MISE_CARGO_HOME into the mise data directory via GITHUB_ENV, rotate the cache key to bust stale marker-only caches, and configure Swatinem/rust-cache with cache-bin: "false" to avoid ownership conflicts.

Confidence Score: 5/5

Pure documentation change with no executable code modified; the described env vars and template syntax are verified correct.

The change only edits README.md prose and a YAML workflow snippet. The env vars MISE_RUSTUP_HOME and MISE_CARGO_HOME are confirmed valid by the official mise docs. The {{default}} template variable and cache_key input are already used elsewhere in the README and tested in the action. No logic, action code, or configuration files are touched.

No files require special attention.

Important Files Changed

Filename Overview
README.md Adds a new 'Rust Toolchain Caches' section explaining the rustup/cargo home problem and documenting the MISE_RUSTUP_HOME/MISE_CARGO_HOME workaround with a cache-key rotation hint.

Reviews (3): Last reviewed commit: "docs: clarify rust cache workaround" | Re-trigger Greptile

Comment thread README.md
@risu729
Copy link
Copy Markdown
Contributor Author

risu729 commented May 18, 2026

Follow-up on the bot review:

  • Added shell: bash to the example and documented that the Rust homes must stay under the actual mise data directory when mise_dir, MISE_DATA_DIR, or XDG_DATA_HOME is customized: 1ea046b
  • Keeping cache-bin: "false": it is a valid Swatinem/rust-cache@v2 input (action.yml defines cache-bin), and it was accepted in the verified biwa CI run without an unknown-input warning. The purpose here is to keep Cargo binaries/proxies owned by the mise cache while still allowing rust-cache to handle Rust build/dependency cache paths.

@risu729
Copy link
Copy Markdown
Contributor Author

risu729 commented May 18, 2026

We shouldn't document this.

@risu729 risu729 closed this May 18, 2026
@risu729 risu729 deleted the docs/rust-cache-known-issue branch May 18, 2026 19:25
@risu729 risu729 changed the title docs: document rust cache workaround docs: link rust cache issue May 19, 2026
@risu729
Copy link
Copy Markdown
Contributor Author

risu729 commented May 19, 2026

Reopening with the narrowed README-only issue link; workaround text has been removed.

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