GNU bug report logs - #63647
[PATCH 0/2] Fix annoyance with "guix import go"

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Simon Tournier <zimon.toutoune@HIDDEN>; Keywords: patch; dated Mon, 22 May 2023 16:06:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 63647 <at> debbugs.gnu.org:


Received: (at 63647) by debbugs.gnu.org; 22 May 2023 16:08:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 22 12:08:33 2023
Received: from localhost ([127.0.0.1]:36046 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q185J-000663-13
	for submit <at> debbugs.gnu.org; Mon, 22 May 2023 12:08:33 -0400
Received: from mail-wm1-f47.google.com ([209.85.128.47]:39963)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1q185F-00065i-WA
 for 63647 <at> debbugs.gnu.org; Mon, 22 May 2023 12:08:31 -0400
Received: by mail-wm1-f47.google.com with SMTP id
 5b1f17b1804b1-3f4289f7c1cso4870825e9.0
 for <63647 <at> debbugs.gnu.org>; Mon, 22 May 2023 09:08:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684771704; x=1687363704;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=CSnHPMzezOPOSZyv6KXp9jZFfx9VEwTPOCtQsJi6uGA=;
 b=e8W7N3UEBEgW7sFemAORqCCHRkbR7KRtymC/3lhpwPJ2dB0syMYXxYSyeZNO11oM7v
 Dsl36VfG3SubazfEodDEW5j8/00vSNNA9L4I+dFOJ/WhbdTb2hcaz6Z+KqFp59k6MmYS
 VWrzVVzbzsgkDQczc1RSKyoBlo55D6gsBbYFyeijvqsxT9I29h4irb1pqKfsCSzfBKic
 6TARPIp5yqCk5sV6MoelTpyjtG6UX4sSQ5hynmLYCBtnottRKqt++VBvmzM2zOnyQaK/
 wnpjN5d7gjt1VP/Oi1y1ARVgrr7M3X0Key2SG6Ucvo8HgGEav3h2Pshr59sF1Pi6Nk7f
 PwlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684771704; x=1687363704;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=CSnHPMzezOPOSZyv6KXp9jZFfx9VEwTPOCtQsJi6uGA=;
 b=bm7WtVOvfBxxj0DP4oKTn9d8t4RPX+Cz2PxJGhX1JN5CeANV3k9jeJOPb37k5bnOYA
 K4+9SH+CcL4Z9viyoeQDz/h0wAzj5odSyMruJYcRNiohnULqKhoSrJO7hJIQDLZ/Abu7
 2q313p7Dtw6nbx/QDULRlQCLYuTKQ/4J0pAIT8buZ5VNYUaPHREbFxQziTfMTGmcAw0w
 prTn/tEvYcyL54x6emnbU97iJA4KZ/7Bl8oCsMi82tANwi6esjrwDoMhSagWtS5KTPfm
 nxrS2nyo0eB4DBgsBOKpoTDZOoOqDzJFWfNmKJlsY5UJpRkx5oIGtVgtNKhQX4dToy+L
 PCHg==
X-Gm-Message-State: AC+VfDyBRE8yKmX3Iu9TaivWGPxt/JBsLQHm354D+Ja4I97JeYaaRw+m
 spSatMrl6lzYL/swQZBJSwURApl1AfU=
X-Google-Smtp-Source: ACHHUZ4hQPkwRLIbZ0fDbx8xyMpq1DvaVO9NV1F9UrvLClPSPwYBhNvFxLhOTWqthml5XcJeCNhq/Q==
X-Received: by 2002:a05:600c:35c7:b0:3f4:27ec:9d12 with SMTP id
 r7-20020a05600c35c700b003f427ec9d12mr8377481wmq.4.1684771704016; 
 Mon, 22 May 2023 09:08:24 -0700 (PDT)
Received: from localhost.localdomain ([193.48.40.241])
 by smtp.gmail.com with ESMTPSA id
 u3-20020a7bc043000000b003f4f89bc48dsm12025107wmc.15.2023.05.22.09.08.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 22 May 2023 09:08:23 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: 63647 <at> debbugs.gnu.org
Subject: [PATCH 2/2] guix: import: go: Catch Git error.
Date: Mon, 22 May 2023 18:08:17 +0200
Message-Id: <307ae354ce980b521ae5878dd0710bd89f1ad0c5.1684771100.git.zimon.toutoune@HIDDEN>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <cover.1684771100.git.zimon.toutoune@HIDDEN>
References: <cover.1684771100.git.zimon.toutoune@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 63647
Cc: Felix Lechner <felix.lechner@HIDDEN>,
 Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/import/go.scm (git-checkout-hash): Catch Git error.

Reported-by: Felix Lechner <felix.lechner@HIDDEN>.
---
 guix/import/go.scm | 24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index 1943869162..c6258296f6 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -6,7 +6,7 @@
 ;;; Copyright © 2021-2022 Ludovic Courtès <ludo@HIDDEN>
 ;;; Copyright © 2021 Xinglu Chen <public@HIDDEN>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian@HIDDEN>
-;;; Copyright © 2021 Simon Tournier <zimon.toutoune@HIDDEN>
+;;; Copyright © 2021, 2023 Simon Tournier <zimon.toutoune@HIDDEN>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -36,9 +36,11 @@ (define-module (guix import go)
   #:use-module (guix memoization)
   #:use-module (guix utils)
   #:autoload   (htmlprag) (html->sxml)            ;from Guile-Lib
-  #:autoload   (guix base32) (bytevector->nix-base32-string)
+  #:autoload   (guix base32) (bytevector->nix-base32-string nix-base32-string->bytevector)
   #:autoload   (guix build utils) (mkdir-p)
+  #:autoload   (guix ui) (warning)
   #:autoload   (gcrypt hash) (hash-algorithm sha256)
+  #:autoload   (git structs) (git-error-message)
   #:use-module (ice-9 format)
   #:use-module (ice-9 match)
   #:use-module (ice-9 peg)
@@ -507,12 +509,18 @@ (define* (git-checkout-hash url reference algorithm)
   ;; subsequent "guix import" invocations.
   (mkdir-p cache)
   (chmod cache #o700)
-  (let-values (((checkout commit _)
-                (parameterize ((%repository-cache-directory cache))
-                  (update-cached-checkout url
-                                          #:ref
-                                          `(tag-or-commit . ,reference)))))
-    (file-hash* checkout #:algorithm algorithm #:recursive? #true)))
+  (catch 'git-error
+    (lambda _
+      (let-values (((checkout commit _)
+                    (parameterize ((%repository-cache-directory cache))
+                      (update-cached-checkout url
+                                              #:ref
+                                              `(tag-or-commit . ,reference)))))
+        (file-hash* checkout #:algorithm algorithm #:recursive? #true)))
+    (lambda (key error . rest)
+      (warning (G_ "Git error: ~a in ~a~%") (git-error-message error) url)
+      (nix-base32-string->bytevector
+       "0000000000000000000000000000000000000000000000000000"))))
 
 (define (vcs->origin vcs-type vcs-repo-url version)
   "Generate the `origin' block of a package depending on what type of source
-- 
2.38.1





Information forwarded to guix-patches@HIDDEN:
bug#63647; Package guix-patches. Full text available.

Message received at 63647 <at> debbugs.gnu.org:


Received: (at 63647) by debbugs.gnu.org; 22 May 2023 16:08:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 22 12:08:33 2023
Received: from localhost ([127.0.0.1]:36044 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q185I-000661-Mi
	for submit <at> debbugs.gnu.org; Mon, 22 May 2023 12:08:32 -0400
Received: from mail-wm1-f42.google.com ([209.85.128.42]:41138)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1q185F-00065g-MV
 for 63647 <at> debbugs.gnu.org; Mon, 22 May 2023 12:08:31 -0400
Received: by mail-wm1-f42.google.com with SMTP id
 5b1f17b1804b1-3f5dbdbb477so3863195e9.0
 for <63647 <at> debbugs.gnu.org>; Mon, 22 May 2023 09:08:29 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684771704; x=1687363704;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:from:to:cc:subject:date
 :message-id:reply-to;
 bh=I3d9niv4mWlH5hxD8Q+v9x5ZNqotjYBaQ/qiGR/672s=;
 b=gzmjQLjKnIEBo2T1Dlf9MapU3tcPdU0umIN9soCTJVt77fRFJUObG7rgyYluyeEPHO
 DgiUyAwHrBAt2fDqc4zr/raYlhwqvOzVVi3XyjMipj/PB9zVTgFKM/+cQxYBsYhL0GAI
 S/FBDF/xXuFlZnYrBiuPwc1MP9dVHLLMOk6n+aRSpqXjdCh+u075G/1WIAJtovLOPLGo
 2ItN4ftdx5K0lJ474OfsxaZeOjVJXC2Fes0ORxn9Aglt8rILpXwVt+/eEswRcEy4CFJH
 613ywU3JbKwvlLER6D1fzkdAL3gw+fPL9qFasarshA5aGI8QByuKETNqRcGVe8voxq56
 j+fw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684771704; x=1687363704;
 h=content-transfer-encoding:mime-version:references:in-reply-to
 :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=I3d9niv4mWlH5hxD8Q+v9x5ZNqotjYBaQ/qiGR/672s=;
 b=CGYTEdOks0H3a8rfTrcdUEcrRXXkuToAiSRR2owLlc9Qdytq97n5BxrEA4gS6uhwSX
 o/SU+owYt5wyQ85pZOIRFcUbBtz9KamIFb2TplEkvSYOdvVH90rZIYhMbg+7aBiy/NWO
 DzIk2vyFeLmlPG4iVJWUqJcEMV7dzdmNSOU8gT20reeQP8q/t67Ybu6ltJXFox/61VmR
 zXL3bwzHX/prNXl9w6rmlRK6t4SRrc6Sbh4U+QKlTnWFmXcSSf8D1blR2CNheaa3fd2o
 QdOBofFf1hrirPHwlIg2auAAWLpvEvD2bYakHBRQ7LvaHb+4Jps9SY6B1NDKP6Ez42pK
 g/kw==
X-Gm-Message-State: AC+VfDzDVX1ExnPuZBRXUXTpwtRYX37zE0y6IBHWUqdZ1iUMJpk83GCJ
 DIjiCiVBuNMpZPFEKRT0rIGYHGyv5sw=
X-Google-Smtp-Source: ACHHUZ4hqxr7fVpw5eryfs28vFrKWQbPO9Pz3Q8oXA5ODLKBXzPSe+fLLrV2dh9+sI64+VlZJikbuw==
X-Received: by 2002:a05:600c:3ba5:b0:3f5:ffe8:94ac with SMTP id
 n37-20020a05600c3ba500b003f5ffe894acmr5189617wms.0.1684771703595; 
 Mon, 22 May 2023 09:08:23 -0700 (PDT)
Received: from localhost.localdomain ([193.48.40.241])
 by smtp.gmail.com with ESMTPSA id
 u3-20020a7bc043000000b003f4f89bc48dsm12025107wmc.15.2023.05.22.09.08.23
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 22 May 2023 09:08:23 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: 63647 <at> debbugs.gnu.org
Subject: [PATCH 1/2] guix: import: go: Sort hint about available versions.
Date: Mon, 22 May 2023 18:08:16 +0200
Message-Id: <5cb8f8989fccc4580d10b7e39633f8880c838236.1684771100.git.zimon.toutoune@HIDDEN>
X-Mailer: git-send-email 2.39.2
In-Reply-To: <cover.1684771100.git.zimon.toutoune@HIDDEN>
References: <cover.1684771100.git.zimon.toutoune@HIDDEN>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 63647
Cc: Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

* guix/import/go.scm (validate-version): Sort available versions.
---
 guix/import/go.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/import/go.scm b/guix/import/go.scm
index 0357e6a1eb..1943869162 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -34,6 +34,7 @@ (define-module (guix import go)
   #:use-module (guix packages)
   #:use-module (guix http-client)
   #:use-module (guix memoization)
+  #:use-module (guix utils)
   #:autoload   (htmlprag) (html->sxml)            ;from Guile-Lib
   #:autoload   (guix base32) (bytevector->nix-base32-string)
   #:autoload   (guix build utils) (mkdir-p)
@@ -588,8 +589,9 @@ (define (validate-version version available-versions module-path)
         (condition (&fix-hint
                     (hint (format #f (G_ "Pick one of the following \
 available versions:~{ ~a~}.")
-                                  (map strip-v-prefix
-                                       available-versions)))))))))
+                                  (sort (map strip-v-prefix
+                                             available-versions)
+                                        version>?)))))))))
 
 (define* (go-module->guix-package module-path #:key
                                   (goproxy "https://proxy.golang.org")
-- 
2.38.1





Information forwarded to guix-patches@HIDDEN:
bug#63647; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 22 May 2023 16:05:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon May 22 12:05:10 2023
Received: from localhost ([127.0.0.1]:36038 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1q1821-00060m-SO
	for submit <at> debbugs.gnu.org; Mon, 22 May 2023 12:05:10 -0400
Received: from lists.gnu.org ([209.51.188.17]:54072)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <zimon.toutoune@HIDDEN>) id 1q181x-00060Z-4c
 for submit <at> debbugs.gnu.org; Mon, 22 May 2023 12:05:08 -0400
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 <zimon.toutoune@HIDDEN>)
 id 1q181v-0003aG-Tn
 for guix-patches@HIDDEN; Mon, 22 May 2023 12:05:04 -0400
Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <zimon.toutoune@HIDDEN>)
 id 1q181r-0000kO-Jz
 for guix-patches@HIDDEN; Mon, 22 May 2023 12:05:03 -0400
