[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/04: build: Fix possible race condition in 'test-env'.
From: |
Ludovic Courtès |
Subject: |
02/04: build: Fix possible race condition in 'test-env'. |
Date: |
Sun, 22 Apr 2018 17:50:54 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 479c0e3f60f54e3c3a02f71efeb49119e20d2a96
Author: Ludovic Courtès <address@hidden>
Date: Sun Apr 22 23:14:42 2018 +0200
build: Fix possible race condition in 'test-env'.
Reported by Mark H Weaver <address@hidden>.
* build-aux/test-env.in: Add 'guile' invocation before 'guix download'
invocation to make sure 'guix-daemon' is listening.
---
build-aux/test-env.in | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/build-aux/test-env.in b/build-aux/test-env.in
index 4a422cf..52082c6 100644
--- a/build-aux/test-env.in
+++ b/build-aux/test-env.in
@@ -1,7 +1,7 @@
#!/bin/sh
# GNU Guix --- Functional package management for GNU
-# Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès
<address@hidden>
+# Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès
<address@hidden>
#
# This file is part of GNU Guix.
#
@@ -118,6 +118,18 @@ then
bootstrap_directory="@abs_top_builddir@/gnu/packages/bootstrap/@guix_system@"
if [ -d "$bootstrap_directory" ]
then
+ # Make sure 'guix-daemon' is listening before invoking 'guix
+ # download'.
+ "@abs_top_builddir@/pre-inst-env" "@GUILE@" -c \
+ '(use-modules (guix))
+(let loop ((i 10))
+ (catch #t
+ (lambda () (open-connection))
+ (lambda (key . args)
+ (if (zero? i)
+ (apply throw key args)
+ (begin (usleep 500000) (loop (- i 1)))))))'
+
for file in "$bootstrap_directory"/guile-*
do
"@abs_top_builddir@/pre-inst-env" \