From 921edecb8668cdb533acdd775f841f02c94f98b2 Mon Sep 17 00:00:00 2001 From: Enginex0 Date: Tue, 19 May 2026 04:11:46 +0100 Subject: [PATCH] chore(scripts): make package.sh find user-local cargo Gradle's buildRustCertgen task uses commandLine("cargo", ...), which ProcessBuilder resolves against the daemon's inherited PATH rather than the env injected via Exec.environment(). Non-login shells (CI, IDE-spawned terminals, fresh tmux panes) don't source the profile.d hook that prepends ~/.cargo/bin, so the daemon dies with "A problem occurred starting process 'command 'cargo''" even when rustup is installed. Prepending ~/.cargo/bin at script entry makes the script self-contained regardless of how the shell was launched. --- scripts/package.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/package.sh b/scripts/package.sh index 0f86106..7bae5b1 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -10,6 +10,12 @@ # ./scripts/package.sh --rust --release # build Rust crate first, then release set -euo pipefail +# Gradle's buildRustCertgen resolves `cargo` against the daemon's inherited PATH, +# not the env we inject via gradle's Exec.environment(). Prepend the per-user +# rustup install so non-login shells (CI, IDE-launched terminals, fresh tmux) +# still find it without sourcing /etc/profile.d/cargo-path.sh. +[ -d "$HOME/.cargo/bin" ] && PATH="$HOME/.cargo/bin:$PATH" + SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" OUT_DIR="$PROJECT_ROOT/out"