Hi Attila, Attila Lendvai <att...@lendvai.name> writes:
> coming from common lisp (and SBCL in particular), i think the lowest > hanging fruit in the guile debugging experience is making sure that > backtraces are not cut short when printed. > > i tried multiple ways to configure the printer to acquire more info, > but it didn't react to anything i tried: > > (setenv "COLUMNS" "300") > (debug-set! width 160) > (debug-set! depth 1000) > > this is regularly causing me frustration when all i need to make > progress is in the cut off part of the backtrace, and the code in > question is in a part of the codebase that i can't easily change to > add some good old printf's. Thanks for reminding me of this problem. I thought the following might do it: --8<---------------cut here---------------start------------->8--- modified doc/guix.texi @@ -18263,6 +18263,10 @@ This data type represents the configuration of the Guix build daemon. @item @code{guix} (default: @var{guix}) The Guix package to use. +@item @code{backtrace-width} (default: @var{400}) +The character width at which backtraces of Guile processes launched by +the Guix daemon should be truncated. + @item @code{build-group} (default: @code{"guixbuild"}) Name of the group for build user accounts. modified gnu/services/base.scm @@ -187,6 +187,7 @@ (define-module (gnu services base) guix-configuration? guix-configuration-guix + guix-configuration-backtrace-width guix-configuration-build-group guix-configuration-build-accounts guix-configuration-authorize-key? @@ -1634,6 +1635,8 @@ (define-record-type* <guix-configuration> (default 0)) (timeout guix-configuration-timeout ;integer (default 0)) + (backtrace-width guix-configuration-backtrace-width ;integer + (default 400)) (log-compression guix-configuration-log-compression (default 'gzip)) (discover? guix-configuration-discover? @@ -1701,7 +1704,7 @@ (define (guix-shepherd-service config) (guix build-group build-accounts authorize-key? authorized-keys use-substitutes? substitute-urls max-silent-time timeout log-compression discover? extra-options log-file - http-proxy tmpdir chroot-directories) + http-proxy tmpdir chroot-directories backtrace-width) (list (shepherd-service (documentation "Run the Guix daemon.") (provision '(guix-daemon)) @@ -1771,6 +1774,9 @@ (define discover? (list (string-append "TMPDIR=" tmpdir)) '()) + #$(string-append "COLUMNS=" (number->string + backtrace-width)) + ;; Make sure we run in a UTF-8 locale so that ;; 'guix offload' correctly restores nars ;; that contain UTF-8 file names such as --8<---------------cut here---------------end--------------->8--- But it doesn't seem to work :-(. > which reminds me that a project-wide logging infrastructure would also > greatly elevate the guix debugging experience. I wouldn't be against having a logging system in Guix; there's a readily available logging library part of guile-lib; see info '(guile-library) loggig logger') -- Thanks, Maxim