diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-04-14 00:24:24 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-04-14 00:24:24 +0200 |
commit | 30ce8012cd6265b12f756283633be94a547bf990 (patch) | |
tree | cfa2c57eb6bc43c0dda8ce1675230656fca18656 /guix/utils.scm | |
parent | 66ef5411471e8d5f25815b9ab1f360ad56e08544 (diff) | |
download | gnu-guix-30ce8012cd6265b12f756283633be94a547bf990.tar gnu-guix-30ce8012cd6265b12f756283633be94a547bf990.tar.gz |
offload: '{send,receive}-files' wait for completion of the transfer.
Fixes situations where the remote 'guix build' is invoked before the
.drv has been completely copied, as reported at
<https://lists.gnu.org/archive/html/guix-devel/2014-04/msg00174.html>.
In some cases 'send-files' would return before the other end is done
importing the files, and so the subsequent 'guix build' invocation would
just miss the .drv file it refers to.
* guix/utils.scm (call-with-decompressed-port): Don't close PORT.
(call-with-compressed-output-port): Likewise.
* tests/utils.scm ("compressed-output-port + decompressed-port"): Adjust
accordingly.
* guix/scripts/offload.scm (send-files): Add explicit (close-pipe pipe)
call.
(retrieve-files): Likewise.
Diffstat (limited to 'guix/utils.scm')
-rw-r--r-- | guix/utils.scm | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/guix/utils.scm b/guix/utils.scm index 84cb5ae983..53fc68d27b 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -229,14 +229,12 @@ a symbol such as 'xz." (define (call-with-decompressed-port compression port proc) "Call PROC with a wrapper around PORT, a file port, that decompresses data -read from PORT according to COMPRESSION, a symbol such as 'xz. PORT is closed -as soon as PROC's dynamic extent is entered." +read from PORT according to COMPRESSION, a symbol such as 'xz." (let-values (((decompressed pids) (decompressed-port compression port))) (dynamic-wind (const #f) (lambda () - (close-port port) (proc decompressed)) (lambda () (close-port decompressed) @@ -286,14 +284,12 @@ of PIDs to wait for." (define (call-with-compressed-output-port compression port proc) "Call PROC with a wrapper around PORT, a file port, that compresses data -that goes to PORT according to COMPRESSION, a symbol such as 'xz. PORT is -closed as soon as PROC's dynamic extent is entered." +that goes to PORT according to COMPRESSION, a symbol such as 'xz." (let-values (((compressed pids) (compressed-output-port compression port))) (dynamic-wind (const #f) (lambda () - (close-port port) (proc compressed)) (lambda () (close-port compressed) |