Subject: [bug#67570] [PATCH] gnu: go-golang-org-x-sys: Update to 0.8.0. (was: [PATCH] gnu: kubo: Fix build.)

From: "Artyom V. Poptsov" <[email-masked]>
Date: Sat, 09 Dec 2023 11:22:11 +0300

Hello Ludovic!

> It does fix the build, but it’s a bit heavy-handed: every time we
> compute the kubo derivation, we go through that graph rewriting, which
> is quite expensive.

Agreed, I just wanted to make a "quick fix" that works.

> Can you think of another way this could be fixed?  What if we don’t
> replace go-golang-org-x-sys everywhere?  Or perhaps there’s a trick that
> would allow us to build with go-golang-org-x-sys 0.4?

> In parallel perhaps we should work on upgrading go-golang-org-x-sys
> altogether?

Alright, I tried to update "go-golang-org-x-sys" to 0.8.0, here's the
patch:
From 6022d28be487d06e9987785db1240355c080f459 Mon Sep 17 00:00:00 2001
Message-ID: <6022d2[email-masked]>
From: "Artyom V. Poptsov" <[email-masked]>
Date: Sat, 9 Dec 2023 11:09:26 +0300
Subject: [PATCH] gnu: go-golang-org-x-sys: Update to 0.8.0.

* gnu/packages/golang.scm (go-golang-org-x-sys): Update to 0.8.0.
  (go-golang-org-x-sys-0.8): Remove.
  (go-github-com-quic-go-quic-go, go-github-com-quic-go-qtls-go1-20):
  Use the new version of "go-golang-org-x-sys".
* gnu/packages/networking.scm (yggdrasil): Use the new version of
  "go-golang-org-x-sys".
  [propagated-inputs]: Don't rewrite inputs; add "go-golang-org-x-sys".

Change-Id: I969dd402427e345550038918f6de607413c44a61
---
 gnu/packages/golang.scm     | 52 ++++++++++------------------------
 gnu/packages/networking.scm | 56 +++++++++++++++++--------------------
 2 files changed, 41 insertions(+), 67 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index b5bf9d4b47..b34217d154 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4079,11 +4079,11 @@ (define-public go-golang-org-x-sync
       (license license:bsd-3))))
 
 (define-public go-golang-org-x-sys
-  (let ((commit "b60007cc4e6f966b1c542e343d026d06723e5653")
+  (let ((commit "ca59edaa5a761e1d0ea91d6c07b063f85ef24f78")
         (revision "0"))
     (package
       (name "go-golang-org-x-sys")
-      (version (git-version "0.4.0" revision commit))
+      (version (git-version "0.8.0" revision commit))
       (source (origin
                 (method git-fetch)
                 (uri (git-reference
@@ -4092,7 +4092,7 @@ (define-public go-golang-org-x-sys
                 (file-name (git-file-name name version))
                 (sha256
                  (base32
-                  "0fr2d6fnpbqx6n89sg9lsinqkdaw49y068kqj2g0cxlhbh69hzii"))))
+                  "1p81niiin8dwyrjl2xsc95136w3vdw4kmj0w3mlh0vh5v134s4xq"))))
       (build-system go-build-system)
       (arguments
        (list
@@ -4109,24 +4109,6 @@ (define-public go-golang-org-x-sys
       (home-page "https://go.googlesource.com/sys")
       (license license:bsd-3))))
 
-;; XXX: This version is required for "go-github-com-quic-go-qtls-go1-20".
-(define-public go-golang-org-x-sys-0.8
-  (let ((commit "ca59edaa5a761e1d0ea91d6c07b063f85ef24f78")
-        (revision "0"))
-    (package
-      (inherit go-golang-org-x-sys)
-      (name "go-golang-org-x-sys")
-      (version (git-version "0.8.0" revision commit))
-      (source (origin
-                (method git-fetch)
-                (uri (git-reference
-                      (url "https://go.googlesource.com/sys")
-                      (commit commit)))
-                (file-name (git-file-name name version))
-                (sha256
-                 (base32
-                  "1p81niiin8dwyrjl2xsc95136w3vdw4kmj0w3mlh0vh5v134s4xq")))))))
-
 (define-public go-golang-org-x-text
   (package
     (name "go-golang-org-x-text")
@@ -7748,7 +7730,7 @@ (define-public go-github-com-quic-go-qtls-go1-20
       #:import-path "github.com/quic-go/qtls-go1-20"
       #:go go-1.20))
     (propagated-inputs (list go-golang-org-x-crypto
-                             go-golang-org-x-sys-0.8))
+                             go-golang-org-x-sys))
     (synopsis "TLS 1.3 for QUIC")
     (description
      "Go standard library TLS 1.3 implementation, modified for QUIC.  For
@@ -7809,21 +7791,17 @@ (define-public go-github-com-quic-go-quic-go
            #:tests? #f
            #:go go-1.20))
     (propagated-inputs
-     (let ((p (package-input-rewriting
-               `((,go-golang-org-x-sys . ,go-golang-org-x-sys-0.8))
-               #:deep? #true)))
-       (cons go-golang-org-x-sys-0.8
-             (map p
-                  (list go-github-com-quic-go-qtls-go1-20
-                        go-github-com-quic-go-qpack
-                        go-golang-org-x-crypto
-                        go-github-com-cheekybits-genny
-                        go-github-com-marten-seemann-chacha20
-                        go-github-com-golang-protobuf-proto
-                        go-golang-org-x-crypto
-                        go-golang-org-x-exp
-                        go-golang-org-x-net
-                        go-golang-org-x-sync)))))
+     (list go-github-com-quic-go-qtls-go1-20
+           go-github-com-quic-go-qpack
+           go-golang-org-x-crypto
+           go-github-com-cheekybits-genny
+           go-github-com-marten-seemann-chacha20
+           go-github-com-golang-protobuf-proto
+           go-golang-org-x-crypto
+           go-golang-org-x-exp
+           go-golang-org-x-net
+           go-golang-org-x-sys
+           go-golang-org-x-sync))
     (synopsis "QUIC in Go")
     (description "This package provides a Go language implementation of the QUIC
 network protocol.")
diff --git a/gnu/packages/networking.scm b/gnu/packages/networking.scm
index 6b415076e8..5f4d60e4fd 100644
--- a/gnu/packages/networking.scm
+++ b/gnu/packages/networking.scm
@@ -4447,36 +4447,32 @@ (define-public yggdrasil
                             "github.com/yggdrasil-network/yggdrasil-go/cmd/yggdrasilctl"
                             "github.com/yggdrasil-network/yggdrasil-go/cmd/genkeys"))))))))
     (propagated-inputs
-     (let ((p (package-input-rewriting
-               `((,go-golang-org-x-sys . ,go-golang-org-x-sys-0.8))
-               #:deep? #true)))
-       (cons go-golang-org-x-sys-0.8
-             (map p
-                  (list go-golang-zx2c4-com-wireguard
-                        go-golang-org-x-text
-                        go-golang-org-x-net
-                        go-golang-org-x-crypto
-                        go-golang-org-x-tools
-                        go-netns
-                        go-netlink
-                        go-github-com-bits-and-blooms-bitset
-                        go-github-com-bits-and-blooms-bloom
-                        go-github-com-quic-go-quic-go
-                        go-github-com-hjson-hjson-go
-                        go-github-com-olekukonko-tablewriter
-                        go-github-com-mitchellh-mapstructure
-                        go-github-com-mattn-go-runewidth
-                        go-github-com-mattn-go-isatty
-                        go-github-com-mattn-go-colorable
-                        go-github-com-kardianos-minwinsvc
-                        go-github-com-hjson-hjson-go
-                        go-github-com-hashicorp-go-syslog
-                        go-github-com-gologme-log
-                        go-github-com-fatih-color
-                        go-github-com-cheggaaa-pb-v3
-                        go-github-com-vividcortex-ewma
-                        go-github-com-arceliar-phony
-                        go-github-com-arceliar-ironwood)))))
+     (list go-golang-zx2c4-com-wireguard
+           go-golang-org-x-text
+           go-golang-org-x-net
+           go-golang-org-x-crypto
+           go-golang-org-x-tools
+           go-golang-org-x-sys
+           go-netns
+           go-netlink
+           go-github-com-bits-and-blooms-bitset
+           go-github-com-bits-and-blooms-bloom
+           go-github-com-quic-go-quic-go
+           go-github-com-hjson-hjson-go
+           go-github-com-olekukonko-tablewriter
+           go-github-com-mitchellh-mapstructure
+           go-github-com-mattn-go-runewidth
+           go-github-com-mattn-go-isatty
+           go-github-com-mattn-go-colorable
+           go-github-com-kardianos-minwinsvc
+           go-github-com-hjson-hjson-go
+           go-github-com-hashicorp-go-syslog
+           go-github-com-gologme-log
+           go-github-com-fatih-color
+           go-github-com-cheggaaa-pb-v3
+           go-github-com-vividcortex-ewma
+           go-github-com-arceliar-phony
+           go-github-com-arceliar-ironwood))
     (home-page "https://yggdrasil-network.github.io/blog.html")
     (synopsis
      "Experiment in scalable routing as an encrypted IPv6 overlay network")

base-commit: 06f25a9a85be1bbe7a709e58ce41c1a834e5f1ae
-- 
2.41.0

It seems that the dependent packages are fine with that.  I haven't
checked everything but I did some cherry-picking across the dependent
packages and build some of them and found no build errors.  Please find
my check-list attached.

Thanks,

- avp

-- 
Artyom "avp" Poptsov <[email-masked]>
Home page: https://memory-heap.org/~avp/
CADR Hackerspace co-founder: https://cadrspace.ru/
GPG: D0C2 EAC1 3310 822D 98DE  B57C E9C5 A2D9 0898 A02F