Received: by mail-wm1-x335.google.com with SMTP id
 5b1f17b1804b1-3f50020e0f6so6179775e9.1
 for <guix-patches@HIDDEN>; Mon, 22 May 2023 09:04:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1684771498; x=1687363498;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=7/Sm6YgG1lYCUk8oHeDqaaB8zYoy7QOCsd/98gb1Qw4=;
 b=OoS7AZkPp7WxtfCdTIAujp0ZCkX7gHE/ay6HamkO2eX7TtEXob28pxUUaQwRmI5LMI
 xD2KEaHZvxBTajfsjnmOY7BZK3BAgpbk+fO0Xgc9BxzRHJ0O16B0VHFe5OYJe+gwKcHB
 gobukm2dWo5nmoG6+dgzS5EECSSMDAypmVh991wA3hHT7ztcZ0eiwHR4dLexpoy5d7kt
 pEt0vO6o8U0ye16nhNGvGDNtIXCEJ8K4QdEXaMw6l1j1GPRPSYSOquAq5A56oefzqIsX
 z4cdvUcZ6onx+RJOd9G5LzN8fm2xog7MN03bpJd9qSrSoNIWrBy2BMArnSqbG7DOb6Wm
 ib6w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1684771498; x=1687363498;
 h=content-transfer-encoding:mime-version:message-id:date:subject:cc
 :to:from:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=7/Sm6YgG1lYCUk8oHeDqaaB8zYoy7QOCsd/98gb1Qw4=;
 b=U8D8LNH5mGRIqAWVx5jmzl5V6PvylgQgZ4dlWi53ASeQUR2pZL6jZ/+9zABfr/fUzl
 0wBVmZQ2sxZ3He7eSUZmbmJd5Lksv3m3hVkv4H1EBbWnp1pbmut61iQASxVmCbz3mLnM
 5xzMH6DhosvQfbHjTLTjTXATJsdEYkpNsNx9HfoZYE/D9ZqxNlN0juFxr8/rAYogcYMX
 Jbnl+uyuJfwiGjglVRYFtBrk8VGRCC/BxLrA4x59lmrscvnebZou3hlbB99ReaS2Cw69
 xWmBMEsHoZ/Hq+nT7rJkE2ekGmAIaTeJ6jN0MrOY25BXVK+XqWPt4Mq4e7DXympR6Z4S
 1+ew==
