From 9dbcd5cedeb861c27aec2b41fcbe6aba92de6c2e Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Sat, 28 Aug 2021 14:42:32 +0200 Subject: [PATCH] build-self: Try printing nicer error messages. This prevents daunting backtraces like in by only printing the relevant information: that 'subversion' fails to build. * build-aux/self.scm (build-program): Wrap the 'run-with-store' in a 'with-error-handling'. --- build-aux/build-self.scm | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/build-aux/build-self.scm b/build-aux/build-self.scm index f100ff4aae..1dbaf52061 100644 --- a/build-aux/build-self.scm +++ b/build-aux/build-self.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2014, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès +;;; Copyright © 2021 Maxime Devos ;;; ;;; This file is part of GNU Guix. ;;; @@ -280,6 +281,7 @@ interface (FFI) of Guile.") ,@(source-module-closure `((guix store) (guix self) + (guix ui) (guix derivations) (gnu packages bootstrap)) (list source) @@ -316,6 +318,7 @@ interface (FFI) of Guile.") (read-disable 'positions)) (use-modules (guix store) + (guix ui) (guix self) (guix derivations) (srfi srfi-1)) @@ -347,14 +350,18 @@ interface (FFI) of Guile.") (parameterize ((current-warning-port (%make-void-port "w")) (current-build-output-port sock)) - (run-with-store store - (guix-derivation source version - #$guile-version - #:channel-metadata - '#$channel-metadata - #:pull-version - #$pull-version) - #:system system)) + ;; Use 'with-error-handling' to prevent scary + ;; backtraced like + ;; . + (with-error-handling + (run-with-store store + (guix-derivation source version + #$guile-version + #:channel-metadata + '#$channel-metadata + #:pull-version + #$pull-version) + #:system system))) derivation-file-name)))))) #:module-path (list source)))) base-commit: b4d132f98e03fae559db832e88897f1e166c4d47 prerequisite-patch-id: 91a26ba19372112a11a0eea2b066d2f63641deb1 -- 2.33.0