GNU bug report logs - #68300
[PATCH] gnu: Remove go-1.14.

Previous Next

Package: guix-patches;

Reported by: Efraim Flashner <efraim <at> flashner.co.il>

Date: Sun, 7 Jan 2024 10:41:01 UTC

Severity: normal

Tags: patch

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

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 68300 in the body.
You can then email your comments to 68300 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 cox.katherine.e+guix <at> gmail.com, guix-patches <at> gnu.org:
bug#68300; Package guix-patches. (Sun, 07 Jan 2024 10:41:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Efraim Flashner <efraim <at> flashner.co.il>:
New bug report received and forwarded. Copy sent to cox.katherine.e+guix <at> gmail.com, guix-patches <at> gnu.org. (Sun, 07 Jan 2024 10:41:01 GMT) Full text and rfc822 format available.

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

From: Efraim Flashner <efraim <at> flashner.co.il>
To: guix-patches <at> gnu.org
Cc: Efraim Flashner <efraim <at> flashner.co.il>
Subject: [PATCH] gnu: Remove go-1.14.
Date: Sun,  7 Jan 2024 12:39:34 +0200
* gnu/packages/golang.scm (go-1.14, go-std-1.14): Remove variables.
(go-1.16): Inherit from go-1.4.

Change-Id: Ie92019e3aa733a8c6f12dfefbc7b140eb1b76c5c
---
 gnu/packages/golang.scm | 250 +++++++---------------------------------
 1 file changed, 41 insertions(+), 209 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 36e2c4b23e..f84389427c 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -259,11 +259,11 @@ (define-public go-1.4
     (supported-systems '("x86_64-linux" "i686-linux" "armhf-linux" "aarch64-linux"))
     (license license:bsd-3)))
 
