about summary refs log tree commit diff
path: root/scripts/build-remote.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-09-05T09·43+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-09-05T09·43+0200
commite74113a305edbbf1de6acc2560fbfded56299ed4 (patch)
treec0974078942507cc4b97566e83c40e6670b57b41 /scripts/build-remote.pl.in
parent9d65287b91afa5b64c19f64dda78f8385d6820f0 (diff)
Fix build-remote.pl
Apparently, turning on utf8 encoding on stderr changes its flushing
behaviour, causing sendReply to not send anything.

http://hydra.nixos.org/build/13944384
Diffstat (limited to 'scripts/build-remote.pl.in')
-rwxr-xr-xscripts/build-remote.pl.in5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/build-remote.pl.in b/scripts/build-remote.pl.in
index faf1616e9ac0..f74ba7886ed6 100755
--- a/scripts/build-remote.pl.in
+++ b/scripts/build-remote.pl.in
@@ -10,8 +10,11 @@ use Nix::CopyClosure;
 use Nix::Store;
 no warnings('once');
 
+STDERR->autoflush(1);
 binmode STDERR, ":encoding(utf8)";
 
+my $debug = defined $ENV{NIX_DEBUG_HOOK};
+
 
 # General operation:
 #
@@ -151,7 +154,7 @@ REQ: while (1) {
             }
         }
 
-        if (defined $ENV{NIX_DEBUG_HOOK}) {
+        if ($debug) {
             print STDERR "load on " . $_->{machine}->{hostName} . " = " . $_->{load} . "\n"
                 foreach @available;
         }