From 17a4fbd73db62098407e8d1fef6efaecf9f9784e Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sat, 15 Aug 2026 22:20:56 +0700 Subject: [PATCH] build(gateway): skip fixupPhase to kill 'patchelf: wrong ELF type' noise MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dontPatchELF only disabled the patchELF sub-phase; fixupPhase's shrinkELF step still emits the same error on the prebuilt .node addons and .o/.a object files in node_modules. Skip the entire fixupPhase (dontFixup = true) for the gateway — node is the external interpreter and .node addons are self-contained dlopen prebuilts, so Nix RPATH patching/stripping is neither needed nor wanted. --- flake.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/flake.nix b/flake.nix index 210f963..05a8daa 100644 --- a/flake.nix +++ b/flake.nix @@ -175,14 +175,16 @@ WRAPPER # do NOT let stdenv run its own cmake configure phase on the source. dontUseCmakeConfigure = true; - # The gateway bundles native node_modules (.node addons, plus .o/.a - # object files left in prebuilt dirs). stdenv's fixupPhase runs - # `patchELF` over $out and chokes on the non-ET_DYN ELF files, - # emitting hundreds of harmless "patchelf: wrong ELF type" lines. - # The real binary is node (external, already RPATH-fixed) and the - # .node addons are self-contained prebuilts loaded via dlopen, so - # Nix's RPATH patching is neither needed nor wanted here. - dontPatchELF = true; + # The gateway bundles native node_modules (.node addons plus .o/.a + # object files left in prebuilt dirs). stdenv's fixupPhase walks + # $out/node_modules and runs patchELF + shrinkELF over every ELF it + # finds, choking on the non-ET_DYN files (.o/.a) and the prebuilt + # .node addons — emitting hundreds of harmless "patchelf: wrong ELF + # type" lines per build. The real binary is node (external, already + # RPATH-fixed in its own derivation) and the .node addons are + # self-contained prebuilts loaded via dlopen, so Nix's fixup pass is + # neither needed nor wanted here. Skip it entirely. + dontFixup = true; buildPhase = pnpmInstall + '' echo "=== Building native voice deps ==="