From 7d1370d7f298273f3eafa17ca709514f6bcb9b8a Mon Sep 17 00:00:00 2001 From: maulanasdqn Date: Wed, 21 Jan 2026 18:39:05 +0700 Subject: [PATCH] fix(nix): run nx build in background to handle SIGABRT Background process signal handling allows wait to catch SIGABRT and || true to suppress the non-zero exit status. --- nix/mkViteApp.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nix/mkViteApp.nix b/nix/mkViteApp.nix index 50d71bc..8977905 100644 --- a/nix/mkViteApp.nix +++ b/nix/mkViteApp.nix @@ -28,10 +28,9 @@ pkgs.buildNpmPackage { export NX_NATIVE=false ${pkgs.lib.concatStringsSep "\n" (pkgs.lib.mapAttrsToList (k: v: "export ${k}=\"${v}\"") envVars)} # Run nx build, ignore terminal crash after successful build - # Disable errexit to handle SIGABRT from Nx terminal crash - set +e - ./node_modules/.bin/nx build ${name} --output-style=static - set -e + # Run in background and wait to handle SIGABRT from Nx terminal crash + ./node_modules/.bin/nx build ${name} --output-style=static & + wait $! || true # Verify the build output exists test -d dist/apps/${name} runHook postBuild