fix(build-webview): add Nix profile paths to PATH so script finds pnpm

The Xcode build phase 'Build webview bundle' couldn't find pnpm when it
was installed under any standard Nix profile location (~/.nix-profile/bin,
/etc/profiles/per-user/$USER/bin, /run/current-system/sw/bin) — the
hard-coded PATH only listed Homebrew, /usr/local, ~/.local/bin, and nvm.

Add the three canonical Nix profile paths to the PATH export so the App-build
gate works identically for users on Homebrew, npm-global, nvm, OR Nix.
Updates the FATAL hint to mention Nix as a third install option.

Surfaced during Phase 6 Wave 4 verification: scripts/check-app-builds.sh
failed identically on develop and worktree with `pnpm not found`. Root
cause was environmental (pnpm uninstalled since prior session) but the
script's PATH was the latent fragility.
This commit is contained in:
james.maes committed 2026-04-27 14:08:13 -05:00
1 parent bd611c346d
commit a73c9aa352
1 file changed
+6 -2
+6 -2
View File
@@ -42,11 +42,15 @@ REPO_ROOT="$(dirname "$SCRIPT_DIR")"
# a terminal does). Homebrew + corepack-managed pnpm live outside the default
# /usr/bin:/bin minimal env Xcode uses for build phases. Prepend the common
# locations so this script works identically from CLI and from Xcode IDE.
export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$HOME/.nvm/versions/node:${PATH:-/usr/bin:/bin}"
# Nix profile paths are included so users on nix-darwin / home-manager /
# multi-user nix find pnpm regardless of which profile owns the symlink.
export PATH="/opt/homebrew/bin:/usr/local/bin:$HOME/.local/bin:$HOME/.nvm/versions/node:$HOME/.nix-profile/bin:/etc/profiles/per-user/$USER/bin:/run/current-system/sw/bin:${PATH:-/usr/bin:/bin}"
if ! command -v pnpm >/dev/null 2>&1; then
echo "[build-webview] FATAL: pnpm not found on PATH ($PATH)" >&2
echo "[build-webview] Install: brew install pnpm OR npm i -g pnpm" >&2
echo "[build-webview] Install: brew install pnpm" >&2
echo "[build-webview] OR npm i -g pnpm" >&2
echo "[build-webview] OR Nix: add 'pkgs.pnpm' to environment.systemPackages / home.packages" >&2
exit 1
fi