From 00370cfb34feba582f3503775289d061c7e1ecc0 Mon Sep 17 00:00:00 2001 From: zackees Date: Thu, 11 Jun 2026 20:27:18 -0700 Subject: [PATCH] fix(lint): default RUSTUP_HOME for cargo-dylint 6.x driver check cargo-dylint 6.x fails with "environment variable not found: RUSTUP_HOME" when the variable is not exported. CI exports it, but local shells typically rely on rustup's implicit default, so bash lint failed on dev machines. Derive it from `rustup show home` when unset. Co-Authored-By: Claude Opus 4.7 --- lint | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lint b/lint index 0d57288b..1937f809 100755 --- a/lint +++ b/lint @@ -29,6 +29,10 @@ if [ -z "$RUSTUP_BIN" ]; then echo "Error: rustup is required for cargo-dylint's internal driver build" >&2 exit 1 fi +# cargo-dylint 6.x's driver toolchain check requires RUSTUP_HOME to be set +# explicitly; CI exports it but local shells typically rely on rustup's +# implicit default and fail with "environment variable not found: RUSTUP_HOME". +export RUSTUP_HOME="${RUSTUP_HOME:-$("$RUSTUP_BIN" show home)}" RUSTUP_BIN_DIR="$(dirname "$RUSTUP_BIN")" DYLINT_CARGO_SHIM_DIR="$(mktemp -d)" DYLINT_PREVIOUS_DEFAULT="$(rustup default 2>/dev/null | sed 's/ (default)$//')"