diff --git a/pkgs/build-support/builder-defs/builder-defs.nix b/pkgs/build-support/builder-defs/builder-defs.nix index 551ed9ea57e8..e21b032aacbe 100644 --- a/pkgs/build-support/builder-defs/builder-defs.nix +++ b/pkgs/build-support/builder-defs/builder-defs.nix @@ -336,7 +336,7 @@ let inherit (builtins) head tail trace; in doDump = n: noDepEntry "echo Dump number ${n}; set"; - saveEnv = noDepEntry ''export > $TMP/env-vars''; + saveEnv = noDepEntry ''export > "$TMP/env-vars" || true''; doDumpBuildInputs = noDepEntry ('' echo "${toString realBuildInputs}" diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh index 57875fa6ada2..a01af7db70a3 100644 --- a/pkgs/stdenv/generic/setup.sh +++ b/pkgs/stdenv/generic/setup.sh @@ -450,7 +450,7 @@ substituteAllInPlace() { # the environment used for building. dumpVars() { if [ "$noDumpEnvVars" != 1 ]; then - export > "$NIX_BUILD_TOP/env-vars" + export > "$NIX_BUILD_TOP/env-vars" || true fi }