mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
Merge pull request #5167 from Ma27/keep-failed-on-ssh-remote-build
nix-store --serve: pass on `settings.keepFailed` from SSH store
This commit is contained in:
commit
7cc220825d
5 changed files with 43 additions and 1 deletions
|
@ -53,3 +53,16 @@ nix path-info --store $TEST_ROOT/machine3 --all \
|
|||
| grep -v builder-build-remote-input-1.sh \
|
||||
| grep -v builder-build-remote-input-2.sh \
|
||||
| grep builder-build-remote-input-3.sh
|
||||
|
||||
# Behavior of keep-failed
|
||||
out="$(nix-build 2>&1 failing.nix \
|
||||
--builders "$(join_by '; ' "${builders[@]}")" \
|
||||
--keep-failed \
|
||||
--store $TEST_ROOT/machine0 \
|
||||
-j0 \
|
||||
--arg busybox $busybox)" || true
|
||||
|
||||
[[ "$out" =~ .*"note: keeping build directory".* ]]
|
||||
|
||||
build_dir="$(grep "note: keeping build" <<< "$out" | sed -E "s/^(.*)note: keeping build directory '(.*)'(.*)$/\2/")"
|
||||
[[ "foo" = $(<"$build_dir"/bar) ]]
|
||||
|
|
22
tests/failing.nix
Normal file
22
tests/failing.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ busybox }:
|
||||
with import ./config.nix;
|
||||
let
|
||||
|
||||
mkDerivation = args:
|
||||
derivation ({
|
||||
inherit system;
|
||||
builder = busybox;
|
||||
args = ["sh" "-e" args.builder or (builtins.toFile "builder-${args.name}.sh" "if [ -e .attrs.sh ]; then source .attrs.sh; fi; eval \"$buildCommand\"")];
|
||||
} // removeAttrs args ["builder" "meta"])
|
||||
// { meta = args.meta or {}; };
|
||||
in
|
||||
{
|
||||
|
||||
failing = mkDerivation {
|
||||
name = "failing";
|
||||
buildCommand = ''
|
||||
echo foo > bar
|
||||
exit 1
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue