Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/build-remote/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,17 @@ static int main_build_remote(int argc, char * * argv)
drv.inputSrcs = store->parseStorePathSet(inputs);
optResult = sshStore->buildDerivation(*drvPath, (const BasicDerivation &) drv);
auto & result = *optResult;
if (!result.success())
if (!result.success()) {
if (settings.keepFailed) {
warn(
"The failed build directory was kept on the remote builder due to `--keep-failed`.%s",
(settings.thisSystem == drv.platform || settings.extraPlatforms.get().count(drv.platform) > 0)
? " You can re-run the command with `--builders ''` to disable remote building for this invocation."
: ""
);
}
throw Error("build of '%s' on '%s' failed: %s", store->printStorePath(*drvPath), storeUri, result.errorMsg);
}
} else {
copyClosure(*store, *sshStore, StorePathSet {*drvPath}, NoRepair, NoCheckSigs, substitute);
auto res = sshStore->buildPathsWithResults({
Expand Down
1 change: 1 addition & 0 deletions tests/functional/build-remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ out="$(nix-build 2>&1 failing.nix \
--arg busybox "$busybox")" || true

[[ "$out" =~ .*"note: keeping build directory".* ]]
[[ "$out" =~ .*"The failed build directory was kept on the remote builder due to".* ]]

build_dir="$(grep "note: keeping build" <<< "$out" | sed -E "s/^(.*)note: keeping build directory '(.*)'(.*)$/\2/")"
[[ "foo" = $(<"$build_dir"/bar) ]]
Loading