From f921dc552226470290aa5bfb368c9d0f4ea9776f Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Fri, 26 Sep 2025 17:44:56 +0200 Subject: [PATCH] hyper-cmd-utils: fix runtime w/ glibc-2.42 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same issue as with hypershell, `sodium-native.node` wrongly requests an executable stack and is dlopened into a process with a non-executable stack. No smoke-test as install-check here since this beautiful piece of software returns a non-zero exit code on `--help` 🤡 --- pkgs/by-name/hy/hyper-cmd-utils/package.nix | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkgs/by-name/hy/hyper-cmd-utils/package.nix b/pkgs/by-name/hy/hyper-cmd-utils/package.nix index 41d922e864c3..d6df4ccfb14f 100644 --- a/pkgs/by-name/hy/hyper-cmd-utils/package.nix +++ b/pkgs/by-name/hy/hyper-cmd-utils/package.nix @@ -3,6 +3,7 @@ lib, fetchurl, fetchFromGitHub, + patchelfUnstable, }: buildNpmPackage { @@ -30,6 +31,23 @@ buildNpmPackage { }) ]; + nativeBuildInputs = [ + patchelfUnstable # --clear-execstack is only available on 0.18 + ]; + + postInstall = '' + # glibc 2.41+ refuses to make the stack executable if it isn't executable, + # but a library loaded via `dlopen()` mandates it. + # According to https://github.com/holepunchto/sodium-native/issues/214 + # this isn't necessary in this case. + while IFS= read -r -d ''' file; do + # Skip PEs with the same name + if patchelf --print-rpath "$file" &>/dev/null; then + patchelf "$file" --clear-execstack + fi + done < <(find $out/lib/node_modules -name 'sodium-native.node' -print0) + ''; + meta = { description = "HyperCmd Utils"; homepage = "https://github.com/holepunchto/hyper-cmd-utils";