summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Peebles <pumpkin@me.com>2018-09-16 13:53:45 -0400
committerDan Peebles <pumpkin@me.com>2018-09-16 14:22:29 -0400
commit88a969d1b764968de26ad93f140cd6f35c9e90db (patch)
treeee04a2789b31c78d257b49744ee3a9d01362fff0
parent4efd4053ed183d63f09615cf30ea822e708a4fbe (diff)
top-level/release.nix: add patchShebangs test
This is currently failing but nobody noticed!
-rw-r--r--pkgs/test/default.nix2
-rw-r--r--pkgs/test/patch-shebangs/default.nix26
-rw-r--r--pkgs/top-level/release.nix3
3 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix
index 774077949b25..eb7fd82b945c 100644
--- a/pkgs/test/default.nix
+++ b/pkgs/test/default.nix
@@ -27,4 +27,6 @@ with pkgs;
macOSSierraShared = callPackage ./macos-sierra-shared {};
cross = callPackage ./cross {};
+
+ patch-shebangs = callPackage ./patch-shebangs {};
}
diff --git a/pkgs/test/patch-shebangs/default.nix b/pkgs/test/patch-shebangs/default.nix
new file mode 100644
index 000000000000..a82e5e1e1982
--- /dev/null
+++ b/pkgs/test/patch-shebangs/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, runCommand }:
+
+let
+ bad-shebang = stdenv.mkDerivation {
+ name = "bad-shebang";
+ unpackPhase = ":";
+ installPhase = ''
+ mkdir -p $out/bin
+ echo "#!/bin/sh" > $out/bin/test
+ echo "echo -n hello" >> $out/bin/test
+ chmod +x $out/bin/test
+ '';
+ };
+in runCommand "patch-shebangs-test" {
+ passthru = { inherit bad-shebang; };
+ meta.platforms = stdenv.lib.platforms.all;
+} ''
+ printf "checking whether patchShebangs works properly... ">&2
+ if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then
+ echo "yes" >&2
+ touch $out
+ else
+ echo "no" >&2
+ exit 1
+ fi
+'' \ No newline at end of file
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 6ebc640ea219..93400bf0ee65 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -77,6 +77,7 @@ let
jobs.tests.cc-wrapper-libcxx-39.x86_64-darwin
jobs.tests.stdenv-inputs.x86_64-darwin
jobs.tests.macOSSierraShared.x86_64-darwin
+ jobs.tests.patch-shebangs.x86_64-darwin
];
} else null;
@@ -119,6 +120,7 @@ let
jobs.tests.cc-multilib-gcc.x86_64-linux
jobs.tests.cc-multilib-clang.x86_64-linux
jobs.tests.stdenv-inputs.x86_64-linux
+ jobs.tests.patch-shebangs.x86_64-linux
]
++ lib.collect lib.isDerivation jobs.stdenvBootstrapTools
++ lib.optionals supportDarwin [
@@ -148,6 +150,7 @@ let
jobs.tests.cc-wrapper-libcxx-6.x86_64-darwin
jobs.tests.stdenv-inputs.x86_64-darwin
jobs.tests.macOSSierraShared.x86_64-darwin
+ jobs.tests.patch-shebangs.x86_64-darwin
];
};