From 1404cb5c7b9a0278f4e24575fda0e1c24e5ed8be Mon Sep 17 00:00:00 2001 From: Ivan Trubach Date: Wed, 3 Jul 2024 18:08:51 +0300 Subject: [PATCH] nodejs_22: fix missing /bin/bash in tests --- .../web/nodejs/bin-sh-node-run-v22.patch | 14 ++++++++++++++ pkgs/development/web/nodejs/v22.nix | 1 + 2 files changed, 15 insertions(+) create mode 100644 pkgs/development/web/nodejs/bin-sh-node-run-v22.patch diff --git a/pkgs/development/web/nodejs/bin-sh-node-run-v22.patch b/pkgs/development/web/nodejs/bin-sh-node-run-v22.patch new file mode 100644 index 000000000000..3fd142a3e440 --- /dev/null +++ b/pkgs/development/web/nodejs/bin-sh-node-run-v22.patch @@ -0,0 +1,14 @@ +Fixes test/parallel/test-node-run.js subtest. + +Note that this techinically depends on an impurity during build, see +also https://github.com/NixOS/nix/issues/6081. Currently stdenv allows +/bin/sh as an impure host dependency on Darwin, so we are guaranteed to +have it to certain degree, although it is very hacky. + +--- a/test/fixtures/run-script/node_modules/.bin/positional-args ++++ b/test/fixtures/run-script/node_modules/.bin/positional-args +@@ -1,3 +1,3 @@ +-#!/bin/bash ++#!/bin/sh + echo "Arguments: '$@'" + echo "The total number of arguments are: $#" diff --git a/pkgs/development/web/nodejs/v22.nix b/pkgs/development/web/nodejs/v22.nix index 0970732d22cd..4bc7c46c15ba 100644 --- a/pkgs/development/web/nodejs/v22.nix +++ b/pkgs/development/web/nodejs/v22.nix @@ -15,6 +15,7 @@ buildNodejs { ./bypass-darwin-xcrun-node16.patch ./node-npm-build-npm-package-logic.patch ./use-correct-env-in-tests.patch + ./bin-sh-node-run-v22.patch (fetchpatch2 { # Fixes OpenSSL 3.0.14 compatibility in tests. # See https://github.com/nodejs/node/pull/53373