From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CKrGItBEm1/HKwAA0tVLHw (envelope-from ) for ; Thu, 29 Oct 2020 22:40:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id CJOIHtBEm19sSAAAB5/wlQ (envelope-from ) for ; Thu, 29 Oct 2020 22:40:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 0B34494042B for ; Thu, 29 Oct 2020 22:40:15 +0000 (UTC) Received: from localhost ([::1]:55080 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYGaZ-0006XO-I2 for larch@yhetil.org; Thu, 29 Oct 2020 18:40:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYGaQ-0006XI-Id for bug-guix@gnu.org; Thu, 29 Oct 2020 18:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43708) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYGaQ-0002YV-8t for bug-guix@gnu.org; Thu, 29 Oct 2020 18:40:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYGaQ-00081u-4v for bug-guix@gnu.org; Thu, 29 Oct 2020 18:40:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#44115: [PATCH] import: Make failed recursive imports yield an error instead of backtrace. References: <87blgvg1i4.fsf@gmail.com> In-Reply-To: <87blgvg1i4.fsf@gmail.com> Resent-From: Lulu Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 29 Oct 2020 22:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44115 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: "guix-patches@gnu.org" Received: via spool by submit@debbugs.gnu.org id=B.160401117530828 (code B ref -1); Thu, 29 Oct 2020 22:40:02 +0000 Received: (at submit) by debbugs.gnu.org; 29 Oct 2020 22:39:35 +0000 Received: from localhost ([127.0.0.1]:55254 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYGZz-00081A-EY for submit@debbugs.gnu.org; Thu, 29 Oct 2020 18:39:35 -0400 Received: from lists.gnu.org ([209.51.188.17]:43818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYGZy-000813-FZ for submit@debbugs.gnu.org; Thu, 29 Oct 2020 18:39:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYGZy-0006VF-6Z for guix-patches@gnu.org; Thu, 29 Oct 2020 18:39:34 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:49182) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1kYGZu-0002VI-JI for guix-patches@gnu.org; Thu, 29 Oct 2020 18:39:33 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4CMgNY3mLVzQlF7 for ; Thu, 29 Oct 2020 23:39:25 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter06.heinlein-hosting.de (spamfilter06.heinlein-hosting.de [80.241.56.125]) (amavisd-new, port 10030) with ESMTP id eR59h073xsuf for ; Thu, 29 Oct 2020 23:39:22 +0100 (CET) Date: Fri, 30 Oct 2020 01:39:22 +0300 (TRT) From: Lulu Message-ID: <674201342.4055.1604011162338@office.mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal X-MBO-SPAM-Probability: X-Rspamd-Score: -4.91 / 15.00 / 15.00 X-Rspamd-Queue-Id: 8F9B3182D X-Rspamd-UID: 75921e Received-SPF: pass client-ip=80.241.56.171; envelope-from=me@erkin.party; helo=mout-p-201.mailbox.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/29 18:39:25 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.5 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -2.6 (--) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: JeFT/1COaQr2 * guix/import/utils.scm (recursive-import): Move error handling of recursive imports to a single point. * guix/import/gem.scm (gem->guix-package): Fix the `values' hack and make the procedure return #f on failure. * guix/import/pypi.scm (pypi->guix-package): Fix the condition hack and make the procedure return #f on failure. --- guix/import/gem.scm | 2 +- guix/import/pypi.scm | 5 +---- guix/import/utils.scm | 9 +++++++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/guix/import/gem.scm b/guix/import/gem.scm index 3fe240f36a..c97df149ab 100644 --- a/guix/import/gem.scm +++ b/guix/import/gem.scm @@ -143,7 +143,7 @@ VERSION, HASH, HOME-PAGE, DESCRIPTION, DEPENDENCIES, and LICENSES." dependencies licenses) dependencies-names)) - (values #f '())))) + #f))) (define (guix-package->gem-name package) "Given a PACKAGE built from rubygems.org, return the name of the diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm index 15116e349d..9c6a825243 100644 --- a/guix/import/pypi.scm +++ b/guix/import/pypi.scm @@ -478,10 +478,7 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE." (info (and project (pypi-project-info project)))) (and project (guard (c ((missing-source-error? c) - (let ((package (missing-source-error-package c))) - (leave (G_ "no source release for pypi package ~a ~a~%") - (project-info-name info) - (project-info-version info))))) + #f)) (make-pypi-sexp (project-info-name info) (project-info-version info) (and=> (latest-source-release project) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 145515c489..815a05988e 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -36,6 +36,7 @@ #:use-module (guix store) #:use-module (guix download) #:use-module (guix sets) + #:use-module (guix ui) #:use-module (gnu packages) #:use-module (ice-9 match) #:use-module (ice-9 rdelim) @@ -428,8 +429,12 @@ name corresponding to the upstream name." (not (null? (find-packages-by-name (guix-name name))))) (define (lookup-node name) - (receive (package dependencies) (repo->guix-package name repo) - (make-node name package dependencies))) + (call-with-values (lambda () (repo->guix-package name repo)) + (match-lambda* + ((#f) + (leave (G_ "failed to download package '~a' during recursive import~%") name)) + ((package dependencies) + (make-node name package dependencies))))) (map node-package (topological-sort (list (lookup-node package-name)) -- 2.29.1