Skip to content

Commit bfdae71

Browse files
zsoerenmclaude
andcommitted
fix: use robust rolldown shim from PR openclaw#63
Replaces the simpler .pnpm/node_modules/.bin PATH addition with a proper shell shim that locates rolldown in the pnpm store and creates a wrapper script. This handles the case where rolldown was removed from upstream direct dependencies (v2026.2.21+) but remains as a transitive dep via rolldown-plugin-dts. Cherry-picked approach from openclaw#63. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 866271e commit bfdae71

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

nix/scripts/gateway-build.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,18 @@ fi
7272

7373
log_step "patchShebangs node_modules/.bin" bash -e -c ". \"$STDENV_SETUP\"; patchShebangs node_modules/.bin"
7474

75-
# Ensure rolldown is found from workspace bins in offline/sandbox builds.
76-
if [ -d "node_modules/.pnpm/node_modules/.bin" ]; then
77-
export PATH="$PWD/node_modules/.pnpm/node_modules/.bin:$PATH"
75+
# rolldown was removed from upstream direct dependencies (v2026.2.21+) but
76+
# remains in the pnpm store as a transitive dep (via rolldown-plugin-dts).
77+
# Upstream's bundle-a2ui.sh falls back to `pnpm dlx` which needs network.
78+
# Put rolldown on PATH so the script finds it directly.
79+
if ! command -v rolldown >/dev/null 2>&1; then
80+
_rolldown_pkg="$(find node_modules/.pnpm -maxdepth 4 -path '*/rolldown@*/node_modules/rolldown' -print -quit 2>/dev/null || true)"
81+
if [ -n "$_rolldown_pkg" ] && [ -f "$_rolldown_pkg/bin/cli.mjs" ]; then
82+
_rolldown_shim="$(mktemp -d)"
83+
printf '#!/bin/sh\nexec node "%s/bin/cli.mjs" "$@"\n' "$_rolldown_pkg" > "$_rolldown_shim/rolldown"
84+
chmod +x "$_rolldown_shim/rolldown"
85+
export PATH="$_rolldown_shim:$PATH"
86+
fi
7887
fi
7988

8089
# Break down `pnpm build` (upstream package.json) so we can profile it.

0 commit comments

Comments
 (0)