From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eq7Ni-0003hn-0v for guix-patches@gnu.org; Sun, 25 Feb 2018 20:15:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eq7Ne-0001bv-Ng for guix-patches@gnu.org; Sun, 25 Feb 2018 20:15:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:52907) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eq7Ne-0001bm-J0 for guix-patches@gnu.org; Sun, 25 Feb 2018 20:15:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eq7Ne-0000kz-Du for guix-patches@gnu.org; Sun, 25 Feb 2018 20:15:02 -0500 Subject: [bug#30579] [PATCH] gnu: Add go@1.10. Resent-Message-ID: From: Marius Bakke In-Reply-To: <074653d80538e9c2d64f91d7d0247dcaee20099e.1519324522.git.leo@famulari.name> References: <20180222182503.GA369@jasmine.lan> <074653d80538e9c2d64f91d7d0247dcaee20099e.1519324522.git.leo@famulari.name> Date: Mon, 26 Feb 2018 02:14:12 +0100 Message-ID: <87efl8wo0r.fsf@fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Leo Famulari , 30579@debbugs.gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Leo Famulari writes: > Building Go 1.10 with the Go 1.4 bootstrap, Thread Sanitizer from GCC 5 > finds a data race during the the test suite of Go 1.10. With GCC 6, the > race doesn't seem to be present. Can you add this comment next to the GCC input? That way it's obvious for people wondering about it, without having to grep the commit log. Other than that LGTM. > > .##### ../misc/cgo/testsanitizers > --- FAIL: TestShared (0.03s) > --- FAIL: TestShared/tsan_shared (2.54s) > cshared_test.go:71: `/tmp/guix-build-go-1.10.drv-0/TestShared3679= 37240/tsan_shared` exited with exit status 66 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > WARNING: ThreadSanitizer: data race (pid=3D28778) > Write of size 8 at 0x7ffff5495c30 by thread T1: > #0 pthread_attr_getstacksize (tsan_shared+0x00= 000041be82) > #1 x_cgo_init (libtsan_shared.so+0x00000008aea= f) > #2 runtime.rt0_go /tmp/guix-build-go-1.10.drv-0/go/sr= c/runtime/asm_amd64.s:199 (libtsan_shared.so+0x000000081586) > > Previous write of size 8 at 0x7ffff5495c30 by main thre= ad: > #0 (0x000000000001) > > Location is stack of thread T1. > > Thread T1 (tid=3D28786, running) created by main thread= at: > #0 pthread_create (tsan_shared+0x00000040c794) > #1 _cgo_try_pthread_create (libtsan_shared.so+= 0x00000008ad70) > #2 x_cgo_sys_thread_create (libtsan_shared.so+= 0x00000008ab12) > #3 _rt0_amd64_lib /tmp/guix-build-go-1.10.drv-0/go/sr= c/runtime/asm_amd64.s:56 (libtsan_shared.so+0x0000000813b6) > > SUMMARY: ThreadSanitizer: data race ??:0 __interceptor_pt= hread_attr_getstacksize > > * gnu/packages/golang.scm (go-1.10): New variable. > (go-1.4)[native-inputs]: Use gcc:lib version 6. > --- > gnu/packages/golang.scm | 115 ++++++++++++++++++++++++++++++++++++++++++= +++++- > 1 file changed, 114 insertions(+), 1 deletion(-) > > diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm > index f11cc76d9..a542eaba8 100644 > --- a/gnu/packages/golang.scm > +++ b/gnu/packages/golang.scm > @@ -187,7 +187,7 @@ > (inputs > `(("tzdata" ,tzdata) > ("pcre" ,pcre) > - ("gcc:lib" ,gcc "lib"))) > + ("gcc:lib" ,gcc-6 "lib"))) > (native-inputs > `(("pkg-config" ,%pkg-config) > ("which" ,which) > @@ -372,6 +372,119 @@ in the style of communicating sequential processes = (@dfn{CSP}).") > ,@(package-native-inputs go-1.4))) > (supported-systems %supported-systems))) >=20=20 > +(define-public go-1.10 > + (package > + (inherit go-1.9) > + (name "go") > + (version "1.10") > + (source > + (origin > + (method url-fetch) > + (uri (string-append "https://storage.googleapis.com/golang/" > + name version ".src.tar.gz")) > + (sha256 > + (base32 > + "093z1h0gmi458kv7smpx0ph6jm7ss9mzxa432kysbz85jhl4kppk")))) > + (arguments > + (substitute-keyword-arguments (package-arguments go-1.9) > + ((#:phases phases) > + `(modify-phases ,phases > + (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 (find-files ld "^ld-linux.+"))) > + (net-base (assoc-ref inputs "net-base")) > + (tzdata-path > + (string-append (assoc-ref inputs "tzdata") "/shar= e/zoneinfo")) > + (output (assoc-ref outputs "out"))) > + > + ;; Removing net/ tests, which fail when attempting to a= ccess > + ;; network resources not present in the build container. > + (for-each delete-file > + '("net/listen_test.go" > + "net/parse_test.go" > + "net/cgo_unix_test.go")) > + > + (substitute* "os/os_test.go" > + (("/usr/bin") (getcwd)) > + (("/bin/pwd") (which "pwd")) > + (("/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 :=3D \\[\\]string\\{\\}") > + (string-append "cgoldflags :=3D []string{" > + "\"-rpath=3D" gcclib "\"" > + "}")) > + (("\"-lgcc_s\", ") > + (string-append > + "\"-Wl,-rpath=3D" gcclib "\", \"-lgcc_s\", "))) > + (substitute* "cmd/go/internal/work/gc.go" > + (("ldflags =3D setextld\\(ldflags, compiler\\)") > + (string-append > + "ldflags =3D setextld(ldflags, compiler)\n" > + "ldflags =3D append(ldflags, \"-r\")\n" > + "ldflags =3D append(ldflags, \"" gcclib "\")\n"))) > + > + ;; Disable failing tests: these tests attempt to access > + ;; commands or network resources which are neither avai= lable > + ;; 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.+)") > + ("os/os_test.go" "(.+)(TestHostname.+)") > + ("time/format_test.go" "(.+)(TestParseInSydney.+)") > + ("time/format_test.go" "(.+)(TestParseInLocation.+)") > + ("os/exec/exec_test.go" "(.+)(TestEcho.+)") > + ("os/exec/exec_test.go" "(.+)(TestCommandRelativeNam= e.+)") > + ("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" "(.+)(TestIgnorePipeErrorOnS= uccess.+)") > + ("syscall/syscall_unix_test.go" "(.+)(TestPassFD\\(.= +)") > + ("os/exec/exec_test.go" "(.+)(TestExtraFiles/areturn= .+)") > + ("cmd/go/go_test.go" "(.+)(TestCoverageWithCgo.+)") > + ("os/exec/exec_test.go" "(.+)(TestOutputStderrCaptur= e.+)") > + ("os/exec/exec_test.go" "(.+)(TestExtraFiles.+)") > + ("os/exec/exec_test.go" "(.+)(TestExtraFilesRace.+)") > + ("net/lookup_test.go" "(.+)(TestLookupPort.+)") > + ("syscall/exec_linux_test.go" > + "(.+)(TestCloneNEWUSERAndRemapNoRootDisableSetgroup= s.+)"))) > + > + ;; 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/pro= tocols"))) > + (substitute* "net/port_unix.go" > + (("/etc/services") (string-append net-base "/etc/serv= ices"))) > + (substitute* "time/zoneinfo_unix.go" > + (("/usr/share/zoneinfo/") tzdata-path)) > + (substitute* (find-files "cmd" "\\.go") > + (("/lib(64)?/ld-linux.*\\.so\\.[0-9]") loader)) > + #t))) > + (replace '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") > + ;; Go 1.10 tries to write to $HOME in a test > + (setenv "HOME" "/tmp") > + #t))))))))) > + > (define-public go go-1.9) >=20=20 > (define-public go-github-com-alsm-ioprogress > --=20 > 2.16.2 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAlqTX2QACgkQoqBt8qM6 VPp8JwgAkIRRf3Pr/9x7q2MZ9lpIQvJQl2GxrCdYSq6nqLUYbuSwU2vmPoXaog89 9Xrps+On++s3DMX3Dvx+tpN5KbbMjMc3kwFx/W1RQVCKOYbGlbqK2DE9EcBwEcJG j/xGvSHTDZDO5L6m+5CqNnvR7by684WO7/UjzqrdKzs3S64za814qGBfmc3OV8/A tdRHLLFYNH7GFuFx2HQY+bD4F89VN8RVNWatkqmmc2QzaV/XGzwYmvvW9tLQoZvK Pky3vW+uHEGZLjT41rJszadXfSkspveJ92x6vfvVjTXqAnE8isXUEIEAlMJLbMtZ TfWggEPHgnJlooPmjBZ52py/zcpIQw== =hcwI -----END PGP SIGNATURE----- --=-=-=--