GNU bug report logs - #69827
[PATCH 1/3] build-system/go: Add subdir parameter to go-version->git-ref.

Previous Next

Package: guix-patches;

Reported by: Christina O'Donnell <cdo <at> mutix.org>

Date: Sat, 16 Mar 2024 10:28:02 UTC

Severity: normal

Tags: patch

Done: Sharlatan Hellseher <sharlatanus <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sharlatan Hellseher <sharlatanus <at> gmail.com>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#69827: closed ([PATCH 1/3] build-system/go: Add subdir
 parameter to go-version->git-ref.)
Date: Sun, 15 Sep 2024 20:42:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 15 Sep 2024 21:40:18 +0100
with message-id <87bk0o8xcd.fsf <at> gmail.com>
and subject line [PATCH 1/3] build-system/go: Add subdir parameter to go-version->git-ref.
has caused the debbugs.gnu.org bug report #69827,
regarding [PATCH 1/3] build-system/go: Add subdir parameter to go-version->git-ref.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
69827: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69827
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Christina O'Donnell <cdo <at> mutix.org>
To: guix-patches <at> gnu.org
Cc: Christina O'Donnell <cdo <at> mutix.org>
Subject: [PATCH 1/3] build-system/go: Add subdir parameter to
 go-version->git-ref.
Date: Sat, 16 Mar 2024 10:26:05 +0000
* guix/build-system/go.scm (go-version->git-ref): Add subdir keyword
parameter. This is needed because Go can have mutliple modules at different
versions in a single repo. It distinguishes their releases by using tags
with their subdirectory. See https://go.dev/ref/mod#vcs-version.

Change-Id: I68bc9e785e49877bb0b756de8458308549f4c957
---
 guix/build-system/go.scm | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 0934fded07..94c5439dd1 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -56,11 +56,12 @@ (define %go-pseudo-version-rx
                 "([0-9A-Fa-f]{12})"            ;commit hash
                 "(\\+incompatible)?$")))       ;optional +incompatible tag
 
-(define (go-version->git-ref version)
+(define* (go-version->git-ref version #:key subdir)
   "Parse VERSION, a \"pseudo-version\" as defined at
-<https://golang.org/ref/mod#pseudo-versions>, and extract the commit hash from
-it, defaulting to full VERSION (stripped from the \"+incompatible\" suffix if
-present) if a pseudo-version pattern is not recognized."
+<https://golang.org/ref/mod#pseudo-versions>, and extract the commit hash from it,
+defaulting to full VERSION (stripped from the \"+incompatible\" suffix if present) if
+a pseudo-version pattern is not recognized.  If SUBDIR is specified and this is not a
+pseudo-version, then this will prefix SUBDIR/ to the returned tag."
   ;; A module version like v1.2.3 is introduced by tagging a revision in the
   ;; underlying source repository.  Untagged revisions can be referred to
   ;; using a "pseudo-version" like v0.0.0-yyyymmddhhmmss-abcdefabcdef, where
@@ -78,7 +79,9 @@ (define (go-version->git-ref version)
          (match (regexp-exec %go-pseudo-version-rx version)))
     (if match
         (match:substring match 2)
-        version)))
+        (if subdir
+            (string-append subdir "/" version)
+            version))))
 
 (define (go-pseudo-version? version)
   "True if VERSION is a Go pseudo-version, i.e., a version string made of a

base-commit: efc0ee1d7f2b704d3fc0c8aea0ef0ad1ac2972e1
-- 
2.41.0



[Message part 3 (message/rfc822, inline)]
From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 69827-done <at> debbugs.gnu.org
Cc: Christina O'Donnell <cdo <at> mutix.org>,
 Simon Tournier <zimon.toutoune <at> gmail.com>
Subject: [PATCH 1/3] build-system/go: Add subdir parameter to
 go-version->git-ref.
Date: Sun, 15 Sep 2024 21:40:18 +0100
[Message part 4 (text/plain, inline)]
Hi,

After a few days of testing with importing, building and updating Golang
packages I can say it feels very stable with patches proposed by
Christiana - there was no single import failure on such a long chain of
imports like for go-github-com-spf13-afero (209 packages+),
go-github-com-ipfs-boxo (231 package+).

I've used it as a current implementation to fix mentioned issues with
guix import go.

Pushed as 45cbf468d2..23dbf8d073 to go-team.

The branch contains the fresh versions of golang-build packages which
might need to rebuild most of the Goalang containing in Guix. But it
would let us to bring Prometheus soon, most of the components a also on
the branch.

--
Oleg
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 310 days ago.

Previous Next


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