From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oHYtB7eTa2TpQAAASxT56A (envelope-from ) for ; Mon, 22 May 2023 18:09:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id oPByBreTa2TXBgEAG6o9tA (envelope-from ) for ; Mon, 22 May 2023 18:09:27 +0200 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 B26482D18A for ; Mon, 22 May 2023 18:09:26 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q1860-0005rS-BU; Mon, 22 May 2023 12:09:16 -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 ) id 1q185n-0005nM-2x for guix-patches@gnu.org; Mon, 22 May 2023 12:09:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q185m-0001vr-QW for guix-patches@gnu.org; Mon, 22 May 2023 12:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q185m-000673-Mg for guix-patches@gnu.org; Mon, 22 May 2023 12:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63647] [PATCH 2/2] guix: import: go: Catch Git error. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 22 May 2023 16:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63647 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63647@debbugs.gnu.org Cc: Felix Lechner , Simon Tournier Received: via spool by 63647-submit@debbugs.gnu.org id=B63647.168477171323449 (code B ref 63647); Mon, 22 May 2023 16:09:02 +0000 Received: (at 63647) by debbugs.gnu.org; 22 May 2023 16:08:33 +0000 Received: from localhost ([127.0.0.1]:36046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q185J-000663-13 for submit@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 ) id 1q185F-00065i-WA for 63647@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@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 Date: Mon, 22 May 2023 18:08:17 +0200 Message-Id: <307ae354ce980b521ae5878dd0710bd89f1ad0c5.1684771100.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1684771766; a=rsa-sha256; cv=none; b=cbZx3RH7KNpEEWr9vbrfysYKIV0YojH85QB003ipD07BcPgwPmoU66MOFpYahR6Y24C0qR wXvEEkMOnewZhXWp0/6BTFKYyFD53DiYwu5Lf7YtQ8TJ6InzOWeJ499j2RpskGeqPhXnZH NjZBfBnJJYRddlBoz56bKy9ItnSNntRr+wOsBPVjJw8l+e11omb4rkid/Cc0lUjag9RQA4 tH2oBcVG4K712YtHos/wdaoeS0EYnjwstmnX50gazE6cHlY90vtOYuzskkpWSjd6fv7asd 2YQo0VIPiydipUcfxUW5+U2s7sHV8gHYDxX+51Ctg7mzeSuPoBOH/6VQY3G1eQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=e8W7N3UE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1684771766; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=CSnHPMzezOPOSZyv6KXp9jZFfx9VEwTPOCtQsJi6uGA=; b=kQ7G9Bv/8xEtN8RgCH7Eb5AsPpcsiGg8R5PGkVS4ST9fHr1kzpUE2gQ/oOXK6AQx5hsomr kQ9w53CcBY9wSZEQPINCOlOK7Wi0cFlWEFSwIFk5KTwgEhqkBwJlzDebZoHtOrz/vu3Mnm KlOGuRCHV9QPk7OwUNZfxVpolGR+Q1p3Mv8YBuc0aVeLMELRPML4lCdurxYaRt133yQZYq j/nl0z020Eie37MiwrW7FX2WHGqBI+jt7/IeTBX/jHK3ktM608db9tFOAYYCaRjLw6QkTx Ah4JW9alXp1u0YtuFlqYCQZI38JLzbMwk5Js4/jrVWSqQhPGd7zi63BoPX1G4A== X-Migadu-Spam-Score: -2.11 X-Spam-Score: -2.11 X-Migadu-Queue-Id: B26482D18A X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=e8W7N3UE; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-TUID: 8VDTILpZro5d * guix/import/go.scm (git-checkout-hash): Catch Git error. Reported-by: Felix Lechner . --- 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 ;;; Copyright © 2021 Xinglu Chen ;;; Copyright © 2021 Sarah Morgensen -;;; Copyright © 2021 Simon Tournier +;;; Copyright © 2021, 2023 Simon Tournier ;;; ;;; 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