X-Gm-Message-State: AC+VfDz3qWEPksbCALxrMtmLCIjpUY79ovxFrMfFFaytftiFUOdJaDDo
 PsBw+hpyd5cmaE26DQ5/b0Lv0rFCbL8=
X-Google-Smtp-Source: ACHHUZ4y/HAarPRfohh0C8prEROv+qwEBaCkgsInnP7crlUOqRiPyEFO/RqtbSRq7Zxw6c929U3E7g==
X-Received: by 2002:a5d:4d4b:0:b0:2e4:aa42:7872 with SMTP id
 a11-20020a5d4d4b000000b002e4aa427872mr7345657wru.4.1684771497649; 
 Mon, 22 May 2023 09:04:57 -0700 (PDT)
Received: from localhost.localdomain ([193.48.40.241])
 by smtp.gmail.com with ESMTPSA id
 p17-20020a5d4e11000000b003063772a55bsm8110387wrt.61.2023.05.22.09.04.57
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Mon, 22 May 2023 09:04:57 -0700 (PDT)
From: Simon Tournier <zimon.toutoune@HIDDEN>
To: guix-patches@HIDDEN
Subject: [PATCH 0/2] Fix annoyance with "guix import go"
Date: Mon, 22 May 2023 18:04:50 +0200
Message-Id: <cover.1684771100.git.zimon.toutoune@HIDDEN>
X-Mailer: git-send-email 2.39.2
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a00:1450:4864:20::335;
 envelope-from=zimon.toutoune@HIDDEN; helo=mail-wm1-x335.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,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Simon Tournier <zimon.toutoune@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Hi,

