docs: link rust cache issue#482
Conversation
|
CI note: the failing That appears unrelated to this PR; the local README change was checked with |
There was a problem hiding this comment.
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.
| - name: Configure mise Rust homes | ||
| run: | |
There was a problem hiding this comment.
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.
| - name: Configure mise Rust homes | |
| run: | | |
| - name: Configure mise Rust homes | |
| shell: bash | |
| run: | |
| echo "MISE_RUSTUP_HOME=${HOME}/.local/share/mise/rustup" | ||
| echo "MISE_CARGO_HOME=${HOME}/.local/share/mise/cargo" |
There was a problem hiding this comment.
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.
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| cache-bin: "false" |
There was a problem hiding this comment.
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.
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-bin: "false" | |
| - uses: Swatinem/rust-cache@v2 |
| Cargo registry, git dependency, and `target` build caches; `cache-bin: "false"` | ||
| keeps Cargo binaries owned by the mise cache instead of both caches. |
There was a problem hiding this comment.
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.
| 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 SummaryThis 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.
Confidence Score: 5/5Pure 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
Reviews (3): Last reviewed commit: "docs: clarify rust cache workaround" | Re-trigger Greptile |
|
Follow-up on the bot review:
|
|
We shouldn't document this. |
|
Reopening with the narrowed README-only issue link; workaround text has been removed. |
Summary
Test plan
mise run lintgit diff --check