-(define-public go-1.14
+(define-public go-1.16
   (package
     (inherit go-1.4)
     (name "go")
-    (version "1.14.15")
+    (version "1.16.15")
     (source
      (origin
        (method git-fetch)
@@ -273,63 +273,39 @@ (define-public go-1.14
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "1crh90qkvhlx23hwsi4wxy3l3h8973lr18135y6h1nnzzwr3n3ps"))))
+         "0vlk0r4600ah9fg5apdd93g7i369k0rkzcgn7cs8h6qq2k6hpxjl"))))
     (arguments
-     (substitute-keyword-arguments (package-arguments go-1.4)
-       ((#:system system)
-        (if (string-prefix? "aarch64-linux" (or (%current-system)
-                                                (%current-target-system)))
-          "aarch64-linux"
-          system))
+     (substitute-keyword-arguments
+       (strip-keyword-arguments '(#:tests? #:system) (package-arguments go-1.4))
        ((#:phases phases)
         `(modify-phases ,phases
+           (add-after 'unpack 'remove-unused-sourcecode-generators
+             (lambda _
+               ;; Prevent perl from inclusion in closure through unused files
+               (for-each delete-file (find-files "src" "\\.pl$"))))
            (replace 'prebuild
              (lambda* (#:key inputs outputs #:allow-other-keys)
                (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
-                      (ld (string-append (assoc-ref inputs "libc") "/lib"))
-                      (loader (car (append (find-files ld "^ld-linux.+")
-                                           (find-files ld "^ld(64)?\\.so.+"))))
                       (net-base (assoc-ref inputs "net-base"))
                       (tzdata-path
-                       (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
-                      (output (assoc-ref outputs "out")))
+                       (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
 
                  ;; Having the patch in the 'patches' field of <origin> breaks
                  ;; the 'TestServeContent' test due to the fact that
                  ;; timestamps are reset.  Thus, apply it from here.
                  (invoke "patch" "-p2" "--force" "-i"
                          (assoc-ref inputs "go-skip-gc-test.patch"))
-
-                 ;; A side effect of these test scripts is testing
-                 ;; cgo. Attempts at using cgo flags and directives with these
-                 ;; scripts as specified here (https://golang.org/cmd/cgo/)
-                 ;; have not worked. The tests continue to state that they can
-                 ;; not find object files/headers despite being present.
-                 (for-each
-                  delete-file
-                  '("cmd/go/testdata/script/mod_case_cgo.txt"
-                    "cmd/go/testdata/script/list_find.txt"
-                    "cmd/go/testdata/script/list_compiled_imports.txt"
-                    "cmd/go/testdata/script/cgo_syso_issue29253.txt"
-                    "cmd/go/testdata/script/cover_cgo.txt"
-                    "cmd/go/testdata/script/cover_cgo_xtest.txt"
-                    "cmd/go/testdata/script/cover_cgo_extra_test.txt"
-                    "cmd/go/testdata/script/cover_cgo_extra_file.txt"
-                    "cmd/go/testdata/script/cgo_path_space.txt"
-                    "cmd/go/testdata/script/ldflag.txt"
-                    "cmd/go/testdata/script/cgo_path.txt"))
+                 (invoke "patch" "-p2" "--force" "-i"
+                         (assoc-ref inputs "go-fix-script-tests.patch"))
 
                  (for-each make-file-writable (find-files "."))
 
                  (substitute* "os/os_test.go"
                    (("/usr/bin") (getcwd))
-                   (("/bin/pwd") (which "pwd"))
                    (("/bin/sh") (which "sh")))
 
-                 ;; Backport fix for go-1.14 with GCC 9+
-                 ;; https://github.com/golang/go/issues/39157
-                 (substitute* "cmd/go/note_test.go"
-                   (("cannot find 'ld'") "cannot find [‘']ld[’']"))
+                 (substitute* "cmd/go/testdata/script/cgo_path_space.txt"
+                   (("/bin/sh") (which "sh")))
 
                  ;; Add libgcc to runpath
                  (substitute* "cmd/link/internal/ld/lib.go"
@@ -337,7 +313,7 @@ (define-public go-1.14
                  (substitute* "cmd/go/internal/work/gccgo.go"
                    (("cgoldflags := \\[\\]string\\{\\}")
                     (string-append "cgoldflags := []string{"
-                                   "\"-rpath=" gcclib "\""
+                                   "\"-Wl,-rpath=" gcclib "\""
                                    "}"))
                    (("\"-lgcc_s\", ")
                     (string-append
@@ -406,28 +382,42 @@ (define-public go-1.14
                  (substitute* "net/port_unix.go"
                    (("/etc/services") (string-append net-base "/etc/services")))
                  (substitute* "time/zoneinfo_unix.go"
-                   (("/usr/share/zoneinfo/") tzdata-path))
-                 (substitute* (find-files "cmd" "\\.go")
-                   (("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader))
-                 #t)))
+                   (("/usr/share/zoneinfo/") tzdata-path)))))
            (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)))
+                 (setenv "GOGC" "400"))))
            (replace 'build
-             (lambda* (#:key inputs outputs #:allow-other-keys)
+             (lambda* (#:key inputs outputs (parallel-build? #t)
+                       #:allow-other-keys)
                ;; FIXME: Some of the .a files are not bit-reproducible.
-               (let* ((output (assoc-ref outputs "out")))
+               ;; (Is this still true?)
+               (let* ((njobs (if parallel-build? (parallel-job-count) 1))
+                      (output (assoc-ref outputs "out"))
+                      (loader (string-append (assoc-ref inputs "libc")
+                                             ,(glibc-dynamic-linker))))
                  (setenv "CC" (which "gcc"))
+                 (setenv "GO_LDSO" loader)
                  (setenv "GOOS" "linux")
                  (setenv "GOROOT" (dirname (getcwd)))
                  (setenv "GOROOT_FINAL" output)
                  (setenv "GOCACHE" "/tmp/go-cache")
-                 (setenv "CGO_ENABLED" "1")
-                 (invoke "sh" "all.bash"))))
+                 (setenv "GOMAXPROCS" (number->string njobs))
+                 (invoke "sh" "make.bash" "--no-banner"))))
+           (replace 'check
+             (lambda* (#:key target (tests? (not target)) (parallel-tests? #t)
+                       #:allow-other-keys)
+               (let* ((njobs (if parallel-tests? (parallel-job-count) 1)))
+                 (when tests?
+                   (setenv "GOMAXPROCS" (number->string njobs))
+                   (invoke "sh" "run.bash" "--no-rebuild")))))
+           (add-before 'install 'unpatch-perl-shebangs
+             (lambda _
+               ;; Rewrite references to perl input in test scripts
+               (substitute* "net/http/cgi/testdata/test.cgi"
+                 (("^#!.*") "#!/usr/bin/env perl\n"))))
            (replace 'install
              ;; TODO: Most of this could be factorized with Go 1.4.
              (lambda* (#:key outputs #:allow-other-keys)
@@ -461,8 +451,7 @@ (define-public go-1.14
                   '("README.md" "CONTRIBUTORS" "AUTHORS" "PATENTS"
                     "LICENSE" "VERSION" "CONTRIBUTING.md" "robots.txt"))
 
-                 (copy-recursively "../" output)
-                 #t)))))))
+                 (copy-recursively "../" output))))))))
     (native-inputs
      `(,@(if (member (%current-system) (package-supported-systems go-1.4))
            `(("go" ,go-1.4))
@@ -472,167 +461,11 @@ (define-public go-1.14
            ((or "armhf-linux" "aarch64-linux")
             `(("gold" ,binutils-gold)))
            (_ `()))
+       ("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch"))
        ,@(package-native-inputs go-1.4)))
     (supported-systems (fold delete %supported-systems
                              (list "powerpc-linux" "i586-gnu")))))
 
-(define-public go-1.16
-  (package
-    (inherit go-1.14)
-    (name "go")
-    (version "1.16.15")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/golang/go")
-             (commit (string-append "go" version))))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32
-         "0vlk0r4600ah9fg5apdd93g7i369k0rkzcgn7cs8h6qq2k6hpxjl"))))
-    (arguments
-     (substitute-keyword-arguments
-         (strip-keyword-arguments '(#:tests?) (package-arguments go-1.14))
-       ((#:phases phases)
-        `(modify-phases ,phases
-           (add-after 'unpack 'remove-unused-sourcecode-generators
-             (lambda _
-               ;; Prevent perl from inclusion in closure through unused files
-               (for-each delete-file (find-files "src" "\\.pl$"))))
-           (replace 'prebuild
-             (lambda* (#:key inputs outputs #:allow-other-keys)
-               (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
-                      (net-base (assoc-ref inputs "net-base"))
-                      (tzdata-path
-                       (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo")))
-
-                 ;; Having the patch in the 'patches' field of <origin> breaks
-                 ;; the 'TestServeContent' test due to the fact that
-                 ;; timestamps are reset.  Thus, apply it from here.
-                 (invoke "patch" "-p2" "--force" "-i"
-                         (assoc-ref inputs "go-skip-gc-test.patch"))
-                 (invoke "patch" "-p2" "--force" "-i"
-                         (assoc-ref inputs "go-fix-script-tests.patch"))
-
-                 (for-each make-file-writable (find-files "."))
-
-                 (substitute* "os/os_test.go"
-                   (("/usr/bin") (getcwd))
-                   (("/bin/sh") (which "sh")))
-
-                 (substitute* "cmd/go/testdata/script/cgo_path_space.txt"
-                   (("/bin/sh") (which "sh")))
-
-                 ;; Add libgcc to runpath
-                 (substitute* "cmd/link/internal/ld/lib.go"
-                   (("!rpath.set") "true"))
-                 (substitute* "cmd/go/internal/work/gccgo.go"
-                   (("cgoldflags := \\[\\]string\\{\\}")
-                    (string-append "cgoldflags := []string{"
-                                   "\"-Wl,-rpath=" gcclib "\""
-                                   "}"))
-                   (("\"-lgcc_s\", ")
-                    (string-append
-                     "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", ")))
-                 (substitute* "cmd/go/internal/work/gc.go"
-                   (("ldflags = setextld\\(ldflags, compiler\\)")
-                    (string-append
-                     "ldflags = setextld(ldflags, compiler)\n"
-                     "ldflags = append(ldflags, \"-r\")\n"
-                     "ldflags = append(ldflags, \"" gcclib "\")\n")))
-
-                 ;; Disable failing tests: these tests attempt to access
-                 ;; commands or network resources which are neither available
-                 ;; nor necessary for the build to succeed.
-                 (for-each
-                  (match-lambda
-                    ((file regex)
-                     (substitute* file
-                       ((regex all before test_name)
-                        (string-append before "Disabled" test_name)))))
-                  '(("net/net_test.go" "(.+)(TestShutdownUnix.+)")
-                    ("net/dial_test.go" "(.+)(TestDialTimeout.+)")
-                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPort.+)")
-                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPortWithCancel.+)")
-                    ;; 127.0.0.1 doesn't exist
-                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTR.+)")
-                    ;; 127.0.0.1 doesn't exist
-                    ("net/cgo_unix_test.go" "(.+)(TestCgoLookupPTRWithCancel.+)")
-                    ;; /etc/services doesn't exist
-                    ("net/parse_test.go" "(.+)(TestReadLine.+)")
-                    ("os/os_test.go" "(.+)(TestHostname.+)")
-                    ;; The user's directory doesn't exist
-                    ("os/os_test.go" "(.+)(TestUserHomeDir.+)")
-                    ("time/format_test.go" "(.+)(TestParseInSydney.+)")
-                    ("time/format_test.go" "(.+)(TestParseInLocation.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestEcho.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestCommandRelativeName.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestCatStdin.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestCatGoodAndBadFile.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestExitStatus.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestPipes.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestStdinClose.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestIgnorePipeErrorOnSuccess.+)")
-                    ("syscall/syscall_unix_test.go" "(.+)(TestPassFD\\(.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestExtraFiles/areturn.+)")
-                    ("cmd/go/go_test.go" "(.+)(TestCoverageWithCgo.+)")
-                    ("cmd/go/go_test.go" "(.+)(TestTwoPkgConfigs.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestOutputStderrCapture.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestExtraFiles.+)")
-                    ("os/exec/exec_test.go" "(.+)(TestExtraFilesRace.+)")
-                    ("net/lookup_test.go" "(.+)(TestLookupPort.+)")
-                    ("syscall/exec_linux_test.go"
-                     "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)")))
-
-                 ;; These tests fail on aarch64-linux
-                 (substitute* "cmd/dist/test.go"
-                   (("t.registerHostTest\\(\"testsanitizers/msan.*") ""))
-
-                 ;; fix shebang for testar script
-                 ;; note the target script is generated at build time.
-                 (substitute* "../misc/cgo/testcarchive/carchive_test.go"
-                   (("#!/usr/bin/env") (string-append "#!" (which "env"))))
-
-                 (substitute* "net/lookup_unix.go"
-                   (("/etc/protocols") (string-append net-base "/etc/protocols")))
-                 (substitute* "net/port_unix.go"
-                   (("/etc/services") (string-append net-base "/etc/services")))
-                 (substitute* "time/zoneinfo_unix.go"
-                   (("/usr/share/zoneinfo/") tzdata-path)))))
-           (replace 'build
-             (lambda* (#:key inputs outputs (parallel-build? #t)
-                       #:allow-other-keys)
-               ;; FIXME: Some of the .a files are not bit-reproducible.
-               ;; (Is this still true?)
-               (let* ((njobs (if parallel-build? (parallel-job-count) 1))
-                      (output (assoc-ref outputs "out"))
-                      (loader (string-append (assoc-ref inputs "libc")
-                                             ,(glibc-dynamic-linker))))
-                 (setenv "CC" (which "gcc"))
-                 (setenv "GO_LDSO" loader)
-                 (setenv "GOOS" "linux")
-                 (setenv "GOROOT" (dirname (getcwd)))
-                 (setenv "GOROOT_FINAL" output)
-                 (setenv "GOCACHE" "/tmp/go-cache")
-                 (setenv "GOMAXPROCS" (number->string njobs))
-                 (invoke "sh" "make.bash" "--no-banner"))))
-           (replace 'check
-             (lambda* (#:key target (tests? (not target)) (parallel-tests? #t)
-                       #:allow-other-keys)
-               (let* ((njobs (if parallel-tests? (parallel-job-count) 1)))
-                 (when tests?
-                   (setenv "GOMAXPROCS" (number->string njobs))
-                   (invoke "sh" "run.bash" "--no-rebuild")))))
-           (add-before 'install 'unpatch-perl-shebangs
-             (lambda _
-               ;; Rewrite references to perl input in test scripts
-               (substitute* "net/http/cgi/testdata/test.cgi"
-                 (("^#!.*") "#!/usr/bin/env perl\n"))))))))
-    (native-inputs
-     `(("go-fix-script-tests.patch" ,(search-patch "go-fix-script-tests.patch"))
-       ,@(package-native-inputs go-1.14)))))
-
 ;; https://github.com/golang/go/wiki/MinimumRequirements#microarchitecture-support
 (define %go-1.17-arm-micro-architectures
   (list "armv5" "armv6" "armv7"))
@@ -1142,7 +975,6 @@ (define make-go-std
 (export make-go-std)
 
 ;; Make those public so they have a corresponding Cuirass job.
-(define-public go-std-1.14 (make-go-std go-1.14))
 (define-public go-std-1.16 (make-go-std go-1.16))
 (define-public go-std-1.17 (make-go-std go-1.17))
 (define-public go-std-1.18 (make-go-std go-1.18))

base-commit: 25bcf4eda05b501758b11a53823867dc500ac7d1
-- 
Efraim Flashner   <efraim <at> flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted





Information forwarded to guix-patches <at> gnu.org:
bug#68300; Package guix-patches. (Wed, 10 Jan 2024 14:35:01 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Efraim Flashner <efraim <at> flashner.co.il>
Cc: 68300 <at> debbugs.gnu.org, Katherine Cox-Buday <cox.katherine.e+guix <at> gmail.com>
Subject: Re: [bug#68300] [PATCH] gnu: Remove go-1.14.
Date: Wed, 10 Jan 2024 09:34:43 -0500
Hello,

Efraim Flashner <efraim <at> flashner.co.il> writes:

> * gnu/packages/golang.scm (go-1.14, go-std-1.14): Remove variables.
> (go-1.16): Inherit from go-1.4.
>
> Change-Id: Ie92019e3aa733a8c6f12dfefbc7b140eb1b76c5c

Casually reviewed, but LGTM!  I don't think it's a big deal to rebuild
all go packages; these are quick to build.

Reviewed-by: Maxim Cournoyer <maxim.cournoyer <at> gmail>

-- 
Thanks,
Maxim




Information forwarded to guix-patches <at> gnu.org:
bug#68300; Package guix-patches. (Wed, 31 Jan 2024 19:29:02 GMT) Full text and rfc822 format available.

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

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 68300 <at> debbugs.gnu.org
Subject: [PATCH] gnu: Remove go-1.14.
Date: Wed, 31 Jan 2024 19:27:33 +0000
[Message part 1 (text/plain, inline)]
Hi Efraim,

It looks all reasonable changes for me.
May you initiate a go-team branch please?

I would need it to test other patches in issues with low level
 improvements on go-build-system, see <
https://mail.gnu.org/archive/html/guix-devel/2024-01/msg00235.html>.

Thanks,
Oleaginous.
[Message part 2 (text/html, inline)]

Reply sent to Sharlatan Hellseher <sharlatanus <at> gmail.com>:
You have taken responsibility. (Wed, 21 Feb 2024 21:12:02 GMT) Full text and rfc822 format available.

Notification sent to Efraim Flashner <efraim <at> flashner.co.il>:
bug acknowledged by developer. (Wed, 21 Feb 2024 21:12:02 GMT) Full text and rfc822 format available.

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

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 68300-done <at> debbugs.gnu.org
Subject: [PATCH] gnu: Remove go-1.14.
Date: Wed, 21 Feb 2024 21:10:25 +0000
[Message part 1 (text/plain, inline)]
Hi Efraim,

I've pushed it as 07962429da5fe11e9c366cbaf314e0db53a8fff5 to go-team.

--
Oleg
[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. (Thu, 21 Mar 2024 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 127 days ago.

Previous Next


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