diff options
author | Christopher Baines <mail@cbaines.net> | 2023-08-31 09:57:31 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-08-31 09:57:31 +0100 |
commit | 9c42dcb726fc925606b12695e195ae1dc7e28cc3 (patch) | |
tree | 6077713efe2a4d1c29f0b41f1e492d66ac1fe97c | |
parent | 962364bcb5aca3bb639c48b8e098f54c7e458472 (diff) | |
download | build-coordinator-9c42dcb726fc925606b12695e195ae1dc7e28cc3.tar build-coordinator-9c42dcb726fc925606b12695e195ae1dc7e28cc3.tar.gz |
Don't output the whole log for substituting derivations
Just the last bit, as it could be very long.
-rw-r--r-- | guix-build-coordinator/utils.scm | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm index 1401ac8..69cd743 100644 --- a/guix-build-coordinator/utils.scm +++ b/guix-build-coordinator/utils.scm @@ -445,13 +445,19 @@ context." (with-exception-handler (lambda (exn) - (let ((log-string - (get-output-string log-port))) + (let* ((log-string + (get-output-string log-port)) + (lines + (string-split log-string #\newline)) + (last-n-lines + (if (< 10 (length lines)) + (take-right lines 10) + lines))) (close-output-port log-port) (simple-format (current-error-port) "exception when substituting derivation: ~A:\n ~A\n" - exn log-string) + exn (string-join last-n-lines "\n")) (raise-exception exn))) (lambda () (parameterize ((current-build-output-port log-port)) |