From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id IH1NH4943mQFZQEASxT56A (envelope-from ) for ; Thu, 17 Aug 2023 21:44:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GAxnH4943mQEHgEA9RJhRA (envelope-from ) for ; Thu, 17 Aug 2023 21:44:15 +0200 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 0CA5E52393 for ; Thu, 17 Aug 2023 21:44:15 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=G7zFkUNG; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1692301455; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=yfSqEfeMwaQHJLlNZzA4pXjbtZwjvD6JczuOq+RCFfQ=; b=OjoyM5ucn1NdTvnyuIQ+c6MaUkIqp2FA5KNmuPHg0qFswqA6i93G4sR8GJ9WZ/rjkY6jAH ljDtCRtTVVqaxefO9enoV8GC0xmLpxFW+/yCQFonoCra4a9Bvn9oGavUqKjE4rpF4yLZ1G 50315lzBAHyBQ/DtRcRBMT+bCbiZW+9Alan0UWcx0Uz5/OefynQ+y+tNJY8gz5Numc/rd3 X62ggf/S8ZkAY2Lqw6e6zZUGQNeZTxa/1YyYfsjvWAgsen5/eaIZzaImUwrrzZU3aXIRhx jMLYJrqEGhbQGaJYG94JqTYkV9IPiy526WPSmcRVwWUuAp6Z2BrbjnIqHANQSA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=G7zFkUNG; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692301455; a=rsa-sha256; cv=none; b=k3ul0eEzunTRyptMiB+PBmm5u6KITMGLLyt0eadMp549Hrb0kcPGjfuJSGa2W5Q+xCUqiz 2iBtRqpcLOiHFuHvkpdB6lNYVuMvLBNZKfoygWGkxm2+LXbUOwGcYP7nx+laHFGdfruGxt l3RQqXEuLARwD/gcT6x3yjsE/EeMm3YsL61JNARo36lz/4jUA0AysNm1y+T5W4ynUy44bu twfDQWU2yHcLHV7VriEtni+/eZxVu1t0Bd31wiXJLb04W7yiz4wc3e7jFtqN01lZF5ca/W zOu51IInLkumHTK5Yk/3/hcMcKZ/keIdQu5hZF/dC4sx7sOCsOoQhWbSjGp2PA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWiuZ-0006ea-1K; Thu, 17 Aug 2023 15:44:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWiuY-0006eQ-2x for guix-patches@gnu.org; Thu, 17 Aug 2023 15:44:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qWiuX-0008IX-Qy for guix-patches@gnu.org; Thu, 17 Aug 2023 15:44:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qWiuX-0005Qx-PL for guix-patches@gnu.org; Thu, 17 Aug 2023 15:44:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65317] [PATCH v3 1/1] gnu: Add go-1.21. References: <20230815195313.46418-1-cox.katherine.e@gmail.com> In-Reply-To: <20230815195313.46418-1-cox.katherine.e@gmail.com> Resent-From: Katherine Cox-Buday Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Aug 2023 19:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65317 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: moreinfo patch To: 65317@debbugs.gnu.org Cc: Katherine Cox-Buday Received: via spool by 65317-submit@debbugs.gnu.org id=B65317.169230141320844 (code B ref 65317); Thu, 17 Aug 2023 19:44:01 +0000 Received: (at 65317) by debbugs.gnu.org; 17 Aug 2023 19:43:33 +0000 Received: from localhost ([127.0.0.1]:45666 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWiu4-0005Q7-PA for submit@debbugs.gnu.org; Thu, 17 Aug 2023 15:43:33 -0400 Received: from mail-oo1-xc2e.google.com ([2607:f8b0:4864:20::c2e]:61535) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWiu2-0005Pt-Rc for 65317@debbugs.gnu.org; Thu, 17 Aug 2023 15:43:31 -0400 Received: by mail-oo1-xc2e.google.com with SMTP id 006d021491bc7-56ce1bd7fc4so164543eaf.2 for <65317@debbugs.gnu.org>; Thu, 17 Aug 2023 12:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692301405; x=1692906205; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=yfSqEfeMwaQHJLlNZzA4pXjbtZwjvD6JczuOq+RCFfQ=; b=G7zFkUNGc2EEaGduO2J3of0FcY9XS8YFwZa/GfmxvcaB6m5TTrpCVXKeHNLu/cM2l5 JKHfhPKMvV3n1lGPzI+J4AVBH/BqHewwxiMBH+TkZScKbFM/DHamYrLKCCfR/QkgKass F4xCEAo6JtPHCfnWGy/EtxW7+Mb49M4wKTSln36UdabhDYaq1oo80+obWjnLplo6vxCz UdzW2qiSgCn0OienQPAFWt0Ds3aiUcrKSONJsz1z2z1Qy+x90DYCscMgd/63CfyQzqRE iEuj0rVP6YeAND8n/39RHLrqWQS5MjvVDG9syGvcmxBXz0rrcX3efBLXZoMOZxjwTEem 7hrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692301405; x=1692906205; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=yfSqEfeMwaQHJLlNZzA4pXjbtZwjvD6JczuOq+RCFfQ=; b=V1gx1rDlp0YeurMx6vezw9W0Nob7r/irC6Je4rszpDKydYKYSlVl3iVtudnlKlOQUm V0L53iJ0dU14uWDUU8nxUD7mM4S/PV0FN6cvcfdlxBESNfzOPB8Nm963WXuH/8mUOqva FPojvXbBrW2cwe8bGqTK2nlBkNpMTATT04O1KL9zDg+QDpR45OHgs+dSP7s8O/dIQeVZ PWt3jDVlT0j5DTO74csPur7POvOrytCoyVkXo2dpYeaWyM6ZGhsHULspSVKnusXouE4B V/AMVG89cHheQLSEeCH/h2Le2vVBMFXUhsxGRjpxQ+b5gGhDaLb/+jlU7CpfsofyjwLR gbfQ== X-Gm-Message-State: AOJu0YyA5pGOEhctGs3FVYySTlNCmjYV3z2fbCSmHU4fe1vQo4y3gTg6 TVjTXvVWegxICP/QchtYcia5p4+cVQk= X-Google-Smtp-Source: AGHT+IHlhlpHgy1AeGcmOsFGormhHZA8V+0hlQ6Tyzqcv2zEMEx5MbpXt4rYfJsU3IkWKIyuSUHQJw== X-Received: by 2002:a4a:2a0d:0:b0:56d:2cbf:2315 with SMTP id k13-20020a4a2a0d000000b0056d2cbf2315mr746209oof.9.1692301404873; Thu, 17 Aug 2023 12:43:24 -0700 (PDT) Received: from washu-v4.home.cox-buday.com (c-174-51-218-141.hsd1.co.comcast.net. [174.51.218.141]) by smtp.gmail.com with ESMTPSA id 1-20020a4a0d01000000b00565d41ba4d0sm84816oob.35.2023.08.17.12.43.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 12:43:24 -0700 (PDT) From: Katherine Cox-Buday Date: Thu, 17 Aug 2023 13:43:18 -0600 Message-ID: <20230817194323.11985-1-cox.katherine.e@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: 3.31 X-Spam-Score: 3.31 X-Migadu-Queue-Id: 0CA5E52393 X-Migadu-Scanner: mx1.migadu.com X-TUID: fA/xM0DCZoMH * gnu/packages/golang.scm (go-1.21): New variable. --- gnu/packages/golang.scm | 132 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 5a53838435..b5f2195ed5 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -967,6 +967,138 @@ (define-public go-1.20 ;; https://go.dev/issue/44505 (alist-replace "go" (list go-1.17) (package-native-inputs go-1.17))))) +(define-public go-1.21 + (package + (inherit go-1.20) + (name "go") + (version "1.21.0") + (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 + "04cpahl10i1sncymdfm0vzcj3czv6lv0axwa1sisl9cz3rdrp7hj")))) + (arguments + (substitute-keyword-arguments (package-arguments go-1.20) + ;; Source patching phases are broken up into discrete steps to allow + ;; future versions to discard individual phases without having to + ;; discard all source patching. + ((#:phases phases) + #~(modify-phases #$phases + (delete 'skip-TestGoPathShlibGccgo-tests) + (delete 'patch-source) + (add-after 'unpack 'patch-os-tests + (lambda _ + (substitute* "src/os/os_test.go" + (("/usr/bin") (getcwd)) + (("/bin/sh") (which "sh"))))) + + (add-after 'unpack 'apply-patches + (lambda* (#:key inputs #:allow-other-keys) + ;; 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-fix-script-tests.patch")))) + + (add-after 'unpack 'patch-src/net + (lambda* (#:key inputs #:allow-other-keys) + (let ((net-base (assoc-ref inputs "net-base"))) + (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")))))) + + (add-after 'unpack 'patch-zoneinfo + (lambda* (#:key inputs #:allow-other-keys) + ;; Add the path to this specific version of tzdata's zoneinfo + ;; file to the top of the list to search. We don't want to + ;; replace any sources because it will affect how binaries + ;; compiled with this Go toolchain behave on non-guix + ;; platforms. + (substitute* "src/time/zoneinfo_unix.go" + (("var platformZoneSources.+" all) + (format #f "~a~%\"~a/share/zoneinfo\",~%" + all + (assoc-ref inputs "tzdata")))))) + + (add-after 'unpack 'patch-cmd/go/testdata/script + (lambda _ + (substitute* "src/cmd/go/testdata/script/cgo_path_space.txt" + (("/bin/sh") (which "sh"))))) + + (add-after 'enable-external-linking 'enable-external-linking-1.21 + (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 && \\(.+\\)") "iscgo")) + (substitute* "src/internal/testenv/testenv.go" + (("!CanInternalLink.+") "true {\n")) + (substitute* "src/syscall/exec_linux_test.go" + (("testenv.MustHaveExecPath\\(t, \"whoami\"\\)") + "t.Skipf(\"no passwd file present\")")))) + + (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'. + ;; + ;; When moving files into place, any files that come from + ;; GOROOT should remain in GOROOT to continue functioning. If + ;; they need to be referenced from some other directory, they + ;; need to be symlinked from GOROOT. For more information, + ;; please see https://github.com/golang/go/issues/61921 + (let* ((out (assoc-ref outputs "out")) + (tests (assoc-ref outputs "tests"))) + (for-each + (lambda (file) + (copy-recursively file (string-append out "/lib/go/" file))) + '("bin" "go.env" "lib" "VERSION" "pkg/include" "pkg/tool")) + + (symlink "lib/go/bin" (string-append out "/bin")) + + (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*)))) + `(("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)))))))))))) + (define-public go go-1.17) (define make-go-std base-commit: a4bed14c438dc0cbc1c1885a38f8409c7fef7957 -- 2.41.0