From patchwork Tue Aug 15 19:53:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Katherine Cox-Buday X-Patchwork-Id: 52860 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4933B27BBE9; Tue, 15 Aug 2023 20:54:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D5CD227BBE2 for ; Tue, 15 Aug 2023 20:54:17 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qW07A-0004cE-29; Tue, 15 Aug 2023 15:54:04 -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 1qW078-0004bh-9A for guix-patches@gnu.org; Tue, 15 Aug 2023 15:54: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 1qW078-0000MS-0l for guix-patches@gnu.org; Tue, 15 Aug 2023 15:54:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qW077-00025I-T2 for guix-patches@gnu.org; Tue, 15 Aug 2023 15:54:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65317] [PATCH 1/1] gnu: Add go-1.21. Resent-From: Katherine Cox-Buday Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 15 Aug 2023 19:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65317 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65317@debbugs.gnu.org Cc: Katherine Cox-Buday X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16921292097969 (code B ref -1); Tue, 15 Aug 2023 19:54:01 +0000 Received: (at submit) by debbugs.gnu.org; 15 Aug 2023 19:53:29 +0000 Received: from localhost ([127.0.0.1]:36716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW06a-00024S-DF for submit@debbugs.gnu.org; Tue, 15 Aug 2023 15:53:28 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW06X-00024D-HT for submit@debbugs.gnu.org; Tue, 15 Aug 2023 15:53:26 -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 1qW06R-0004G4-4b for guix-patches@gnu.org; Tue, 15 Aug 2023 15:53:19 -0400 Received: from mail-io1-xd2e.google.com ([2607:f8b0:4864:20::d2e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qW06O-0000Eu-H7 for guix-patches@gnu.org; Tue, 15 Aug 2023 15:53:18 -0400 Received: by mail-io1-xd2e.google.com with SMTP id ca18e2360f4ac-790bed44880so247615939f.0 for ; Tue, 15 Aug 2023 12:53:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692129195; x=1692733995; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=aaB9R3VN6VEGmBL1qHI5l4E826XFuiJmlz7kVEUq7IM=; b=AhGGofpcrENRl7NdbIhn9KWyrr6lz/adOaMNYEAJJnvTTZCZclRoW3nW2JKsmP9NbJ flzwgub+fMdg7gmnkP2A7+mFC+XOIEdAzHrreOaFrgksGqvoBhXMDgzK2RGLhrH1Me35 auJf6TysYEnbVcs5qaw4teYQ1MPuyFOoH2+t7o6FJb0gonCnUjZY/aN3t02UiGHpT/Hl 0YDlFCXOcqMSMEhGzo8x2GcAh4aMEzG6cmJQnA/w61VPw9FiZowfpbIrr4tOIcBI+C+1 5inijbU7xQXLGQUG++su4H2hAmUc1gYqtMqtGmBXb8mNbe4x8ggzpccMBJfuzb8Shh5H 0h6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692129195; x=1692733995; 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=aaB9R3VN6VEGmBL1qHI5l4E826XFuiJmlz7kVEUq7IM=; b=CnFmsnoJZcumB5POWPuHz8UTkgqEb8sUchz5HJjIaxFNAZVn8LmghbqFW6P9E0Wv5+ kZ06IO35KxdXiRJ+qvJGpQU9XrmA45/HOPTTkVyl5Vqgdn0V6knhrwcZkVtJ3EmI3D3A 1KH/wfwzbvmWbAkx0X9Re8pcjFkxdlP2Iy8EsWpAmOm7sYU6Hs1nb7o0AY8GBVCmO4Mm zFlLc/7rVMi2RL31FoyIc+FeYQmACBb3+Wn0lV9xCwC+8iOi+IlEHKcDvFZUEWC+D3mD 9U5eEy5aYfXQ7qdKyd7qcVSsctiqXHbf01kFUvLmDWe/KA8wFcaPzyezmBq1OrBVe3Jt hxiA== X-Gm-Message-State: AOJu0YxwIy7cQq8ajotPbM0HdeSXLzSIN8y2d+KosGZv0beF3lpy4ri0 H78ryLqiosbPG1G0lU6lG3ZIGmKdOig= X-Google-Smtp-Source: AGHT+IEsroVo67nn5HI7VnJJ+vk0Ro8x4mw3ApTvWW/mwE4D2Ek+M/7pteiggrT1WW5GXG7O8HxHlA== X-Received: by 2002:a6b:3108:0:b0:785:cfa1:fcac with SMTP id j8-20020a6b3108000000b00785cfa1fcacmr15227954ioa.20.1692129194982; Tue, 15 Aug 2023 12:53:14 -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 a5-20020a6b6605000000b0078335414ddesm4011872ioc.26.2023.08.15.12.53.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:53:14 -0700 (PDT) From: Katherine Cox-Buday Date: Tue, 15 Aug 2023 13:53:04 -0600 Message-ID: <20230815195313.46418-1-cox.katherine.e@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::d2e; envelope-from=cox.katherine.e@gmail.com; helo=mail-io1-xd2e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/golang.scm (go-1.21): New variable. --- gnu/packages/golang.scm | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) base-commit: a4bed14c438dc0cbc1c1885a38f8409c7fef7957 diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 5a53838435..bd2fc4d5d5 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -967,6 +967,89 @@ (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\")")))))))))) + (define-public go go-1.17) (define make-go-std