summary refs log tree commit diff
path: root/pkgs/development/tools/build-managers
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-07-04 19:16:06 +0200
committersterni <sternenseemann@systemli.org>2021-07-04 20:20:42 +0200
commit2019f82e3ee5764ae2d63a53ef5a44310b7c7f77 (patch)
tree8a5de8c0fd8a33656a47929c8e14583af679f946 /pkgs/development/tools/build-managers
parent32c42d37ab6d45388fc713fe8312a50eade3d4b3 (diff)
downloadnixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.tar
nixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.tar.gz
nixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.tar.bz2
nixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.tar.lz
nixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.tar.xz
nixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.tar.zst
nixpkgs-2019f82e3ee5764ae2d63a53ef5a44310b7c7f77.zip
bmake: enable ksh test on non musl platforms
bmake runs the ksh test if /bin/ksh exists. This is never a good
indication on platforms where we can sandbox and causes problems on
darwin where this path may exist, but never would be in PATH.

We solve this problem by always enabling the test and adding ksh to
checkInputs.

ksh doesn't seem to compile with musl, so we disable it on that
platform.
Diffstat (limited to 'pkgs/development/tools/build-managers')
-rw-r--r--pkgs/development/tools/build-managers/bmake/default.nix15
-rw-r--r--pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch12
2 files changed, 24 insertions, 3 deletions
diff --git a/pkgs/development/tools/build-managers/bmake/default.nix b/pkgs/development/tools/build-managers/bmake/default.nix
index 11bc5889702..0d8ca351096 100644
--- a/pkgs/development/tools/build-managers/bmake/default.nix
+++ b/pkgs/development/tools/build-managers/bmake/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchurl, fetchpatch
-, getopt, tzdata
+, getopt, tzdata, ksh
 , pkgsMusl # for passthru.tests
 }:
 
@@ -14,9 +14,12 @@ stdenv.mkDerivation rec {
 
   # Make tests work with musl
   # * Disable deptgt-delete_on_error test (alpine does this too)
+  # * Disable shell-ksh test (ksh doesn't compile with musl)
   # * Fix test failing due to different strerror(3) output for musl and glibc
   postPatch = lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
-    sed -i unit-tests/Makefile -e '/deptgt-delete_on_error/d'
+    sed -i unit-tests/Makefile \
+      -e '/deptgt-delete_on_error/d' \
+      -e '/shell-ksh/d'
     substituteInPlace unit-tests/opt-chdir.exp --replace "File name" "Filename"
   '';
 
@@ -29,6 +32,8 @@ stdenv.mkDerivation rec {
     ./fix-unexport-env-test.patch
     # Fix localtime tests without global /etc/zoneinfo directory
     ./fix-localtime-test.patch
+    # Always enable ksh test since it checks in a impure location /bin/ksh
+    ./unconditional-ksh-test.patch
     # decouple tests from build phase
     (fetchpatch {
       name = "separate-tests.patch";
@@ -69,7 +74,11 @@ stdenv.mkDerivation rec {
   '';
 
   doCheck = true;
-  checkInputs = [ tzdata ];
+  checkInputs = [
+    tzdata
+  ] ++ lib.optionals (stdenv.hostPlatform.libc != "musl") [
+    ksh
+  ];
   checkPhase = ''
     runHook preCheck
 
diff --git a/pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch b/pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch
new file mode 100644
index 00000000000..117b85da16d
--- /dev/null
+++ b/pkgs/development/tools/build-managers/bmake/unconditional-ksh-test.patch
@@ -0,0 +1,12 @@
+--- bmake/unit-tests/Makefile.orig	2021-07-04 19:13:09.068094922 +0200
++++ bmake/unit-tests/Makefile	2021-07-04 19:13:14.630080696 +0200
+@@ -295,9 +295,7 @@
+ TESTS+=		sh-single-line
+ TESTS+=		shell-csh
+ TESTS+=		shell-custom
+-.if exists(/bin/ksh)
+ TESTS+=		shell-ksh
+-.endif
+ TESTS+=		shell-sh
+ TESTS+=		suff-add-later
+ TESTS+=		suff-clear-regular