GNU bug report logs - #34752
[PATCH] WIP: Update Go to 1.12.

Previous Next

Package: guix-patches;

Reported by: Leo Famulari <leo <at> famulari.name>

Date: Mon, 4 Mar 2019 22:29:01 UTC

Severity: normal

Tags: patch

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 34752 in the body.
You can then email your comments to 34752 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#34752; Package guix-patches. (Mon, 04 Mar 2019 22:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo Famulari <leo <at> famulari.name>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 04 Mar 2019 22:29:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: guix-patches <at> gnu.org
Subject: [PATCH] WIP: Update Go to 1.12.
Date: Mon,  4 Mar 2019 17:28:00 -0500
This patch depends on the removal of Go 1.9 in bug #34280.

Any ideas about these new test failures? Something fails to find some
kernel headers for reasons that I don't understand.

* gnu/packages/golang.scm (go-1.11): Replace with ...
(go-1.12): ... new variable.
[arguments]: Remove the Go 1.11.5 'tarbomb-workaround' phase.
Move 'set-bootstrap-variables' into the 'build' phase.
Disable some more tests in the 'prebuild' phase. Set $HOME because Go
1.12 actually tries to use it.
(go): Update to go-1.12.
* guix/build/go-build-system.scm (setup-environment): Set $HOME.
---
 gnu/packages/golang.scm        | 39 ++++++++++++----------------------
 guix/build/go-build-system.scm |  1 +
 2 files changed, 14 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index da8ad3d7fe..ff21bcdba9 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -223,11 +223,11 @@ in the style of communicating sequential processes (@dfn{CSP}).")
     (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux"))
     (license license:bsd-3)))
 
