From c5fef87af8cba674198cd55ab1153d586db18080 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 25 Jul 2017 12:32:37 +0200 Subject: writeOut: don't modify stdenv's shell This fixes following (and maybe more) issues: - /nix/store/*-stdenv/setup: line 125: showBuildStats: unbound variable - /nix/store/*-stdenv/setup: line 69: !hookName: unbound variable --- krebs/5pkgs/writers.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'krebs/5pkgs') diff --git a/krebs/5pkgs/writers.nix b/krebs/5pkgs/writers.nix index 49ca3557e..f1626078e 100644 --- a/krebs/5pkgs/writers.nix +++ b/krebs/5pkgs/writers.nix @@ -144,9 +144,14 @@ with import ; env = filevars // { passAsFile = attrNames filevars; }; in + # Use a subshell because 's genericBuild + # sources (or evaluates) the buildCommand and we don't want to modify its + # shell. In particular, exitHandler breaks in multiple ways with set -u. pkgs.runCommand name env /* sh */ '' - set -efu - ${concatMapStringsSep "\n" (getAttr "install") files} + ( + set -efu + ${concatMapStringsSep "\n" (getAttr "install") files} + ) ''; writeHaskell = -- cgit v1.2.3