unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] add go@1.5
@ 2016-07-10 23:52 Matthew Jordan
  2016-07-11  2:47 ` Leo Famulari
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Matthew Jordan @ 2016-07-10 23:52 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 196 bytes --]

Good Day,

Attached a patch to add go@1.5. I updated this one in a similar manner
to what was asked for go@1.4.  However, let me know if any other changes
are required, or if I missed something.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch to add go@1.5 --]
[-- Type: text/x-patch, Size: 7735 bytes --]

From 523d4ea6a97072831b91b7b7e7e3eb69a0b0ebca Mon Sep 17 00:00:00 2001
From: Matthew Jordan <matthewjordandevops@yandex.com>
Date: Thu, 26 May 2016 08:59:06 -0400
Subject: [PATCH 1/2] gnu: Add go@1.5.

* gnu/packages/golang.scm (go-1.5): New variable.

Co-author: Efraim Flashner <efraim@flashner.co.il>
Co-author: Andy Wingo <wingo@igalia.com>
---
 gnu/packages/golang.scm | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 144 insertions(+)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index cc1b66f..7590ced 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -183,3 +183,147 @@ compiled, statically typed language in the tradition of C and C++, with
 garbage collection, various safety features and in the style of communicating
 sequential processes (CSP) concurrent programming features added.")
     (license license:bsd-3)))
+
+(define-public go-1.5
+  (package
+    (inherit go-1.4)
+    (name "go")
+    (version "1.5.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://storage.googleapis.com/golang/"
+                           name version ".src.tar.gz"))
+       (sha256
+        (base32
+         "14xwn2pr3g4i1h8qpyrjjdmq1pgvzkagk4aqsp841hfxwyyclah0"))))
+    (arguments
+     `(#:modules ((ice-9 match)
+                  (guix build gnu-build-system)
+                  (guix build utils))
+       #:tests? #f ; Tests are run by all.bash script
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'patch-generated-file-shebangs 'chdir
+           (lambda _ (chdir "src")))
+         (add-before 'build 'prebuild
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
+                    (ld (string-append
+                         (assoc-ref inputs "glibc") "/lib"))
+                    (loader (car (find-files ld "^ld-linux.+")))
+                    (net-base (assoc-ref inputs "net-base"))
+                    (tzdata-path
+                     (string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
+                    (output (assoc-ref outputs "out")))
+
+               ;; Removing net/ tests, which fail when attempting to access
+               ;; network resources not present in the build container.
+               (for-each
+                (lambda (srcfile)
+                  (let ((srcfile (string-append "net/" srcfile)))
+                    (delete-file srcfile)))
+                '("parse_test.go" "port_test.go"))
+
+               ;; Add libgcc to runpath
+               (substitute* "cmd/link/internal/ld/lib.go"
+                 (("!rpath.set") "true"))
+               (substitute* "cmd/go/build.go"
+                 (("cgoldflags := \\[\\]string\\{\\}")
+                  (string-append "cgoldflags := []string{"
+                                 "\"-rpath=" gcclib "\""
+                                 "}"))
+                 (("ldflags = setextld\\(ldflags, compiler\\)")
+                  (string-append
+                   "ldflags = setextld(ldflags, compiler)\n"
+                   "ldflags = append(ldflags, \"-r\")\n"
+                   "ldflags = append(ldflags, \"" gcclib "\")\n"))
+                 (("\"-lgcc_s\", ")
+                  (string-append
+                   "\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", ")))
+
+               (substitute* "os/os_test.go"
+                 (("/usr/bin") (getcwd))
+                 (("/bin/pwd") (which "pwd")))
+
+               ;; Disable failing tests: these tests attempt to access
+               ;; commands or network resources which are neither available or
+               ;; necessary for the build to succeed.
+               (map
+                (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.+)")
+                  ("os/os_test.go" "(.+)(TestHostname.+)")
+                  ("time/format_test.go" "(.+)(TestParseInSydney.+)")
+                  ("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.+)")
+                  ("net/listen_test.go" "(.+)(TestIPv4MulticastListener\\(.+)")
+                  ("syscall/exec_linux_test.go"
+                   "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroups.+)")))
+
+               (substitute* "net/lookup_unix.go"
+                 (("/etc/protocols") (string-append net-base "/etc/protocols")))
+               (substitute* "time/zoneinfo_unix.go"
+                 (("/usr/share/zoneinfo/") tzdata-path))
+               (substitute*
+                   (find-files "cmd" "asm.c")
+                 (("/lib/ld-linux.*\\.so\\.[0-9]") loader)))))
+         (replace 'build
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((go  (assoc-ref inputs "go"))
+                    (output (assoc-ref outputs "out")))
+               (setenv "CC" (which "gcc"))
+               (setenv "GOOS" "linux")
+               (setenv "GOROOT" (dirname (getcwd)))
+               (setenv "GOROOT_BOOTSTRAP" go)
+               (setenv "GOROOT_FINAL" output)
+               (setenv "GOGC" "400")
+               (setenv "CGO_ENABLED" "1")
+               (zero? (system* "sh" "all.bash")))))
+         (replace 'install
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((output (assoc-ref outputs "out"))
+                    (doc_out (assoc-ref outputs "doc"))
+                    (docs (string-append doc_out "/share/doc/" ,name "-" ,version))
+                    (src (string-append
+                          (assoc-ref outputs "tests") "/share/" ,name "-" ,version)))
+               (mkdir-p src)
+               (copy-recursively "../test" (string-append src "/test"))
+               (delete-file-recursively "../test")
+               (mkdir-p docs)
+               (copy-recursively "../api" (string-append docs "/api"))
+               (delete-file-recursively "../api")
+               (copy-recursively "../doc" (string-append docs "/doc"))
+               (delete-file-recursively "../doc")
+
+               (for-each
+                (lambda (file)
+                  (let* ((filein (string-append "../" file))
+                         (fileout (string-append docs "/" file)))
+                  (copy-file filein fileout)
+                  (delete-file filein)))
+                '("README.md" "CONTRIBUTORS" "AUTHORS" "PATENTS"
+                  "LICENSE" "VERSION" "CONTRIBUTING.md" "robots.txt"))
+
+               (copy-recursively "../" output)))))))
+    (inputs
+     `(,@(package-inputs go-1.4)))
+    (native-inputs
+     `(("go" ,go-1.4)
+       ("glibc" ,glibc)
+       ,@(package-native-inputs go-1.4)))
+    (propagated-inputs
+     `(,@(package-propagated-inputs go-1.4)))))
-- 
2.9.0


[-- Attachment #3: Type: text/plain, Size: 35 bytes --]


Respectfully,

---
Matthew Jordan

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-10 23:52 [PATCH] add go@1.5 Matthew Jordan
@ 2016-07-11  2:47 ` Leo Famulari
  2016-07-11 23:44   ` Matthew Jordan
  2016-07-12  3:17 ` Leo Famulari
  2016-07-12  4:11 ` Alex Griffin
  2 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2016-07-11  2:47 UTC (permalink / raw)
  To: Matthew Jordan; +Cc: guix-devel

On Sun, Jul 10, 2016 at 07:52:08PM -0400, Matthew Jordan wrote:
> Good Day,
> 
> Attached a patch to add go@1.5. I updated this one in a similar manner
> to what was asked for go@1.4.  However, let me know if any other changes
> are required, or if I missed something.
> 

> From 523d4ea6a97072831b91b7b7e7e3eb69a0b0ebca Mon Sep 17 00:00:00 2001
> From: Matthew Jordan <matthewjordandevops@yandex.com>
> Date: Thu, 26 May 2016 08:59:06 -0400
> Subject: [PATCH 1/2] gnu: Add go@1.5.
> 
> * gnu/packages/golang.scm (go-1.5): New variable.

I just used this build Syncthing — awesome!

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-11  2:47 ` Leo Famulari
@ 2016-07-11 23:44   ` Matthew Jordan
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Jordan @ 2016-07-11 23:44 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel


> I just used this build Syncthing — awesome!

Thanks much appreciated,  I actually started work on docker and peco
packages myself.

Keeping my eyes open for how go@1.5 changes will go.

---
Matthew Jordan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-10 23:52 [PATCH] add go@1.5 Matthew Jordan
  2016-07-11  2:47 ` Leo Famulari
@ 2016-07-12  3:17 ` Leo Famulari
  2016-07-13 21:29   ` Ludovic Courtès
  2016-07-12  4:11 ` Alex Griffin
  2 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2016-07-12  3:17 UTC (permalink / raw)
  To: Matthew Jordan; +Cc: guix-devel

On Sun, Jul 10, 2016 at 07:52:08PM -0400, Matthew Jordan wrote:
> * gnu/packages/golang.scm (go-1.5): New variable.

I don't have the knowledge to comment on the Go specific stuff in this
package, but I have some more general comments.

The tests 'runtime' and 'cmd/go' failed due to the default 3 minute
time-limit when building on my slow machine, this thing:
<http://pcengines.ch/apu2b4.htm>

They passed in 193 and 216 seconds, respectively, when I set the
environment variable GO_TEST_TIMEOUT_SCALE to 9999, as suggested in this
bug report: <https://github.com/golang/go/issues/12404>

I've used the system-on-a-chip (SOC) mentioned in that bug report
(Allwinner A20), and my slow computer is faster than it. Since we
support ARMv7 and the A20 is a very popular ARMv7 SOC, I think we should
set this variable in the package definition.

> +(define-public go-1.5
> +  (package
> +    (inherit go-1.4)

We should try to inherit as much as possible from go-1.4, and when we
can't, we should at least try to use the same style (indentation, etc),
so that it's clear to readers what is different.

Can anyone say if it's possible to inherit specific build phases that
are common between the two packages?

> +    (name "go")

I believe the name should be inherited, so this can be removed.

> +         (add-before 'build 'prebuild

If it is possible to inherit some phases and as mentioned above, maybe
this phase could be split into parts that are common between go-1.4 and
go-1.5 and parts that are different.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-10 23:52 [PATCH] add go@1.5 Matthew Jordan
  2016-07-11  2:47 ` Leo Famulari
  2016-07-12  3:17 ` Leo Famulari
@ 2016-07-12  4:11 ` Alex Griffin
  2016-07-12  9:47   ` Matthew Jordan
  2 siblings, 1 reply; 9+ messages in thread
From: Alex Griffin @ 2016-07-12  4:11 UTC (permalink / raw)
  To: Matthew Jordan, guix-devel

Can I ask why even package go 1.5? Upstream has committed to making sure
all future compiler versions can bootstrap from go 1.4.x, so my thinking
is that we only need to package two versions, go 1.4 and the latest
version (1.6.2 at the moment). Or am I missing something?
-- 
Alex Griffin


On Sun, Jul 10, 2016, at 06:52 PM, Matthew Jordan wrote:
> Good Day,
> 
> Attached a patch to add go@1.5. I updated this one in a similar manner
> to what was asked for go@1.4.  However, let me know if any other changes
> are required, or if I missed something.
> 
> 
> Respectfully,
> 
> ---
> Matthew Jordan
> Email had 1 attachment:
> + 0001-gnu-Add-go-1.5.patch
>   8k (text/x-patch)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-12  4:11 ` Alex Griffin
@ 2016-07-12  9:47   ` Matthew Jordan
  2016-07-12 15:22     ` Alex Griffin
  0 siblings, 1 reply; 9+ messages in thread
From: Matthew Jordan @ 2016-07-12  9:47 UTC (permalink / raw)
  To: Alex Griffin; +Cc: guix-devel

Good Day Alex,

> Can I ask why even package go 1.5? Upstream has committed to making sure
> all future compiler versions can bootstrap from go 1.4.x, so my thinking
> is that we only need to package two versions, go 1.4 and the latest
> version (1.6.2 at the moment). Or am I missing something?

Some packages still recommend building with go@1.5 or have go@1.5 as
the minimum requirement. So thought it would be a good idea to add
go@1.5 as well.

However I have no objections towards going straight to go@1.6.

Respectfully,

---
Matthew Jordan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-12  9:47   ` Matthew Jordan
@ 2016-07-12 15:22     ` Alex Griffin
  2016-07-12 22:47       ` Matthew Jordan
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Griffin @ 2016-07-12 15:22 UTC (permalink / raw)
  To: Matthew Jordan; +Cc: guix-devel

Matthew,

I don't think we should consider minimum requirements, because Go's
backward compatibility is really good. I have yet to come across a
package that builds with an older compiler (post-1.0) but not a newer
one. Instead I think we should consider which releases we actually need
and which are supported upstream. The Go Release Policy[1] says that
security fixes are only issued for the current and previous releases.

I had thought that the 1.5 series was EOL already but when I looked it
up I guess it's still supported until next month. So I guess I don't
really have any objections to packaging go 1.5, except that it should be
removed next month when go 1.7 is released.

Thanks,
-- 
Alex Griffin

[1]: https://golang.org/doc/devel/release.html


On Tue, Jul 12, 2016, at 04:47 AM, Matthew Jordan wrote:
> Good Day Alex,
> 
> > Can I ask why even package go 1.5? Upstream has committed to making sure
> > all future compiler versions can bootstrap from go 1.4.x, so my thinking
> > is that we only need to package two versions, go 1.4 and the latest
> > version (1.6.2 at the moment). Or am I missing something?
> 
> Some packages still recommend building with go@1.5 or have go@1.5 as
> the minimum requirement. So thought it would be a good idea to add
> go@1.5 as well.
> 
> However I have no objections towards going straight to go@1.6.
> 
> Respectfully,
> 
> ---
> Matthew Jordan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-12 15:22     ` Alex Griffin
@ 2016-07-12 22:47       ` Matthew Jordan
  0 siblings, 0 replies; 9+ messages in thread
From: Matthew Jordan @ 2016-07-12 22:47 UTC (permalink / raw)
  To: Alex Griffin; +Cc: guix-devel

Hey Alex,

In that case, I'll send the go@1.6 patch instead.  No point fussing over
go@1.5 then.

Regards,

---
Matthew Jordan

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] add go@1.5
  2016-07-12  3:17 ` Leo Famulari
@ 2016-07-13 21:29   ` Ludovic Courtès
  0 siblings, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2016-07-13 21:29 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel, Matthew Jordan

Leo Famulari <leo@famulari.name> skribis:

> On Sun, Jul 10, 2016 at 07:52:08PM -0400, Matthew Jordan wrote:
>> * gnu/packages/golang.scm (go-1.5): New variable.
>
> I don't have the knowledge to comment on the Go specific stuff in this
> package, but I have some more general comments.
>
> The tests 'runtime' and 'cmd/go' failed due to the default 3 minute
> time-limit when building on my slow machine, this thing:
> <http://pcengines.ch/apu2b4.htm>
>
> They passed in 193 and 216 seconds, respectively, when I set the
> environment variable GO_TEST_TIMEOUT_SCALE to 9999, as suggested in this
> bug report: <https://github.com/golang/go/issues/12404>

We should set GO_TEST_TIMEOUT_SCALE=9999 (or similar) before the ‘check’
phase to avoid spurious failures on slow or loaded build machines, too.

Ludo’.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-07-13 21:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-10 23:52 [PATCH] add go@1.5 Matthew Jordan
2016-07-11  2:47 ` Leo Famulari
2016-07-11 23:44   ` Matthew Jordan
2016-07-12  3:17 ` Leo Famulari
2016-07-13 21:29   ` Ludovic Courtès
2016-07-12  4:11 ` Alex Griffin
2016-07-12  9:47   ` Matthew Jordan
2016-07-12 15:22     ` Alex Griffin
2016-07-12 22:47       ` Matthew Jordan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).