As reported in [1], the Go importer returns backtrace.  This patch fixes
that.  The first patch is about sorting the versions.  The second is about
warn but not exit.  It allows to have a first draft when applying recursive
importer.

Compare (first patch),

--8<---------------cut here---------------start------------->8---
$ guix import go go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@HIDDEN
guix import: error: version v0.41 of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc is not available

hint: Pick one of the following available versions: 0.26.0 0.36.0 0.15.0 0.41.0-rc.1 0.40.0 0.37.0 0.33.0 0.20.0 0.24.0 0.23.0 0.41.0 0.26.1 0.41.1 0.22.0
0.18.0 0.21.0 0.12.0 0.36.4 0.19.0 0.25.0 0.27.0 0.36.2 0.34.0 0.14.0 0.36.3 0.31.0 0.15.1 0.36.1 0.41.0-rc.2 0.32.0 0.28.0 0.35.0 0.42.0-rc.1 0.13.0
0.17.0 0.29.0 0.30.0 0.39.0 0.38.0 0.16.0.

$ ./pre-inst-env guix import go go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc@HIDDEN
guix import: error: version v0.41 of go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc is not available

hint: Pick one of the following available versions: 0.42.0-rc.1 0.41.1 0.41.0-rc.2 0.41.0-rc.1 0.41.0 0.40.0 0.39.0 0.38.0 0.37.0 0.36.4 0.36.3 0.36.2 0.36.1
0.36.0 0.35.0 0.34.0 0.33.0 0.32.0 0.31.0 0.30.0 0.29.0 0.28.0 0.27.0 0.26.1 0.26.0 0.25.0 0.24.0 0.23.0 0.22.0 0.21.0 0.20.0 0.19.0 0.18.0 0.17.0
0.16.0 0.15.1 0.15.0 0.14.0 0.13.0 0.12.0.
--8<---------------cut here---------------end--------------->8---

