aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-10-18 17:15:45 +0100
committerChristopher Baines <mail@cbaines.net>2019-10-18 17:15:45 +0100
commitc9e0e311bbee6dd85f017dbf5704492df72c2e9a (patch)
treea8475437f3e886e7467e282d1e7a7d87c5292d6c
parent917d031d4f338c007e78ac17df55d547300d685e (diff)
downloaddata-service-c9e0e311bbee6dd85f017dbf5704492df72c2e9a.tar
data-service-c9e0e311bbee6dd85f017dbf5704492df72c2e9a.tar.gz
Send inferior error output to stderr
Ideally this would go in to the database somehow as well, but the only idea I have for that is pass in a pipe, and then spawn a thread to read from the other end of that pipe in a loop to send the output to the database. That hasn't been written yet, so just send the output to stderr for now.
-rw-r--r--guix-data-service/jobs/load-new-guix-revision.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm b/guix-data-service/jobs/load-new-guix-revision.scm
index 59dc2b4..2e7eaf4 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -89,6 +89,9 @@
(setvbuf port 'line)
port))
+(define real-error-port
+ (make-parameter (current-error-port)))
+
(define* (log-for-job conn job-id
#:key
character-limit
@@ -596,7 +599,8 @@ WHERE job_id = $1"
"SSL_CERT_DIR=" (nss-certs-store-path store))))
(begin
(simple-format #t "debug: using open-inferior\n")
- (open-inferior (guix-store-path store))))))
+ (open-inferior (guix-store-path store)
+ #:error-port (real-error-port))))))
(catch
#t
@@ -707,7 +711,8 @@ WHERE job_id = $1"
'("/gnu/store"))
(begin
(simple-format #t "debug: using open-inferior\n")
- (open-inferior store-path)))))
+ (open-inferior store-path
+ #:error-port (real-error-port))))))
(inferior-eval '(use-modules (srfi srfi-1)
(srfi srfi-34)
(guix grafts)
@@ -766,7 +771,8 @@ WHERE job_id = $1"
'("/gnu/store"))
(begin
(simple-format #t "debug: using open-inferior\n")
- (open-inferior store-path))))))
+ (open-inferior store-path
+ #:error-port (real-error-port)))))))
(setenv "GUIX_LOCPATH" guix-locpath) ; restore GUIX_LOCPATH
(when (eq? inf #f)
@@ -1236,7 +1242,8 @@ SKIP LOCKED")
(set-current-output-port logging-port)
(set-current-error-port logging-port)
(let ((result
- (parameterize ((current-build-output-port logging-port))
+ (parameterize ((current-build-output-port logging-port)
+ (real-error-port previous-error-port))
(load-new-guix-revision conn git-repository-id commit))))
(combine-log-parts! logging-conn id)