From debbugs-submit-bounces@debbugs.gnu.org Mon Feb 06 09:14:29 2023 Received: (at submit) by debbugs.gnu.org; 6 Feb 2023 14:14:29 +0000 Received: from localhost ([127.0.0.1]:47675 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP2GK-0000ge-MG for submit@debbugs.gnu.org; Mon, 06 Feb 2023 09:14:29 -0500 Received: from lists.gnu.org ([209.51.188.17]:48256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pP2G2-0000fz-MA for submit@debbugs.gnu.org; Mon, 06 Feb 2023 09:14:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP2G0-0002iq-Qw for guix-patches@gnu.org; Mon, 06 Feb 2023 09:14:09 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pP2G0-0003Cg-Fe; Mon, 06 Feb 2023 09:14:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=38Bu38fV1pm1uCFD9aR5A453FkBJ+PTD2q18+rQROls=; b=oPFsgLcphRcP6U org5tj3ZNxuKdABSR5pugLU7EW79whRlb08C6tUveiDGTORRTPCcFGG1KxvaqkSXwai5ZnFH4Tk4a G7XGv8xCqMF7zFTvWiiwdWOWLxxI1EO+dyWZNq9fbBKcZnOGtWfPreuDvx2UUPeQZsP3d8gvePOt9 tXOHNYoNs1I15VB7dWc4H2+VJIiZLnIrfietXC0Wy08ELsZyYF6xc5TrCYcmvbrATCjNKx01N+GnL 5TLHtNBhIE3y0JCOgKBG5RJ1WliqG0Hv5VpfLIs4mKuVRPPZP02WdlL9aaQBGmt7CVSVjExqbz9VK +RI6bQemxPS8HvfGfsVw==; Received: from [188.44.78.207] (helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pP2Fz-00050s-PI; Mon, 06 Feb 2023 09:14:08 -0500 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= To: guix-patches@gnu.org Subject: [PATCH] status: Print a hint when a 'package-cache' hook fails to build. Date: Mon, 6 Feb 2023 15:13:52 +0100 Message-Id: <20230206141352.29287-1-ludo@gnu.org> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: submit Cc: =?UTF-8?q?Ludovic=20Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * guix/channels.scm (package-cache-file): Add 'channels' to the #:properties list. * guix/status.scm (print-build-event): Upon failure, display a hint when the derivation is a 'package-cache' hook. --- guix/channels.scm | 9 +++++++-- guix/status.scm | 18 +++++++++++++++++- 2 files changed, 24 insertions(+), 3 deletions(-) Hello! This patch mitigates a longstanding user interface issue. When pulling from a channel set where one of them has an issue, such as a reference to an unbound variable, you get something rather unhelpful like this: --8<---------------cut here---------------start------------->8--- $ guix pull -C ~/.config/guix/hpc-channels.scm -p /tmp/chantest Updating channel 'guix-hpc' from Git repository at 'https://gitlab.inria.fr/guix-hpc/guix-hpc.git'... Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'... Authenticating channel 'guix', commits 9edb3f6 to a582d86 (64 new commits)... Building from these channels: guix https://git.savannah.gnu.org/git/guix.git a582d86 guix-hpc https://gitlab.inria.fr/guix-hpc/guix-hpc.git 0e522d1 [...] guix-daemon 399B 205KiB/s 00:00 [##################] 100.0% guix-a582d8634 14KiB 1.2MiB/s 00:00 [##################] 100.0% building /gnu/store/c4racwl5ns6vpyjsx1ad3fxh9n48g0pl-guix-hpc.drv... building CA certificate bundle... listing Emacs sub-directories... building fonts directory... building directory of Info manuals... building profile with 2 packages... building /gnu/store/p2a500wi4nvznq85sf08jych48lpfijl-inferior-script.scm.drv... building package cache... \builder for `/gnu/store/pm5crwjcclblmdh8y15jk6i5wxml6j9g-guix-package-cache.drv' failed to produce output path `/gnu/store/12x6ka57amgv28rdnkc2wsq3hs8gr6gw-guix-package-cache' build of /gnu/store/pm5crwjcclblmdh8y15jk6i5wxml6j9g-guix-package-cache.drv failed View build log at '/var/log/guix/drvs/pm/5crwjcclblmdh8y15jk6i5wxml6j9g-guix-package-cache.drv.gz'. cannot build derivation `/gnu/store/06d4wla2l7qqldcaxif2qzgpsk377hvr-profile.drv': 1 dependencies couldn't be built guix pull: error: build of `/gnu/store/06d4wla2l7qqldcaxif2qzgpsk377hvr-profile.drv' failed --8<---------------cut here---------------end--------------->8--- In this case the relevant bit in the build log is: --8<---------------cut here---------------start------------->8--- In inria/hiepacs.scm: 879:41 3 (inputs #) In ice-9/boot-9.scm: 1685:16 2 (raise-exception _ #:continuable? _) 1780:13 1 (_ #<&compound-exception components: (#<&undefined-vari?>) In unknown file: 0 (backtrace #) (exception unbound-variable (value #f) (value "Unbound variable: ~S") (value (python2-numpy)) (value #f)) --8<---------------cut here---------------end--------------->8--- We probably cannot reliably “extract” the actual error from the build log, but we can at least hint in the right direction. This is what this patch does. Now you would get: --8<---------------cut here---------------start------------->8--- build of /gnu/store/dib9aa6g0zn3cvv7hvfrby7cnmpyrw2m-guix-package-cache.drv failed hint: This usually indicates a bug in one of the channels you are pulling from, or some incompatibility among them. You can check the build log and report the issue to the channel developers. The channels you are pulling from are: guix guix-hpc. View build log at '/var/log/guix/drvs/di/b9aa6g0zn3cvv7hvfrby7cnmpyrw2m-guix-package-cache.drv.gz'. cannot build derivation `/gnu/store/y11nksh5lhyj09zqszlg9pvg89wzpv5p-profile.drv': 1 dependencies couldn't be built guix build: error: build of `/gnu/store/y11nksh5lhyj09zqszlg9pvg89wzpv5p-profile.drv' failed --8<---------------cut here---------------end--------------->8--- Thoughts? Ludo’. diff --git a/guix/channels.scm b/guix/channels.scm index 40cbc4bb3a..d44e7a0a3a 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -952,6 +952,10 @@ (define build (backtrace)))) (mkdir #$output)))) + (define channels + (map (compose string->symbol manifest-entry-name) + (manifest-entries manifest))) + (gexp->derivation-in-inferior "guix-package-cache" build profile @@ -960,8 +964,9 @@ (define build ;; instead of failing. #:silent-failure? #t - #:properties '((type . profile-hook) - (hook . package-cache)) + #:properties `((type . profile-hook) + (hook . package-cache) + (channels . ,channels)) #:local-build? #t))) (define %channel-profile-hooks diff --git a/guix/status.scm b/guix/status.scm index 2c69f49fb5..5580c80ea9 100644 --- a/guix/status.scm +++ b/guix/status.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017-2022 Ludovic Courtès +;;; Copyright © 2017-2023 Ludovic Courtès ;;; Copyright © 2018, 2019 Ricardo Wurmus ;;; ;;; This file is part of GNU Guix. @@ -22,6 +22,7 @@ (define-module (guix status) #:use-module (guix i18n) #:use-module (guix colors) #:use-module (guix progress) + #:autoload (guix ui) (display-hint) #:autoload (guix build syscalls) (terminal-columns) #:autoload (guix build download) (nar-uri-abbreviation) #:use-module (guix store) @@ -526,6 +527,21 @@ (define erase-current-line* (erase-current-line*) ;erase spinner or progress bar (format port (failure (G_ "build of ~a failed")) drv) (newline port) + (let ((properties (and=> (false-if-exception + (read-derivation-from-file drv)) + derivation-properties))) + (when (and (pair? properties) + (eq? (assq-ref properties 'type) 'profile-hook) + (eq? (assq-ref properties 'hook) 'package-cache)) + (display-hint (format #f (G_ "This usually indicates a bug in one of +the channels you are pulling from, or some incompatibility among them. You +can check the build log and report the issue to the channel developers. + +The channels you are pulling from are: ~a.") + (string-join + (map symbol->string + (or (assq-ref properties 'channels) + '(guix)))))))) (match (derivation-log-file drv) (#f (format port (failure (G_ "Could not find build log for '~a'.")) base-commit: 25947bbc3217306742694304fa9b6499f0126c7a -- 2.39.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 07 06:59:06 2023 Received: (at 61322) by debbugs.gnu.org; 7 Feb 2023 11:59:06 +0000 Received: from localhost ([127.0.0.1]:51390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPMcs-00039F-DJ for submit@debbugs.gnu.org; Tue, 07 Feb 2023 06:59:06 -0500 Received: from mail-wr1-f52.google.com ([209.85.221.52]:35416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pPMco-00038L-Be for 61322@debbugs.gnu.org; Tue, 07 Feb 2023 06:59:02 -0500 Received: by mail-wr1-f52.google.com with SMTP id y1so13320998wru.2 for <61322@debbugs.gnu.org>; Tue, 07 Feb 2023 03:59:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:from:to:cc:subject:date:message-id :reply-to; bh=HDGDVOmKBhAOy44RPGa34rSR6u4xcFeZ3z1aqW0Pg34=; b=GXVbrx6C2UNWBWMhfgcgeu88mmGh9r2RA4DWDp2BSC2p9PqIWtvBGvSsVrikGyt2ee R+b+WEvNbobKWuB1wk/4w/EAYXlfbj5fB4BtmAX7Uc0aYN2DSE9nwhxJxSBN/zXsiePB xVqR9LYf/swbmpQzWUyp7QuEoMtRiPxHRelZpik7fC3M9nEwiNUYHneTTnGF3IQT3W4Q B32S6kr2myBTS9eLzxyylhFlKDgoQsY884nzQ624fKXMkFkzoiAqvf506bt+7ql9LBXg pw9zU2BYDvgiYA34cNCTLn5F7/cV3JVfXBrSQN2dbTA2C5iId1ANxyqAKRgSvvj6iOZa GO/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HDGDVOmKBhAOy44RPGa34rSR6u4xcFeZ3z1aqW0Pg34=; b=feiuUFreb2jL/z9UGvw7vbnA8vkjGjoRZgz8MJIZnWvZRhcoeRRJNWb/3EtsBSb2zE Ax8K6XTEvYG9A/wuw5Ob0KV7MjCBIBaNyRENyCDymBwt/6spPhjKFiOSOQadsWqp8QOK arpoJ8sbxZx77B5T+RTqv29IW8s2So00JFKdRksDkRa/6KO4xI9qVhQ5tj2ALGZm/OjM hLlNZoV5rRpqh8RTVbC79M0p79V7Acf3hlmdo3CQzQ9k2U7bmy2CJdjaHqyeloxALN5e n8BifZvqZojc87RytRpBi9ZStYSA4q6H5+PFcALghfli/nlNWmoVlSrbX1zvOfk9QBJL F9Ew== X-Gm-Message-State: AO0yUKVMAO4arq1sLSc/U81YFOsCn2PuQxrUCsUWSgD5MzXE7DFfGcHL EnEC7dXyyIV1COKlqXOCDM1Yr9ShqVL7QQ== X-Google-Smtp-Source: AK7set8+nTW/q2mllexUfSWm/FnabCe7Ma/pkBKvWWxDn4yX7yuSwUONR6SbgSaWZ/Jmkr3zXc4TGQ== X-Received: by 2002:a5d:6707:0:b0:2c3:db5b:7277 with SMTP id o7-20020a5d6707000000b002c3db5b7277mr1709604wru.0.1675771136651; Tue, 07 Feb 2023 03:58:56 -0800 (PST) Received: from lili ([81.255.72.129]) by smtp.gmail.com with ESMTPSA id bj24-20020a0560001e1800b002bded7da2b8sm11204875wrb.102.2023.02.07.03.58.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Feb 2023 03:58:56 -0800 (PST) From: zimoun To: Ludovic =?utf-8?Q?Court=C3=A8s?= , 61322@debbugs.gnu.org Subject: Re: [bug#61322] [PATCH] status: Print a hint when a 'package-cache' hook fails to build. In-Reply-To: <20230206141352.29287-1-ludo@gnu.org> References: <20230206141352.29287-1-ludo@gnu.org> Date: Tue, 07 Feb 2023 12:56:05 +0100 Message-ID: <86mt5pn0yy.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 61322 Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, On Mon, 06 Feb 2023 at 15:13, Ludovic Court=C3=A8s wrote: > * guix/channels.scm (package-cache-file): Add 'channels' to the #:propert= ies > list. > * guix/status.scm (print-build-event): Upon failure, display a hint when > the derivation is a 'package-cache' hook. Cool! A minor comment. > In this case the relevant bit in the build log is: > > --8<---------------cut here---------------start------------->8--- > In inria/hiepacs.scm: > 879:41 3 (inputs #) > In ice-9/boot-9.scm: > 1685:16 2 (raise-exception _ #:continuable? _) > 1780:13 1 (_ #<&compound-exception components: (#<&undefined-vari?>) > In unknown file: > 0 (backtrace #) > > (exception unbound-variable (value #f) (value "Unbound variable: ~S") (va= lue (python2-numpy)) (value #f)) > --8<---------------cut here---------------end--------------->8--- [...] > + (let ((properties (and=3D> (false-if-exception > + (read-derivation-from-file drv)) > + derivation-properties))) > + (when (and (pair? properties) > + (eq? (assq-ref properties 'type) 'profile-hook) > + (eq? (assq-ref properties 'hook) 'package-cache)) > + (display-hint (format #f (G_ "This usually indicates a bug in o= ne of > +the channels you are pulling from, or some incompatibility among them. = You > +can check the build log and report the issue to the channel developers. > + > +The channels you are pulling from are: ~a.") > + (string-join > + (map symbol->string > + (or (assq-ref properties 'channels) > + '(guix)))))))) Would it be possible to also detect and also display the unbound variable, e.g., python2-numpy? Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 10 18:14:02 2023 Received: (at 61322-done) by debbugs.gnu.org; 10 Feb 2023 23:14:02 +0000 Received: from localhost ([127.0.0.1]:38311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQcag-0002z3-0j for submit@debbugs.gnu.org; Fri, 10 Feb 2023 18:14:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pQcae-0002yQ-5P for 61322-done@debbugs.gnu.org; Fri, 10 Feb 2023 18:14:00 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQcaY-00015j-UY; Fri, 10 Feb 2023 18:13:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=g91Lq8FwI1Iwe7i7w9rgJZlrpX3/2JyP4WZmpSS+ilU=; b=ZQpGCy1afakf4QE9Yt7i uBoMY2im1UOl6cPoF9BAYBqn0PQeGfidE6uwnnd7DdPLT9xVH9dzOYafl6c+3yuY2nIGsBjdUDGom XbbEaFLZNYZataB6mij8GLhL0yHy3sALNotnYtjuxXE4nV4T+k6dWnD2Zm9plvvhv0lImOsN/fBDs eFT5Rr716L2mk0i/nRCvmzCFKvgbsk+T/vT+lfLCxXBDhmEhoL5YCvN4tIl9t8JSE08iqJgwJEMjq 5ERLrKNX53wqhV9wsfehl9NVyQM9LW/qFkm+Dckrj2oj9XThrUF5jB1riK9EQGbLUKhQfII89KLnB PxwuhpE5V0B/Jw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pQcaY-0004fc-HY; Fri, 10 Feb 2023 18:13:54 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: bug#61322: [PATCH] status: Print a hint when a 'package-cache' hook fails to build. References: <20230206141352.29287-1-ludo@gnu.org> <86mt5pn0yy.fsf@gmail.com> Date: Sat, 11 Feb 2023 00:13:53 +0100 In-Reply-To: <86mt5pn0yy.fsf@gmail.com> (zimoun's message of "Tue, 07 Feb 2023 12:56:05 +0100") Message-ID: <87o7q1nmfi.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 61322-done Cc: 61322-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello! zimoun skribis: >> In this case the relevant bit in the build log is: >> >> --8<---------------cut here---------------start------------->8--- >> In inria/hiepacs.scm: >> 879:41 3 (inputs #) >> In ice-9/boot-9.scm: >> 1685:16 2 (raise-exception _ #:continuable? _) >> 1780:13 1 (_ #<&compound-exception components: (#<&undefined-vari?>) >> In unknown file: >> 0 (backtrace #) >> >> (exception unbound-variable (value #f) (value "Unbound variable: ~S") (v= alue (python2-numpy)) (value #f)) >> --8<---------------cut here---------------end--------------->8--- > > [...] > >> + (let ((properties (and=3D> (false-if-exception >> + (read-derivation-from-file drv)) >> + derivation-properties))) >> + (when (and (pair? properties) >> + (eq? (assq-ref properties 'type) 'profile-hook) >> + (eq? (assq-ref properties 'hook) 'package-cache)) >> + (display-hint (format #f (G_ "This usually indicates a bug in = one of >> +the channels you are pulling from, or some incompatibility among them. = You >> +can check the build log and report the issue to the channel developers. >> + >> +The channels you are pulling from are: ~a.") >> + (string-join >> + (map symbol->string >> + (or (assq-ref properties 'channels) >> + '(guix)))))))) > > Would it be possible to also detect and also display the unbound > variable, e.g., python2-numpy? Nope. As I wrote, I agree it would be nicer, but I don=E2=80=99t see how we could reliably =E2=80=9Cextract=E2=80=9D the actual error from the build lo= g. Pushed as 3ab8559436356ef89aa60135d3558681d64443ae. Thanks for taking a look! Ludo=E2=80=99. From unknown Sat Jun 21 05:20:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Mar 2023 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator