From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yPvUIAOXEGCHWwAA0tVLHw (envelope-from ) for ; Tue, 26 Jan 2021 22:26:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id KIuUHAOXEGBsGQAAbx9fmQ (envelope-from ) for ; Tue, 26 Jan 2021 22:26:11 +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 CC5A194043A for ; Tue, 26 Jan 2021 22:26:10 +0000 (UTC) Received: from localhost ([::1]:51902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4Wmn-0002Qg-0T for larch@yhetil.org; Tue, 26 Jan 2021 17:26:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l4Wmg-0002QF-F2 for guix-patches@gnu.org; Tue, 26 Jan 2021 17:26:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59590) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l4Wmg-00044u-7h for guix-patches@gnu.org; Tue, 26 Jan 2021 17:26:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l4Wmg-00070s-3c for guix-patches@gnu.org; Tue, 26 Jan 2021 17:26:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45984] [PATCH 0/5] Fix recursive importers Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 26 Jan 2021 22:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45984 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun Received: via spool by 45984-submit@debbugs.gnu.org id=B45984.161169990526882 (code B ref 45984); Tue, 26 Jan 2021 22:26:02 +0000 Received: (at 45984) by debbugs.gnu.org; 26 Jan 2021 22:25:05 +0000 Received: from localhost ([127.0.0.1]:42903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4Wll-0006zW-7Y for submit@debbugs.gnu.org; Tue, 26 Jan 2021 17:25:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l4Wlj-0006yy-FE for 45984@debbugs.gnu.org; Tue, 26 Jan 2021 17:25:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34297) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l4Wle-0003bA-9S; Tue, 26 Jan 2021 17:24:58 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=44206 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l4Wld-0000xB-Ta; Tue, 26 Jan 2021 17:24:58 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210119154525.11230-1-zimon.toutoune@gmail.com> Date: Tue, 26 Jan 2021 23:24:56 +0100 In-Reply-To: <20210119154525.11230-1-zimon.toutoune@gmail.com> (zimoun's message of "Tue, 19 Jan 2021 16:45:25 +0100") Message-ID: <87ft2nwd3b.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: 45984@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.85 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: CC5A194043A X-Spam-Score: -2.85 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1cp4UKsZ+AqY Hi! zimoun skribis: > This corner case #1 happens when the package does not exist; then the fun= ction > 'lookup-node' is not able to "unpack" the 'values' and throw and ugly > backtrace, as exposed in bug#44114 . > > With these trivial patches, it is fixed for all the importers except 'opa= m' > (because of 'and-let' which needs some care). Neat! > Now, instead of throwing an ugly backtrace, it simply say almost nothing: > > $ ./pre-inst-env guix import cran do-not-exist -r > error: failed to retrieve package information from "https://cran.r-projec= t.org/web/packages/do-not-exist/DESCRIPTION": 404 ("Not Found") > > $ ./pre-inst-env guix import pypi do-not-exist -r > following redirection to `https://pypi.org/pypi/do-not-exist/json/'... > #f > > > This non-existent message is because the error is poorly handled. With t= he 4 > patches, the situation is the same as "guix import gem" for all the impor= ters > with the recursive option. One way for a better error handling is done i= n the > last commit for 'guix import gem' only; the same trick can be done for al= l. > > $ guix import gem do-not-exist -r > #f > > $ ./pre-inst-env guix import gem do-not-exist -r > guix import: error: failed to download meta-data for package 'do-not-exis= t' I think we do want this error message. Why should we ignore non-existent packages when doing =E2=80=98-r=E2=80=99? It would think they= =E2=80=99re still a problem, no? > In my opinions, UI messages should not appear in guix/import/*.scm but on= ly in > guix/scripts/*.scm. I agree with the general idea, though sometimes taking this shortcut is beneficial (maybe not in this case?). > If I understand correctly, then the way the errors are reported could be > uniformized between all the importers, and maybe the snippet in the subco= mmands > "guix import " could be refactorized a bit. Probably. =E2=80=98-r=E2=80=99 started as an option specific to one import= er, but now that most of them (?) support it, it=E2=80=99d make sense to rethink the interfaces. Thanks for looking into it! Ludo=E2=80=99.