-(define-public go-1.11
+(define-public go-1.12
   (package
     (inherit go-1.4)
     (name "go")
-    (version "1.11.5")
+    (version "1.12")
     (source
      (origin
        (method url-fetch)
@@ -235,23 +235,11 @@ in the style of communicating sequential processes (@dfn{CSP}).")
                            name version ".src.tar.gz"))
        (sha256
         (base32
-         "0gllmbjvp12iszwils8id78mvjxwviwf98lh2gdkb236n4mz07mw"))))
+         "1wl8kq21fbzmv4plnaza5acz8dhbaaq6smjzk3r6cf3l6qrkvi09"))))
     (arguments
      (substitute-keyword-arguments (package-arguments go-1.4)
        ((#:phases phases)
         `(modify-phases ,phases
-           ;; XXX Work around the Go 1.11.5 tarbomb.
-           ;; <https://github.com/golang/go/issues/29906>
-           (add-after 'unpack 'tarbomb-workaround
-             (lambda _
-               (chdir "..")
-               (delete-file-recursively "gocache")
-               (delete-file-recursively "tmp")
-               #t))
-           (replace 'chdir
-             (lambda _
-               (chdir "go/src")
-               #t))
            (replace 'prebuild
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
@@ -276,8 +264,10 @@ in the style of communicating sequential processes (@dfn{CSP}).")
                              ;; can not find crt1.o despite being present.
                              "cmd/go/testdata/script/list_compiled_imports.txt"
                              "cmd/go/testdata/script/mod_case_cgo.txt"
-                             ;; https://github.com/golang/go/issues/24884
-                             "os/user/user_test.go"))
+                             ;; XXX fails to find "asm/socket.h"
+                             "cmd/go/testdata/script/list_find.txt"
+                             ;; XXX fails to find "linux/errno.h"
+                             "cmd/go/testdata/script/cgo_syso_issue29253.txt"))
 
                  (substitute* "os/os_test.go"
                    (("/usr/bin") (getcwd))
@@ -352,19 +342,16 @@ in the style of communicating sequential processes (@dfn{CSP}).")
                  (substitute* (find-files "cmd" "\\.go")
                    (("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader))
                  #t)))
-           (add-before 'build 'set-bootstrap-variables
-             (lambda* (#:key outputs inputs #:allow-other-keys)
-               ;; Tell the build system where to find the bootstrap Go.
-               (let ((go  (assoc-ref inputs "go")))
-                 (setenv "GOROOT_BOOTSTRAP" go)
-                 (setenv "GOGC" "400")
-                 #t)))
            (replace 'build
              (lambda* (#:key inputs outputs #:allow-other-keys)
                ;; FIXME: Some of the .a files are not bit-reproducible.
-               (let* ((output (assoc-ref outputs "out")))
+               (let ((go (assoc-ref inputs "go"))
+                     (output (assoc-ref outputs "out")))
+                 (setenv "HOME" "/tmp")
+                 (setenv "GOGC" "400") ; XXX necessary?
                  (setenv "CC" (which "gcc"))
                  (setenv "GOOS" "linux")
+                 (setenv "GOROOT_BOOTSTRAP" go)
                  (setenv "GOROOT" (dirname (getcwd)))
                  (setenv "GOROOT_FINAL" output)
                  (setenv "CGO_ENABLED" "1")
@@ -415,7 +402,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
        ,@(package-native-inputs go-1.4)))
     (supported-systems %supported-systems)))
 
-(define-public go go-1.11)
+(define-public go go-1.12)
 
 (define-public go-github-com-alsm-ioprogress
   (let ((commit "063c3725f436e7fba0c8f588547bee21ffec7ac5")
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 022d4fe16b..c4f55b06ee 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -172,6 +172,7 @@ respectively."
     (if (getenv "GOPATH")
       (setenv "GOPATH" (string-append (getcwd) ":" (getenv "GOPATH")))
       (setenv "GOPATH" (getcwd)))
+    (setenv "HOME" "/tmp")
     ;; Where to install compiled executable files ('commands' in Go parlance').
     (setenv "GOBIN" (string-append out "/bin"))
     #t))
-- 
2.21.0





Information forwarded to guix-patches <at> gnu.org:
bug#34752; Package guix-patches. (Sat, 16 Mar 2019 22:58:01 GMT) Full text and rfc822 format available.

Message #8 received at 34752 <at> debbugs.gnu.org (full text, mbox):

From: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
To: 34752 <at> debbugs.gnu.org
Subject: Duplicated work (sorry!)
Date: Sat, 16 Mar 2019 17:57:29 -0500
Hey Leo, I've just submitted patch 34887. I didn't realize your patch
existed until I had already submitted. I apologize, I don't contribute
to projects managed in this style enough to have the workflow
internalized :(

At any rate, my patch does much the same thing except that it leaves
1.11 in place as default. I did that for a couple of reasons:

- In organizations, it's very common for projects/teams to lag behind a
  bit the newest releases, and for people installing Go through Guix,
  it's nice to still have previous versions available. The Go team
  officially supports LATEST-2 releases, and I think we should consider
  doing the same.

- https://golang.org/doc/go1.12#gocache states that the build cache is
  now required. I saw that you were experimenting with setting the home
  directory to `/tmp`. The approach I considered taking was to modify
  the Go build-system to override the `GOCACHE` environmental variable
  when doing builds. Otherwise, any Go package will have to spoof the
  home directory.

Regarding your question about the test failures. I tried to resolve
these in 1.11 and the new ones that cropped up in 1.12. The issue is
that these "scripts" are effectively running in a custom little
script-engine that was custom built. I made some attempts at correcting
this which you can read about in patch 32768. You can find out more
about this scripting engine here:

https://github.com/golang/go/blob/release-branch.go1.12/src/cmd/go/testdata/script/README

-- 
Katherine




Reply sent to Leo Famulari <leo <at> famulari.name>:
You have taken responsibility. (Mon, 18 Mar 2019 20:15:02 GMT) Full text and rfc822 format available.

Notification sent to Leo Famulari <leo <at> famulari.name>:
bug acknowledged by developer. (Mon, 18 Mar 2019 20:15:02 GMT) Full text and rfc822 format available.

Message #13 received at 34752-done <at> debbugs.gnu.org (full text, mbox):

From: Leo Famulari <leo <at> famulari.name>
To: Katherine Cox-Buday <cox.katherine.e <at> gmail.com>
Cc: 34752-done <at> debbugs.gnu.org
Subject: Re: [bug#34752] Duplicated work (sorry!)
Date: Mon, 18 Mar 2019 16:14:19 -0400
[Message part 1 (text/plain, inline)]
On Sat, Mar 16, 2019 at 05:57:29PM -0500, Katherine Cox-Buday wrote:
> Hey Leo, I've just submitted patch 34887. I didn't realize your patch
> existed until I had already submitted. I apologize, I don't contribute
> to projects managed in this style enough to have the workflow
> internalized :(

It's okay. Our work overlapped but we can consider it a very in-depth
code review :)

> At any rate, my patch does much the same thing except that it leaves
> 1.11 in place as default. I did that for a couple of reasons:
> 
> - In organizations, it's very common for projects/teams to lag behind a
>   bit the newest releases, and for people installing Go through Guix,
>   it's nice to still have previous versions available. The Go team
>   officially supports LATEST-2 releases, and I think we should consider
>   doing the same.

Okay, let's do this from now on. We can make Go 1.12 the default later.

> - https://golang.org/doc/go1.12#gocache states that the build cache is
>   now required. I saw that you were experimenting with setting the home
>   directory to `/tmp`. The approach I considered taking was to modify
>   the Go build-system to override the `GOCACHE` environmental variable
>   when doing builds. Otherwise, any Go package will have to spoof the
>   home directory.

Yeah... as discussed on IRC #guix yesterday, we have some work to do to
fully support recent Go.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 16 Apr 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 5 days ago.

Previous Next


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