Skip to content

Commit 37fd360

Browse files
fix(cargo): symlink tools to rustup binary instead of mise install dir
The mise rust install dir contains relative `cargo -> rustup` symlinks that break when rustup isn't in the same directory. Symlink directly to `$CARGO_HOME/bin/rustup` (the real multicall binary) instead. Move implementation rationale from shell comments to AGENTS.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cf09f50 commit 37fd360

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

AGENTS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ Database: `mt.db`, Logs: see [Observability](docs/observability.md)
7070

7171
See [Tauri Architecture](docs/tauri-architecture.md) for full details.
7272

73+
### Rust Toolchain (mise + rustup)
74+
75+
mise manages the Rust version (via `.tool-versions`) but delegates to rustup under the hood. The mise install directory (`~/.local/share/mise/installs/rust/<version>/`) contains symlinks like `cargo -> rustup` — these are rustup multicall symlinks that require the `rustup` binary to be resolvable. The `cargo:_setup-cargo-home` task in `taskfiles/cargo.yml` creates `$CARGO_HOME/bin` symlinks pointing directly at `$CARGO_HOME/bin/rustup` (the real binary) rather than chaining through the mise install dir, which would break if the relative `rustup` target is missing.
76+
7377
## Queue and Shuffle Behavior
7478

7579
The queue store (`app/frontend/js/stores/queue.js`) maintains tracks in **play order** — the `items` array always reflects the order tracks will be played.

taskfiles/cargo.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ tasks:
99
desc: "Create CARGO_HOME/bin symlinks so mise shims resolve correctly"
1010
cmds:
1111
- |
12-
rust_dir="$(mise where rust)"
1312
cargo_bin="$CARGO_HOME/bin"
1413
mkdir -p "$cargo_bin"
14+
rustup_bin="$cargo_bin/rustup"
15+
if [[ ! -x "$rustup_bin" ]]; then
16+
echo "error: rustup not found at $rustup_bin" >&2
17+
exit 1
18+
fi
1519
for tool in cargo cargo-clippy cargo-fmt rustc rustdoc rustfmt; do
16-
ln -sf "$rust_dir/$tool" "$cargo_bin/$tool"
20+
ln -sf "$rustup_bin" "$cargo_bin/$tool"
1721
done
1822
status:
1923
- test -L "$CARGO_HOME/bin/cargo" && test -e "$CARGO_HOME/bin/cargo"

0 commit comments

Comments
 (0)