unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Josselin Poiret via Guix-patches via <guix-patches@gnu.org>
To: Josselin Poiret <dev@jpoiret.xyz>
Cc: 55911@debbugs.gnu.org
Subject: [bug#55911] [PATCH v2] channels: Print backtrace when generating package cache fails.
Date: Sat, 11 Jun 2022 18:59:38 +0200	[thread overview]
Message-ID: <20220611165938.25093-1-dev@jpoiret.xyz> (raw)
In-Reply-To: <20220611163031.23673-1-dev@jpoiret.xyz>

* guix/channels.scm (package-cache-file): Add a throw handler around
the generate-package-cache call, and print backtrace in it.
---
IRC promptly pointed out that Guix has required Guile ver>=2 since way before
guix repl and guix pull were ever a thing, thus drop the Guile 1 compatibility
code.  Enjoy this v2

Best,
Josselin
 guix/channels.scm | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index 20f347d34f..fde425327d 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -911,7 +911,14 @@ (define build
                 (format (current-error-port)
                         "Generating package cache for '~a'...~%"
                         #$profile)
-                (generate-package-cache #$output))
+                ;; This script runs through (primitive-load), which by default
+                ;; doesn't print backtraces when it encounters an exception,
+                ;; so manually do it.  Use with-throw-handler because it is
+                ;; supported by all Guile versions.
+                (with-throw-handler #t
+                  (lambda () (generate-package-cache #$output))
+                  (lambda (key . args)
+                      (backtrace))))
               (mkdir #$output))))
 
     (gexp->derivation-in-inferior "guix-package-cache" build
-- 
2.36.1





  reply	other threads:[~2022-06-11 17:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-11 16:30 [bug#55911] [PATCH] channels: Print backtrace when generating package cache fails Josselin Poiret via Guix-patches via
2022-06-11 16:59 ` Josselin Poiret via Guix-patches via [this message]
2022-06-16  9:10   ` bug#55911: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220611165938.25093-1-dev@jpoiret.xyz \
    --to=guix-patches@gnu.org \
    --cc=55911@debbugs.gnu.org \
    --cc=dev@jpoiret.xyz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).