Then instead of,

--8<---------------cut here---------------start------------->8---
$ guix import go go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
Backtrace:
          14 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
   2300:7 13 (run-guix . _)
  2263:10 12 (run-guix-command _ . _)
In guix/scripts/import.scm:
    89:11 11 (guix-import . _)
In ice-9/boot-9.scm:
  1752:10 10 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/scripts/import/go.scm:
   116:29  9 (_)
In ice-9/exceptions.scm:
   406:15  8 (go-module->guix-package* . _)
In ice-9/boot-9.scm:
  1752:10  7 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In guix/import/go.scm:
   511:19  6 (go-module->guix-package "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" #:goproxy _ #:version _ # _)
In guix/git.scm:
    291:4  5 (update-cached-checkout _ #:ref _ #:recursive? _ #:check-out? _ #:starting-commit _ #:log-port _ #:cache-directory _)
   277:19  4 (resolve _)
In git/reference.scm:
     60:8  3 (_ _ _)
In git/bindings.scm:
     77:2  2 (raise-git-error _)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1683:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1683:16: In procedure raise-exception:
Git error: reference 'refs/tags/v0.41.1' not found
--8<---------------cut here---------------end--------------->8---

Now it returns (second patch),

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix import go go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc
guix import: warning: Git error: reference 'refs/tags/v0.41.1' not found in https://github.com/open-telemetry/opentelemetry-go-contrib
(define-public go-go-opentelemetry-io-contrib-instrumentation-google-golang-org-grpc-otelgrpc
  (package
    (name
     "go-go-opentelemetry-io-contrib-instrumentation-google-golang-org-grpc-otelgrpc")
    (version "0.41.1")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url
                     "https://github.com/open-telemetry/opentelemetry-go-contrib")
                    (commit (string-append "v" version))))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "0000000000000000000000000000000000000000000000000000"))))
    (build-system go-build-system)
    (arguments
     '(#:import-path
       "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"))
    (propagated-inputs `(("go-gopkg-in-yaml-v3" ,go-gopkg-in-yaml-v3)
                         ("go-google-golang-org-genproto" ,go-google-golang-org-genproto)
                         ("go-google-golang-org-appengine" ,go-google-golang-org-appengine)
                         ("go-golang-org-x-text" ,go-golang-org-x-text)
                         ("go-golang-org-x-sys" ,go-golang-org-x-sys)
                         ("go-golang-org-x-oauth2" ,go-golang-org-x-oauth2)
                         ("go-golang-org-x-net" ,go-golang-org-x-net)
                         ("go-github-com-pmezard-go-difflib" ,go-github-com-pmezard-go-difflib)
                         ("go-github-com-golang-protobuf" ,go-github-com-golang-protobuf)
                         ("go-github-com-go-logr-stdr" ,go-github-com-go-logr-stdr)
                         ("go-github-com-go-logr-logr" ,go-github-com-go-logr-logr)
                         ("go-github-com-davecgh-go-spew" ,go-github-com-davecgh-go-spew)
                         ("go-cloud-google-com-go-compute-metadata" ,go-cloud-google-com-go-compute-metadata)
                         ("go-cloud-google-com-go-compute" ,go-cloud-google-com-go-compute)
                         ("go-google-golang-org-protobuf" ,go-google-golang-org-protobuf)
                         ("go-google-golang-org-grpc" ,go-google-golang-org-grpc)
                         ("go-go-opentelemetry-io-otel-trace" ,go-go-opentelemetry-io-otel-trace)
                         ("go-go-opentelemetry-io-otel-metric" ,go-go-opentelemetry-io-otel-metric)
                         ("go-go-opentelemetry-io-otel" ,go-go-opentelemetry-io-otel)
                         ("go-github-com-stretchr-testify" ,go-github-com-stretchr-testify)))
    (home-page
     "https://go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc")
    (synopsis #f)
    (description #f)
    (license license:asl2.0)))[env]
--8<---------------cut here---------------end--------------->8---


Cheers,
simon


Simon Tournier (2):
  guix: import: go: Sort hint about available versions.
  guix: import: go: Catch Git error.

 guix/import/go.scm | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)


base-commit: 849286ba66c96534bddc04df1a47d5692cbc977e
-- 
2.38.1





Acknowledgement sent to Simon Tournier <zimon.toutoune@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#63647; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 22 May 2023 16:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.