From 539a9069bf63d5ca82e286cf8376964409ebb088 Mon Sep 17 00:00:00 2001 From: Patrick Mulligan Date: Fri, 9 Jan 2026 23:10:58 +0100 Subject: [PATCH] fix(lamassu): explicitly rebuild problematic native modules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- modules/lamassu-lnbits.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/lamassu-lnbits.nix b/modules/lamassu-lnbits.nix index 946f495..45e62b4 100644 --- a/modules/lamassu-lnbits.nix +++ b/modules/lamassu-lnbits.nix @@ -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