From patchwork Sat Aug 28 14:36:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: M X-Patchwork-Id: 32350 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1BFD027BBE3; Sat, 28 Aug 2021 15:38:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 0E3B927BBE1 for ; Sat, 28 Aug 2021 15:38:14 +0100 (BST) Received: from localhost ([::1]:43064 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mJzTJ-0002Ra-0f for patchwork@mira.cbaines.net; Sat, 28 Aug 2021 10:38:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJzT9-0002Mo-NX for guix-patches@gnu.org; Sat, 28 Aug 2021 10:38:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43242) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJzT9-0005Im-Fb for guix-patches@gnu.org; Sat, 28 Aug 2021 10:38:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mJzT8-0002kA-5l for guix-patches@gnu.org; Sat, 28 Aug 2021 10:38:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50238] [PATCH] build-self: Try printing nicer error messages. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 28 Aug 2021 14:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50238 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50238@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163016143410470 (code B ref -1); Sat, 28 Aug 2021 14:38:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Aug 2021 14:37:14 +0000 Received: from localhost ([127.0.0.1]:54788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJzSL-0002io-QZ for submit@debbugs.gnu.org; Sat, 28 Aug 2021 10:37:14 -0400 Received: from lists.gnu.org ([209.51.188.17]:45428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mJzSI-0002if-LZ for submit@debbugs.gnu.org; Sat, 28 Aug 2021 10:37:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mJzSH-0001i0-S0 for guix-patches@gnu.org; Sat, 28 Aug 2021 10:37:10 -0400 Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:42074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mJzSE-0004Xa-JX for guix-patches@gnu.org; Sat, 28 Aug 2021 10:37:09 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id n2d02500V0mfAB4012d1lQ; Sat, 28 Aug 2021 16:37:01 +0200 Message-ID: From: Maxime Devos Date: Sat, 28 Aug 2021 16:36:48 +0200 User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1630161421; bh=iUQSjfCL0Hqqm/ussyTUSoqilmna9aLxbXo50F/BM9Y=; h=Subject:From:To:Date; b=ak8B3JZPQS4oHGtbRyKHJ2MOsLfYLkzZnkHItwQfqF1zuBxW20trCwJxNrPbPutVl qkI4RIM2GyqFg2qJRr74MI8vQFQszSAOTOqWfNPwcSrI3V0cPfIWMwPWlK/vH1wGZF kM28JiJ3kMnIhfpmX5IzM/6Dmgos3qpB5plmNiJmmBmd/uwuRU/EEb6mR6WFdW2RFL LchMxCfEHFfMpkPV620AE7QpLfuJ/O9FdaYIypYUT2kzYaEtptO8ERIWcqhIfeg5YU 6sMy4jRFF/Zg7rIPOgBFn7LWi3k9uO/kKl7FNSciCuxPWh32qmajno3z7qmEwWwpq9 0MyyExnJvrjAQ== Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hi guix, This patch improves the error message generated by "guix time-machine" and presumably "guix pull" as well when the guix derivation fails to compute. Before: something like . After: something like [...] substitute: lijst van substitutes van ?[...]? aan het bijwerken... 100.0% /gnu/store/4yx3vms0rfpzd1430za3g4pa6jvjsfw9-nowhere.tar.bz2.drv bouwen... /error: build of `/gnu/store/6s0cmkfa4hq7d9w8g08mv2rhq0cr7wqc-subversion-1.14.1.drv' failed guix time-machine: fout: You found a bug: the program '/gnu/store/j07lizpjf7v65shdgxyxddz171g6vjvx-compute-guix-derivation' failed to compute the derivation for Guix (version: "9fc551e089c25f510f918a2c52917ba4e842f1c3"; system: "x86_64-linux"; host version: "75a3413b4e5c1f7443eb944a36ff364f4c4085f4"; pull-version: 1). Please report it by email to 0 #;"1ag1hvcm9q92kgalzbbgcsq9clxnzmbj9nciz9lmabjx4lyajp9c" "0ag1hvcm9q92kgalzbbgcsq9clxnzmbj9nciz9lmabjx4lyajp9c")))) (build-system gnu-build-system) [...] and commit that mistake. Then run guix time-machine --branch=master --url=$PWD --disable-authentication Repeat without the error in subversion. Greetings, Maxime 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