fix(lamassu): explicitly rebuild problematic native modules
Some checks failed
nix-bitcoin tests / build_test_drivers (push) Has been cancelled
nix-bitcoin tests / check_flake (push) Has been cancelled
nix-bitcoin tests / test_scenario (default) (push) Has been cancelled
nix-bitcoin tests / test_scenario (joinmarket-bitcoind-29) (push) Has been cancelled
nix-bitcoin tests / test_scenario (netns) (push) Has been cancelled
nix-bitcoin tests / test_scenario (netnsRegtest) (push) Has been cancelled

pnpm rebuild often fails to properly build node-expat, iconv, and
argon2 native modules. This adds an explicit loop to rebuild these
specific modules using node-gyp after the general pnpm rebuild.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-01-09 23:10:58 +01:00
parent 104304507e
commit 539a9069bf

View file

@ -415,6 +415,17 @@ in
# Run rebuild separately - this compiles native modules
pnpm rebuild || echo "Warning: Some native modules failed to build, continuing anyway..."
# Explicitly rebuild problematic native modules that pnpm rebuild may miss
# These modules often fail to build during pnpm rebuild due to missing toolchain in PATH
echo "==> Rebuilding specific native modules..."
for module in node-expat iconv argon2; do
module_path=$(find node_modules/.pnpm -name "$module" -type d -path "*/$module" 2>/dev/null | head -1)
if [ -n "$module_path" ] && [ -f "$module_path/binding.gyp" ]; then
echo " Rebuilding $module at $module_path..."
(cd "$module_path" && npx node-gyp rebuild 2>&1) || echo " Warning: $module rebuild failed, continuing..."
fi
done
echo "==> Building project..."
# Bypass pnpm and call turbo directly to avoid pnpm signal handling issues
# See: https://github.com/pnpm/pnpm/issues/7374