-
-
Notifications
You must be signed in to change notification settings - Fork 62
docs: link rust cache issue #482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -94,6 +94,47 @@ You can also extend the default cache key: | |||||||||
|
|
||||||||||
| This gives you full control over cache invalidation based on the specific aspects that matter to your workflow. | ||||||||||
|
|
||||||||||
| ### Rust Toolchain Caches | ||||||||||
|
|
||||||||||
| Rust is managed differently from most mise tools. mise wraps `rustup`, so the | ||||||||||
| mise cache can restore the `installs/rust` entry while the actual rustup | ||||||||||
| toolchain and components still live in `RUSTUP_HOME` and Cargo/rustup proxy | ||||||||||
| binaries live in `CARGO_HOME`. If those homes are not restored with the mise | ||||||||||
| cache, `mise install` can skip Rust and later `cargo fmt` or `cargo clippy` | ||||||||||
| can fail with missing `rustfmt` or `clippy` components. See | ||||||||||
| [jdx/mise-action#215](https://github.com/jdx/mise-action/issues/215). | ||||||||||
|
|
||||||||||
| If `mise-action` installs Rust and you keep the mise cache enabled, configure | ||||||||||
| mise's Rust homes under the mise data directory before running this action, and | ||||||||||
| change the cache key so older Rust-marker-only caches are not reused: | ||||||||||
|
|
||||||||||
| ```yaml | ||||||||||
| - 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" | ||||||||||
|
Comment on lines
+116
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The paths |
||||||||||
| } >> "${GITHUB_ENV}" | ||||||||||
|
greptile-apps[bot] marked this conversation as resolved.
|
||||||||||
|
|
||||||||||
| - uses: jdx/mise-action@v4 | ||||||||||
| with: | ||||||||||
| install: true | ||||||||||
| cache_key: "{{default}}-rustup-cargo-home-v2" | ||||||||||
|
|
||||||||||
| - uses: Swatinem/rust-cache@v2 | ||||||||||
| with: | ||||||||||
| cache-bin: "false" | ||||||||||
|
Comment on lines
+125
to
+127
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Suggested change
|
||||||||||
| ``` | ||||||||||
|
|
||||||||||
| `MISE_RUSTUP_HOME` and `MISE_CARGO_HOME` make mise place rustup toolchains, | ||||||||||
| rustup metadata, and Cargo/rustup proxy binaries inside the directory saved by | ||||||||||
| the mise cache. If you set `mise_dir`, `MISE_DATA_DIR`, or `XDG_DATA_HOME`, | ||||||||||
| adjust these paths so they stay under the mise data directory that this action | ||||||||||
| caches. `Swatinem/rust-cache` can still be used after `mise-action` for Cargo | ||||||||||
| registry, git dependency, and `target` build caches; `cache-bin: "false"` keeps | ||||||||||
| Cargo binaries owned by the mise cache instead of both caches. | ||||||||||
|
|
||||||||||
| ## GitHub API Rate Limits | ||||||||||
|
|
||||||||||
| When installing tools hosted on GitHub (like `gh`, `node`, `bun`, etc.), mise needs to make API calls to GitHub's releases API. Without authentication, these calls are subject to GitHub's rate limit of 60 requests per hour, which can cause installation failures. | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 bymise-action, it is recommended to explicitly specify the shell.