From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4KvECVe80GGfeAEAgWs5BA (envelope-from ) for ; Sat, 01 Jan 2022 21:40:55 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id bU1MAle80GGt7QAAG6o9tA (envelope-from ) for ; Sat, 01 Jan 2022 21:40:55 +0100 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 87D3322989 for ; Sat, 1 Jan 2022 21:40:52 +0100 (CET) Received: from localhost ([::1]:57196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n3lBL-0007a5-OA for larch@yhetil.org; Sat, 01 Jan 2022 15:40:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n3lAZ-0007ZH-DG for guix-patches@gnu.org; Sat, 01 Jan 2022 15:40:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:47924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1n3lAY-0003vv-Uc for guix-patches@gnu.org; Sat, 01 Jan 2022 15:40:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1n3lAY-0003CK-T0 for guix-patches@gnu.org; Sat, 01 Jan 2022 15:40:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#50072] [PATCH v2 0/4] Add upstream updater for git-fetch origins References: In-Reply-To: Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 01 Jan 2022 20:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50072 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50072@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Sarah Morgensen , Maxime Devos Received: via spool by 50072-submit@debbugs.gnu.org id=B50072.164106959212238 (code B ref 50072); Sat, 01 Jan 2022 20:40:02 +0000 Received: (at 50072) by debbugs.gnu.org; 1 Jan 2022 20:39:52 +0000 Received: from localhost ([127.0.0.1]:59463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAN-0003BD-TB for submit@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:52 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:42626) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1n3lAL-0003Aj-Bi for 50072@debbugs.gnu.org; Sat, 01 Jan 2022 15:39:50 -0500 Received: from localhost.localdomain ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id dYfm2600C4UW6Th06Yfmk4; Sat, 01 Jan 2022 21:39:47 +0100 From: Maxime Devos Date: Sat, 1 Jan 2022 20:39:36 +0000 Message-Id: <20220101203940.149517-1-maximedevos@telenet.be> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1641069587; bh=4TR2TRkDnZZ5VrHGZQLlq3IsEXRDkWwR3rnuo+l5pM4=; h=From:To:Cc:Subject:Date; b=EKz3jyQIGL1h9TrTuVwG+5Nt2gTDhPTj64K2T3OuB0/xMDDE85Thv/VnHiUY8Zn6r gGxte6EgHUGA9cG9scota+zGk4IRKo3A2MTQhcOb8GTQxPVtu8ZSebVyyuX2VS7EPL UqZUsGlwV40LjNAIXUNgyCJJerEEeHnFdBTOz/4vbDTpVM2Psjaf7R28sGPQjb9tNJ AYEiB1a51Ei4/u+QRdySwA3zQUQyo7PlW577iReZbhGZ866/pMfm396gcvlIe6qcpV YLsNM+XFp//zDx1pxES82sAE6Mq4lqM+fgLevmvoKccCa8MsXwum9GQHuVtzj6gdM0 8DiGmoVPUkl4g== 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-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641069652; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=4TR2TRkDnZZ5VrHGZQLlq3IsEXRDkWwR3rnuo+l5pM4=; b=lTbhqiThrJtnXyBxEsAsoH0shZN/T5jkNaIBtfnxHO/WWCvAKmMnEYWcgWGMeO60jV38Le cu+U3NCoEt67nTozEGan1zo0tuc7DHnaOMb4mVx/nhBqqaJMZ8BU4i7PfhQPLFE1fOyAGO hcZJqdr1NPg8Whv9APgvvcr+daaGU+83q7p5inV9gEj4pPZhOGdlQ8eaDkvT0JcjW5rg9Q L/Z6PO637nXS6012BUYgbWoW7UsCYtdrsBra42gJh0UanVwDsVJtfnRkINhVEWDIw53GSo j4azxfSkzGFGgvgeEUNChW94TwDa7j1OPA65mQvuNqZ9IS0w1tiOLDndiYWTyA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641069652; a=rsa-sha256; cv=none; b=Hw6yzSei29sNmftyrFuojIjRAx2uJXJgInpiwJ8Bl5FMpVaYVpV4FBRtbf5NrTrItcgQZU /skJ6ZPVx6pOHMHz5gz/ZC/F/Ncf31p8pO6QzR+esakFvkSqnP6DHYDROa9F0RBxxszWcK kkS2U/U5f1X/YCH2FoRwO925gtJl2p816QG2NsU9uUTUznDMhY/3816Bj6AVHqx8E5p8ac I92cjNcrVtbGfPfPDmxhJbZnycSDtOleuhvgqqy25YJOPAEe7Uu1INB1S5IDi7X6XJzpAq 3UUjQgAY50N1qIGoOva9GLCuDb3Z45CtJxq8yLEPWgzGsh2RiEg2LDvVOwXGGA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=EKz3jyQI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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-Migadu-Spam-Score: 0.12 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r21 header.b=EKz3jyQI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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-Migadu-Queue-Id: 87D3322989 X-Spam-Score: 0.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: 1AMZb1u9v+j0 Hi, This is a combination of Sarah's patches and the patch I wrote. Some differences: 'guix/hash.scm' is added to Makefile.am. I modified the 'generic-git' and 'minetest' updater to return 'git-reference' objects. There's no guess-version-transform procedure. Due to letting updaters return git-reference objects, guessing isn't necessary. This also allows using commits. In contrast to my original version, it not only supports commits, but also tags (using 'tag-or-commit'), like in Sarah's version. I didn't use checkout-to-store, because it is used in only a single location and is only a basic wrapper around latest-repository-commit. I didn't look at testing if (let ((commit ...) (revision ...)) (package ...)) works. If it doesn't, that could be implemented in a separate patch. '--with-latest' with a git source fails with a nice error message. Some tests: $ make check # no failures $ ./pre-inst-env guix refresh minetest-mobs-animal -u --type=generic-git The result seems largely reasonable: the version changed, and the commit changed to a new tag. However, the URL changed from mixed case to lowercase. Maybe a todo for later: use the original URL if it only changed in case. Also, the version switched from YYYY-MM-DD to YYYY.MM.DD. Maybe change the minetest importer to use the latter, to keep minetest and generic-git consistent? TODO for later! A bug: the sha256 hash isn't updated. I don't know why. I investigated a little, and it turns out that 'latest-repository-commit' is called with the new tag, but the store item corresponds the old commit. Weird! $ # undo the update $ ./pre-inst-env guix refresh minetest-mobs-animal -u --type=minetest No problems at all (except the mixed case -> lowercase). The commit and sha256/base32 are updated! $ ./pre-inst-env guix build minetest-mobs-animal This builds successfully. $ # undo changes $ ./pre-inst-env guix build minetest-mobs-animal --with-latest=minetest-mobs-animal It fails gracefully with: guix build: error: git origins are unsupported by --with-latest Also, do tarball origins still function? They do: $ # move GNU "hello" to an earlier version, then do $ ./pre-inst-env guix build hello --with-latest=hello This build hello@2.10 -- the output path is the same as before moving 'hello' to an earlier version. $ ./pre-inst-env guix refresh -u hello The version is updated to @2.10, but sha256 isn't changed? Seems like a bug, but it doesn't appear to be a regression. Sarah Morgensen (4): guix hash: Extract file hashing procedures. import: Factorize file hashing. refresh: Support non-tarball sources. upstream: Support updating 'git-fetch' origins. Makefile.am | 1 + guix/hash.scm | 51 ++++++++++++++++++++++++++++++++++ guix/import/cran.scm | 32 ++------------------- guix/import/elpa.scm | 29 +++---------------- guix/import/git.scm | 22 +++++++++------ guix/import/go.scm | 25 ++--------------- guix/import/minetest.scm | 24 +++++++--------- guix/scripts/hash.scm | 18 ++---------- guix/scripts/refresh.scm | 10 +++---- guix/upstream.scm | 60 ++++++++++++++++++++++++++++++++++++---- tests/minetest.scm | 7 ++--- 11 files changed, 151 insertions(+), 128 deletions(-) create mode 100644 guix/hash.scm base-commit: 9708681f1a9f221ae6cad64625ba8309b6742653 -- 2.30.2