From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uM9+K4RkOmHHHQEAgWs5BA (envelope-from ) for ; Thu, 09 Sep 2021 21:46:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SItfJ4RkOmEBVwAAB5/wlQ (envelope-from ) for ; Thu, 09 Sep 2021 19:46:12 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3D5A526087 for ; Thu, 9 Sep 2021 21:46:12 +0200 (CEST) Received: from localhost ([::1]:42294 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOPzv-0001Kh-7N for larch@yhetil.org; Thu, 09 Sep 2021 15:46:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOPzm-0001KB-Ei for guix-patches@gnu.org; Thu, 09 Sep 2021 15:46:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52989) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOPzm-0005Zr-6f for guix-patches@gnu.org; Thu, 09 Sep 2021 15:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mOPzl-0006It-O5 for guix-patches@gnu.org; Thu, 09 Sep 2021 15:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50348] [PATCH v2] gnu: Add go-1.17. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 09 Sep 2021 19:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50348 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50348@debbugs.gnu.org Received: via spool by 50348-submit@debbugs.gnu.org id=B50348.163121675024212 (code B ref 50348); Thu, 09 Sep 2021 19:46:01 +0000 Received: (at 50348) by debbugs.gnu.org; 9 Sep 2021 19:45:50 +0000 Received: from localhost ([127.0.0.1]:36302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOPza-0006IS-03 for submit@debbugs.gnu.org; Thu, 09 Sep 2021 15:45:50 -0400 Received: from out2.migadu.com ([188.165.223.204]:63294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mOPzW-0006II-OB for 50348@debbugs.gnu.org; Thu, 09 Sep 2021 15:45:48 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1631216745; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xEFaNjrcaBemnNHnYBrSagbN3sgvgfMNPP/Dy080++c=; b=Mlxwiy918nzoEpIMrzazNuuMqawGC0+uui+iwvjCDK8bKJ7tiVk0MxNiTbSj4RVCVmNScU 24/MiHGd05EdX3DNAhDsN1TXp69C8j4kAGxrSW36OqxW0E4Yo9yS3uS2mwlngY94XPt2dx Toe9zWpEE48uTzBiEnBGnBxdSEL0Wo0= From: Sarah Morgensen Date: Thu, 9 Sep 2021 12:45:42 -0700 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Auth-User: iskarian@mgsn.dev X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1631216772; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=xEFaNjrcaBemnNHnYBrSagbN3sgvgfMNPP/Dy080++c=; b=UeaNNy14+xutEuBnHGNrpYz1kiGWhwXHpl7I23OC4C1lU5abYR4fIpCpBi+hFn0iZCvZWI qx+dUsfNjcrYy3xS6c2o1WB1WO4rfPVyZ66OZ+I6drk6wTThXgevJUTy7s3kuX1LtKuo7H GN+rRuDw0wSu3i84wZ3xUm2U3phGM+OXQGdQbcm790/QFqzNDj3cucid3zamEdB6KoSNIT Wb0S7Z9GsOc3m3CbQGPqOP9sluH9TAPPdWQkaKrluPhVa6uMm5WLHy9VxbPfT8bhJfsC9u qQWThoHqznng7B5OoJx//tRbViofui702YDAZICvuH/o4TY5yPJQWm4vx74uRQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631216772; a=rsa-sha256; cv=none; b=UhXlulJ7JTYZJPYOnLg/koUPr3TZi/V9QOQtRXt+0cUhmtYPiRYhNdlivXVmTAl6nnlSNN +Bon8Yjt2VSJzSKZOEkLEu03QnYq640MRdwE5ocMMW5M3n2rOE9Fl3wqw9mIDKTyhD42TB KC7tZ7kBFY+WdjgTwgjcnd3BedCozcaQ2MIUXycwtWL2+h4VrDT//HiBNxWFY/Gx0LzaQp 0gavWOM0RGqOXoAM8T0CiK+h4ZjOU3YIBKKoDV/esruMONDnTgtq/vf9so6+Rr+JMnNPeo tM4lT22e/Xshu2iB+T83MngTlgQFvNZg28Kl0Eww7mhhynH8vp0lt112e+sVhA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=Mlxwiy91; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.69 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=mgsn.dev header.s=key1 header.b=Mlxwiy91; dmarc=fail reason="SPF not aligned (relaxed)" header.from=mgsn.dev (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3D5A526087 X-Spam-Score: 3.69 X-Migadu-Scanner: scn0.migadu.com X-TUID: gN6sXotgN5wK * gnu/packages.golang.scm (go-1.17): New variable. --- Rebased on current master and updated to use Go 1.17.1. gnu/packages/golang.scm | 182 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 182 insertions(+) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index b6e8b84749..95cff83e9e 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -608,6 +608,188 @@ in the style of communicating sequential processes (@dfn{CSP}).") (alist-replace "go" (list gccgo-10) (package-native-inputs go-1.14)) (package-native-inputs go-1.14)))))) +(define-public go-1.17 + (package + (inherit go-1.16) + (name "go") + (version "1.17.1") + (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 + "0wk99lwpzp4qwrksl932lm9vb70nyf4vgb5lxwh7gzjcbhlqj992")))) + (outputs '("out" "tests")) ; 'tests' contains distribution tests. + (arguments + `(#:modules ((ice-9 match) + (guix build gnu-build-system) + (guix build utils)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((output (assoc-ref outputs "out")) + (loader (string-append (assoc-ref inputs "libc") + ,(glibc-dynamic-linker)))) + (setenv "GOOS" "linux") + (setenv "GO_LDSO" loader) + (setenv "GOROOT" (getcwd)) + (setenv "GOROOT_FINAL" (string-append output "/lib/go")) + (setenv "GOGC" "400") + (setenv "GOCACHE" "/tmp/go-cache")))) + (add-after 'unpack 'patch-source + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((net-base (assoc-ref inputs "net-base")) + (tzdata-path (string-append (assoc-ref inputs "tzdata") + "/share/zoneinfo"))) + ;; XXX: Remove when #49729 is merged? + (for-each make-file-writable (find-files "src")) + + ;; Having the patch in the 'patches' field of breaks + ;; the 'TestServeContent' test due to the fact that + ;; timestamps are reset. Thus, apply it from here. + (invoke "patch" "-p1" "--force" "-i" + (assoc-ref inputs "go-skip-gc-test.patch")) + (invoke "patch" "-p1" "--force" "-i" + (assoc-ref inputs "go-fix-script-tests.patch")) + + (substitute* "src/os/os_test.go" + (("/usr/bin") (getcwd)) + (("/bin/sh") (which "sh"))) + + (substitute* "src/cmd/go/testdata/script/cgo_path_space.txt" + (("/bin/sh") (which "sh"))) + + ;; fix shebang for testar script + ;; note the target script is generated at build time. + (substitute* "misc/cgo/testcarchive/carchive_test.go" + (("/usr/bin/env bash") (which "bash"))) + + (substitute* "src/net/lookup_unix.go" + (("/etc/protocols") + (string-append net-base "/etc/protocols"))) + (substitute* "src/net/port_unix.go" + (("/etc/services") + (string-append net-base "/etc/services"))) + (substitute* "src/time/zoneinfo_unix.go" + (("/usr/share/zoneinfo/") tzdata-path))))) + (add-after 'patch-source 'disable-failing-tests + (lambda _ + ;; 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 test) + (let ((regex (string-append "^(func\\s+)(" test "\\()"))) + (substitute* file + ((regex all before test_name) + (string-append before "Disabled" test_name)))))) + '(("src/net/cgo_unix_test.go" "TestCgoLookupPort") + ("src/net/cgo_unix_test.go" "TestCgoLookupPortWithCancel") + ;; 127.0.0.1 doesn't exist + ("src/net/cgo_unix_test.go" "TestCgoLookupPTR") + ("src/net/cgo_unix_test.go" "TestCgoLookupPTRWithCancel") + ;; /etc/services doesn't exist + ("src/net/parse_test.go" "TestReadLine") + ;; The user's directory doesn't exist + ("src/os/os_test.go" "TestUserHomeDir"))) + + ;; These tests fail on aarch64-linux + (substitute* "src/cmd/dist/test.go" + (("t.registerHostTest\\(\"testsanitizers/msan.*") "")))) + (add-after 'patch-source 'enable-external-linking + (lambda _ + ;; Invoke GCC to link any archives created with GCC (that is, any + ;; packages built using 'cgo'), because Go doesn't know how to + ;; handle the runpaths but GCC does. Use substitute* rather than + ;; a patch since these files are liable to change often. + ;; + ;; XXX: Replace with GO_EXTLINK_ENABLED=1 or similar when + ;; and/or + ;; are resolved. + (substitute* "src/cmd/link/internal/ld/config.go" + (("iscgo && externalobj") "iscgo")) + (substitute* '("src/cmd/nm/nm_cgo_test.go" + "src/cmd/dist/test.go") + (("^func.*?nternalLink\\(\\).*" all) + (string-append all "\n\treturn false\n"))))) + (replace 'build + (lambda* (#:key (parallel-build? #t) #:allow-other-keys) + (let* ((njobs (if parallel-build? (parallel-job-count) 1))) + (with-directory-excursion "src" + (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? + (with-directory-excursion "src" + (setenv "GOMAXPROCS" (number->string njobs)) + (invoke "sh" "run.bash" "--no-rebuild")))))) + (add-before 'install 'unpatch-perl-shebangs + (lambda _ + ;; Avoid inclusion of perl in closure by rewriting references + ;; to perl input in sourcecode generators and test scripts + (substitute* (cons "src/net/http/cgi/testdata/test.cgi" + (find-files "src" "\\.pl$")) + (("^#!.*") "#!/usr/bin/env perl\n")))) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + ;; Notably, we do not install archives (180M), which Go will + ;; happily recompile quickly (and cache) if needed, almost + ;; surely faster than they could be substituted. + ;; + ;; The main motivation for pre-compiled archives is to use + ;; libc-linked `net' or `os' packages without a C compiler, + ;; but on Guix a C compiler is necessary to properly link the + ;; final binaries anyway. Many build flags also invalidate + ;; these pre-compiled archives, so in practice Go often + ;; recompiles them anyway. + ;; + ;; Upstream is also planning to no longer install these + ;; archives: + ;; + ;; When necessary, a custom pre-compiled library package can + ;; be created with `#:import-path "std"' and used with + ;; `-pkgdir'. + (let* ((out (assoc-ref outputs "out")) + (tests (assoc-ref outputs "tests"))) + (for-each + (lambda (file) + (copy-recursively file (string-append out "/lib/go/" file))) + '("lib" "VERSION" "pkg/include" "pkg/tool")) + + (for-each + (match-lambda + ((file dest output) + ;; Copy to output/dest and symlink from output/lib/go/file. + (let ((file* (string-append output "/lib/go/" file)) + (dest* (string-append output "/" dest))) + (copy-recursively file dest*) + (mkdir-p (dirname file*)) + (symlink (string-append "../../" dest) file*)))) + `(("bin" "bin" ,out) + ("src" "share/go/src" ,out) + ("misc" "share/go/misc" ,out) + ("doc" "share/doc/go/doc" ,out) + ("api" "share/go/api" ,tests) + ("test" "share/go/test" ,tests)))))) + (add-after 'install 'install-doc-files + (lambda* (#:key outputs #:allow-other-keys) + (let ((out (assoc-ref outputs "out"))) + (for-each + (lambda (file) + (install-file file (string-append out "/share/doc/go"))) + '("AUTHORS" "CONTRIBUTORS" "CONTRIBUTING.md" "PATENTS" + "README.md" "SECURITY.md")))))))) + (inputs (alist-delete "gcc:lib" (package-inputs go-1.16))))) + (define-public go go-1.14) (define-public go-0xacab-org-leap-shapeshifter base-commit: bae57cc7d2917c4a67e9afb68ed61ad7117ea7ea -- 2.33.0