From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iAmmMdG12WCFewEAgWs5BA (envelope-from ) for ; Mon, 28 Jun 2021 13:43:13 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EGNfLdG12WANdwAA1q6Kng (envelope-from ) for ; Mon, 28 Jun 2021 11:43:13 +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 7BA2927834 for ; Mon, 28 Jun 2021 13:43:13 +0200 (CEST) Received: from localhost ([::1]:39252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxpfU-0005hk-76 for larch@yhetil.org; Mon, 28 Jun 2021 07:43:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxpfL-0005hS-7g for guix-patches@gnu.org; Mon, 28 Jun 2021 07:43:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39633) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lxpfL-0006uB-0A for guix-patches@gnu.org; Mon, 28 Jun 2021 07:43:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lxpfK-0004Ts-9p for guix-patches@gnu.org; Mon, 28 Jun 2021 07:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49196] [PATCH] import: utils: 'recursive-import' skips unfound packages Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 28 Jun 2021 11:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49196 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen Cc: 49196@debbugs.gnu.org, =?UTF-8?Q?J=C3=A9r=C3=A9my?= Korwin-Zmijowski Received: via spool by 49196-submit@debbugs.gnu.org id=B49196.162488056617201 (code B ref 49196); Mon, 28 Jun 2021 11:43:02 +0000 Received: (at 49196) by debbugs.gnu.org; 28 Jun 2021 11:42:46 +0000 Received: from localhost ([127.0.0.1]:51179 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxpf4-0004TN-Dy for submit@debbugs.gnu.org; Mon, 28 Jun 2021 07:42:46 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:35488) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxpf1-0004T5-8y for 49196@debbugs.gnu.org; Mon, 28 Jun 2021 07:42:45 -0400 Received: by mail-qk1-f172.google.com with SMTP id q190so27050725qkd.2 for <49196@debbugs.gnu.org>; Mon, 28 Jun 2021 04:42:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=PDsX5SYmlU78jiHwO2tVkXni3x1yyyD50t036g50Eoo=; b=W/0HfCS+VUUsLB4IOSp6SAFlTTsiv3Q98czvaZEPdmhbiKLQbBCQOhnXWn0Oe90arR mBXyGUQoqJIdgH/mM2K0yUhYUuYvIrY6rW7YLUN99iwRngS96A2ody/JGNbyp4jISknc y6csfMoLsCNqKmkxkXNsDtVsJlJS5NgLZ3BUNFuNzFBsdWclLA7YFbop+zFZVam2tLJs GJYWnKbg4MnQXPv08yGjxZ6qUVFxcHj/SNsEC+CJ7/58b3uq0fs+9u4z98ToYhHFIxTv uD+AGguYM7AboJwLd3l1G/vDK2nlzjLQApDVCCkmW7gFXpxb3EyTOll/qF7JxFfwqzXT qivg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=PDsX5SYmlU78jiHwO2tVkXni3x1yyyD50t036g50Eoo=; b=afkuuAUVSb5g/rxXi8555QmQ5JRs8rJZzUpnIjco/XmNZTpCrRNSGYcaZtoDQY9Vbd /fL+N5VaTzPo2l1e7ht4gruJEQA0rbYSvVzz5DiS9dWwatDRsP6//r1piRFDgAUToDZ4 h/5M0Mk6WGOmRU9t2zrcfPzFCcqOn2p4mQUE5tvyPYGqNTIBQ+atP0RxhOGZn+VxRZ4E KvhKwDOzIPNYXVCh+oebRBTA2o6bxSH1Nz53hi0vbWLpoR39RSboff6vW0J061i3uLmo Fy/+UZbf5al9B7yBnsJ8rQnc2rlHirAlHMMV3AFl3dnwW9qJbA19ZkJataBRxqeYENyr ucdQ== X-Gm-Message-State: AOAM532pGmhCCzG/EKiPeRTuf8NR+IusNAKppr2rqYlGJBjCLuYsYc6T Z06L/v5jbzJafdIQFspqJEBKQOpSSN8pEr+rTNI= X-Google-Smtp-Source: ABdhPJwU9cMGTgYpotVuRdfuMKTKUmQu/bI8OXSLWiTzBdXCqPsxZ+lfOhZm0XYQfWwovT4xWburpFfD4TugkrOWDyQ= X-Received: by 2002:a05:620a:543:: with SMTP id o3mr25129954qko.80.1624880557680; Mon, 28 Jun 2021 04:42:37 -0700 (PDT) MIME-Version: 1.0 References: <20210625163749.65196-1-zimon.toutoune@gmail.com> <20210625163749.65196-3-zimon.toutoune@gmail.com> <868s2v7w4t.fsf_-_@mgsn.dev> In-Reply-To: <868s2v7w4t.fsf_-_@mgsn.dev> From: zimoun Date: Mon, 28 Jun 2021 13:42:26 +0200 Message-ID: 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: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: 7BA2927834 X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: OglrCIQypLhI Hi, On Sun, 27 Jun 2021 at 06:46, Sarah Morgensen wrote: > A catch-all is fine, but we should at least report the actual error, > even if it's not pretty: > > (warning (G_ "Failed to import package ~s.~% reason: ~s") > package-name (exception-args c)) Well, why not, even if I am not convinced the reason is meaningful because it is mostly an incorrect parsing which returns: reason: ("match" "no matching pattern" #f). and I think it is better to display the complete 'args' instead of extract the URL (package-name) from 'args'. > However, if we want to move in the direction of proper error handling > like guix/packages.scm and guix/ui.scm, we can do something like... Thanks for the idea. As explained patch#45984 [1], all the UI messages must be in guix/scripts/import and not in guix/import and therefore, indeed, error reporting needs to be unified between all the importers and raised accordingly; that's what we are working on with jeko (J=C3=A9r=C3=A9my Korwin-Zmijowski) as pair-programming exercise. :-) 1: > --8<---------------cut here---------------start------------->8--- > (define (report-import-error package-name error) > (cond > ((http-get-error? error) > [...] > (else > [...])))) > > (define* (go-module->guix-package* module-path > #:key (on-error report-import-error) > #:allow-other-keys #:rest args) > (with-exception-handler > (lambda (error) > (on-error module-path error) > (values #f '())) > (lambda () (apply go-module->guix-package module-path args)) > #:unwind? #t)) > > (define* (go-module-recursive-import package-name > #:key (goproxy "https://proxy.golang= .org") > version > pin-versions?) > (recursive-import > package-name > #:repo->guix-package > (memoize > (lambda* (name #:key version repo) > (go-module->guix-package* name #:goproxy goproxy > #:version version > #:pin-versions? pin-versions?))) > #:guix-name go-module->guix-package-name > #:version version)) > --8<---------------cut here---------------end--------------->8--- > > Looks like I got a little carried away :) But breaking out the error > reporting gives us the future option of "plugging in" other error > reporting strategies, such as collating them and returning them > alongside a programmatic recursive import, or being able to provide a > list of packages which failed to import at the end. This will be much > more useful once we have a proper set of import error conditions. Back to the initial patch, I think it is better to simply fix with the minor improvements of v3 your proposed and let this last proposal for #45984; feel free to comment there. ;-) Cheers, simon