From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id W8rfLAEAB2CwHQAA0tVLHw (envelope-from ) for ; Tue, 19 Jan 2021 15:51:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AElmKAEAB2BwHwAA1q6Kng (envelope-from ) for ; Tue, 19 Jan 2021 15:51:29 +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 E52DE94021E for ; Tue, 19 Jan 2021 15:51:28 +0000 (UTC) Received: from localhost ([::1]:41112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l1tHz-0002Xk-SN for larch@yhetil.org; Tue, 19 Jan 2021 10:51:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1tCp-0006o1-QQ for guix-patches@gnu.org; Tue, 19 Jan 2021 10:46:16 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:39785) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1tCk-0006ME-B3 for guix-patches@gnu.org; Tue, 19 Jan 2021 10:46:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l1tCk-0004pM-7t for guix-patches@gnu.org; Tue, 19 Jan 2021 10:46:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45984] [PATCH 0/5] Fix recursive importers Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 19 Jan 2021 15:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 45984 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 45984@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161107113818513 (code B ref -1); Tue, 19 Jan 2021 15:46:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jan 2021 15:45:38 +0000 Received: from localhost ([127.0.0.1]:51331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1tCL-0004oX-O2 for submit@debbugs.gnu.org; Tue, 19 Jan 2021 10:45:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:54996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l1tCJ-0004oL-ES for submit@debbugs.gnu.org; Tue, 19 Jan 2021 10:45:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:33010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l1tCI-0006hR-VA for guix-patches@gnu.org; Tue, 19 Jan 2021 10:45:35 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:34224) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l1tCE-0006JH-6P for guix-patches@gnu.org; Tue, 19 Jan 2021 10:45:34 -0500 Received: by mail-wr1-x42d.google.com with SMTP id g10so1809828wrx.1 for ; Tue, 19 Jan 2021 07:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=99fcIp5u3bxo2VInFniE4X+nf8ih+7hyTWVpIpCh4+A=; b=WAk85gl8uCtPn+MsguE84GceAJU65r1Y0Oh3KWqjngQJRb4n3w5HCnLPRsGaNJrhQz sBNqWy99w0j/cxA7utUfLImabJZfdcfJ9xg7CvAfaGYlQB0tY/vd/+Hua671RwQ+ehJh Z4SVD3TxqUuRriQookUiUnZYo/kVYd1HB8lbQ/dME7aF1SJw4g7M/hIohBw/K0YiZJ8V b4g+KiPxxtcgBKZenwN6Y6p3MmFxoXmoeA8llIXrwdG4RUcy/hJHomxcBDOLslAbdbcD JPM1cb2Ql3fxOer1l0B7FtomPt7C7EHY5U/J/D6TQX+2NK3PTGVXARAdZXJgZMoPCkCz PNRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=99fcIp5u3bxo2VInFniE4X+nf8ih+7hyTWVpIpCh4+A=; b=oDZQd/+CQ6kb8F/fblopAvOMii7dwGZEKiq13X4Za6DqpXbzJbB4ODkQFclAeVCh/U XAid9l9Uk1hZctN5AZmHmrbtmAsqUDpUjnKNa8L9wxwj/WdERb/CPkC2852wS2DG24xv 7vKBgG1/1XW7GCrfFynNnBnagddB5XM45fWE1OcRrZqOWfX8LlINwtP16qEwfBz7KoQp FIZQUpOAbb/QarWmVKEJbW5ktvjIinfCM0d8rtMSCg1XAjMMrN1YdvB3kpLO5bvFXD66 cUbITVRxWFIJXF35g2p+nOk70D1qQTkrS/I6vnJC62ot5/vs24RobXRYeWS77F7DDZ5u uf6Q== X-Gm-Message-State: AOAM533DZP1mitgk+AhLN6n9get4vn46NhV5tYxZSv/ull16fVBiLudZ 96/725lMy6YX2MqcqnYMYj4E6E6Z/CE= X-Google-Smtp-Source: ABdhPJzEEzGJA1nJek9I6FmBYUBuUk7OwewA1Jh6f+R3Od60lHJyhyzZyWH5nLjF1tFBvp6nrAHSWA== X-Received: by 2002:adf:ec92:: with SMTP id z18mr5123842wrn.166.1611071128852; Tue, 19 Jan 2021 07:45:28 -0800 (PST) Received: from lili.univ-paris-diderot.fr ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id u17sm4867267wmj.35.2021.01.19.07.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jan 2021 07:45:28 -0800 (PST) From: zimoun Date: Tue, 19 Jan 2021 16:45:25 +0100 Message-Id: <20210119154525.11230-1-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.75 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=WAk85gl8; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: E52DE94021E X-Spam-Score: 2.75 X-Migadu-Scanner: scn1.migadu.com X-TUID: 9n2VBfYODUPt Dear, Currently, there is 2 issues: 1. ->guix-package returning #f instead of (values #f '()) 2. error incorrectly handled by guix/scripts/import/ This corner case #1 happens when the package does not exist; then the function '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 'opam' (because of 'and-let' which needs some care). Now, instead of throwing an ugly backtrace, it simply say almost nothing: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix import cran do-not-exist -r error: failed to retrieve package information from "https://cran.r-project.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 --8<---------------cut here---------------end--------------->8--- This non-existent message is because the error is poorly handled. With the 4 patches, the situation is the same as "guix import gem" for all the importers with the recursive option. One way for a better error handling is done in the last commit for 'guix import gem' only; the same trick can be done for all. --8<---------------cut here---------------start------------->8--- $ 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-exist' --8<---------------cut here---------------end--------------->8--- In my opinions, UI messages should not appear in guix/import/*.scm but only in guix/scripts/*.scm. If I understand correctly, then the way the errors are reported could be uniformized between all the importers, and maybe the snippet in the subcommands "guix import " could be refactorized a bit. WDYT? All the best, simon zimoun (5): import: pypi: Return 'values'. import: hackage: Return 'values'. import: elpa: Return 'values'. import: cran: Return 'values'. scripts: import: gem: Fix recursive error handling. guix/import/cran.scm | 5 ++--- guix/import/elpa.scm | 7 ++----- guix/import/hackage.scm | 16 ++++++++++------ guix/import/pypi.scm | 10 +++++----- guix/scripts/import/gem.scm | 27 +++++++++++++++------------ 5 files changed, 34 insertions(+), 31 deletions(-) base-commit: 2d9c6542c804eb2ef3d8934e1e3ab8b24e9bbafb prerequisite-patch-id: 6ce76af47a26307f4b99162b5ae2b47f5e5f220f prerequisite-patch-id: 32b0ac51a8fbe72cc9204c5a6d0e2b987af7b7f6 prerequisite-patch-id: 3fa663069818b59ab4d324cc69fabcd62c5a9b50 -- 2.29.2