From c04c410fadc9d73db4555754e41530ef5243add1 Mon Sep 17 00:00:00 2001 From: asepharyana Date: Sat, 15 Aug 2026 22:11:58 +0700 Subject: [PATCH] build(gateway): suppress harmless 'patchelf: wrong ELF type' noise Add dontPatchELF = true to the discord-gateway derivation. Nix's fixupPhase runs patchELF over $out/node_modules and chokes on the non-ET_DYN ELF files (.o/.a objects + prebuilt .node addons), emitting hundreds of non-fatal 'patchelf: wrong ELF type' lines per build. The real binary is node (external, RPATH-fixed) and the .node addons are self-contained prebuilts loaded via dlopen, so Nix RPATH patching is neither needed nor wanted. Shebang patching still runs. --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index 6b0266f..210f963 100644 --- a/flake.nix +++ b/flake.nix @@ -175,6 +175,15 @@ 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; + buildPhase = pnpmInstall + '' echo "=== Building native voice deps ===" # pnpm rebuild aborts on the first failing package and runs scripts