Merge pull request #200917 from SuperSandro2000/succeedOnFailure

stdenv: fix succeedOnFailure
This commit is contained in:
Robert Hensing
2022-11-15 09:25:10 +01:00
committed by GitHub
3 changed files with 20 additions and 1 deletions
+5
View File
@@ -175,6 +175,11 @@ let
# without running any commands. Because this will also skip `shopt -s extglob`
# commands and extglob affects the Bash parser, we enable extglob always.
shellDryRun = "${stdenv.shell} -n -O extglob";
tests = {
succeedOnFailure = import ../tests/succeedOnFailure.nix { inherit stdenv; };
};
passthru.tests = lib.warn "Use `stdenv.tests` instead. `passthru` is a `mkDerivation` detail." stdenv.tests;
}
# Propagate any extra attributes. For instance, we use this to
+1 -1
View File
@@ -144,7 +144,7 @@ exitHandler() {
echo "build failed with exit code $exitCode (ignored)"
mkdir -p "$out/nix-support"
printf "%s" "$exitCode" > "$out/nix-support/failed"
return 0
exit 0
fi
else
+14
View File
@@ -0,0 +1,14 @@
{ stdenv }:
stdenv.mkDerivation {
name = "stdenv-test-succeedOnFailure";
succeedOnFailure = true;
passAsFile = [ "buildCommand" ];
buildCommand = ''
mkdir $out
echo foo > $out/foo
exit 1
'';
}