From ffcd1922af4a1249b78f8e749d37b83e5f20034a Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Sun, 19 Sep 2021 20:03:10 +0200 Subject: [PATCH 1/4] guix: minetest-build-system: Save the full test log * minetest-build-system.scm (check): Save the full test log. --- guix/build/minetest-build-system.scm | 35 +++++++++++++++++----------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/guix/build/minetest-build-system.scm b/guix/build/minetest-build-system.scm index 477cc3d1d0..df6fb50416 100644 --- a/guix/build/minetest-build-system.scm +++ b/guix/build/minetest-build-system.scm @@ -23,6 +23,7 @@ #:use-module (ice-9 rdelim) #:use-module (ice-9 receive) #:use-module (ice-9 regex) + #:use-module (ice-9 exceptions) #:use-module ((guix build gnu-build-system) #:prefix gnu:) #:use-module ((guix build copy-build-system) #:prefix copy:) #:export (%standard-phases @@ -199,20 +200,26 @@ auth_backend = sqlite3 (define (stop? line) (and (string? line) (string-contains line "ACTION[Server]: singleplayer [127.0.0.1] joins game."))) - (let loop () - (match (read-line port) - ((? error? line) - (error "minetest raised an error: ~a" line)) - ((? stop?) - (kill pid SIGINT) - (close-port port) - (waitpid pid)) - ((? string? line) - (display line) - (newline) - (loop)) - ((? eof-object?) - (error "minetest didn't start")))))))) + (define log-file (open-output-file "guix-test.log")) + (let loop ((has-errors? #f)) + (let ((line (read-line port))) + (unless (eof-object? line) + (write-line line log-file)) + (match `(,line ,has-errors?) + (((? error? line) _) + (loop #t)) + (((? stop?) #f) + (kill pid SIGINT) + (close-port port) + (waitpid pid)) + (((? eof-object?) #f) + (error "minetest didn't start")) + (((or (? stop?) (? eof-object?)) #t) + (error "minetest stopped after an error happened, see source/guix_testworld/guix-test.log")) + (((? string? line) has-error?) + (display line) + (newline) + (loop has-error?))))))))) (define %standard-phases (modify-phases gnu:%standard-phases -- 2.33.0