diff options
author | Christopher Baines <mail@cbaines.net> | 2020-11-30 19:21:37 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-11-30 19:21:37 +0000 |
commit | 82ea70a97652ddc6138747c5e6052891f2fcb4ee (patch) | |
tree | ba0d67a3aada9f75bc61b9e8a48c028a3f722336 | |
parent | 437a6c5791a98e538bd9f9c876a63e4bf59b5aa1 (diff) | |
download | build-coordinator-82ea70a97652ddc6138747c5e6052891f2fcb4ee.tar build-coordinator-82ea70a97652ddc6138747c5e6052891f2fcb4ee.tar.gz |
Hide logging from garbage collection
-rw-r--r-- | guix-build-coordinator/agent.scm | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/guix-build-coordinator/agent.scm b/guix-build-coordinator/agent.scm index 656cfc3..3101622 100644 --- a/guix-build-coordinator/agent.scm +++ b/guix-build-coordinator/agent.scm @@ -308,24 +308,28 @@ but the guix-daemon claims it's unavailable") (output-file-names (map derivation-output-path (map cdr outputs)))) (if (any file-exists? output-file-names) - (catch - #t - (lambda () - (log-msg lgr 'DEBUG build-id ": deleting " - (if (eq? (length output-file-names) 1) - "output" - "outputs")) - ;; There can be issues deleting links when collecting garbage - ;; from multiple threads - (monitor - (with-store store - (delete-paths store output-file-names))) - #t) - (lambda (key args) - (log-msg lgr 'ERROR - "delete-outputs: " - key args) - #f)) + (let ((log-port (open-output-string))) + (catch + #t + (lambda () + (log-msg lgr 'DEBUG build-id ": deleting " + (if (eq? (length output-file-names) 1) + "output" + "outputs")) + ;; There can be issues deleting links when collecting garbage + ;; from multiple threads + (monitor + (with-store store + ;; TODO Do something with the logged output + (parameterize ((current-build-output-port log-port)) + (delete-paths store output-file-names)))) + #t) + (lambda (key args) + (display (get-output-string log-port)) + (log-msg lgr 'ERROR + "delete-outputs: " + key args) + #f))) #t))) (let ((derivation |