From unknown Sun Jun 22 11:35:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#65317 <65317@debbugs.gnu.org> To: bug#65317 <65317@debbugs.gnu.org> Subject: Status: [PATCH 1/1] gnu: Add go-1.21. Reply-To: bug#65317 <65317@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:35:33 +0000 retitle 65317 [PATCH 1/1] gnu: Add go-1.21. reassign 65317 guix-patches submitter 65317 Katherine Cox-Buday severity 65317 normal tag 65317 moreinfo patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 15 15:53:28 2023 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 To: guix-patches@gnu.org Subject: [PATCH 1/1] gnu: Add go-1.21. 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 Content-Transfer-Encoding: 8bit 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-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit Cc: Katherine Cox-Buday X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) * gnu/packages/golang.scm (go-1.21): New variable. --- gnu/packages/golang.scm | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) 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 base-commit: a4bed14c438dc0cbc1c1885a38f8409c7fef7957 -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 15 18:03:26 2023 Received: (at 65317) by debbugs.gnu.org; 15 Aug 2023 22:03:26 +0000 Received: from localhost ([127.0.0.1]:37016 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW28M-0007Ql-Cj for submit@debbugs.gnu.org; Tue, 15 Aug 2023 18:03:26 -0400 Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:57573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW28G-0007QS-UK for 65317@debbugs.gnu.org; Tue, 15 Aug 2023 18:03:24 -0400 Received: by mail-io1-xd34.google.com with SMTP id ca18e2360f4ac-7910b9bb891so190776239f.2 for <65317@debbugs.gnu.org>; Tue, 15 Aug 2023 15:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692136995; x=1692741795; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Qy4ZYC5HvIhsaCaFm4KMLYmu1Fjl2J9JeOIyWMPqwpI=; b=n0HF7t0s5S/8mEIpRCzvfyMokHEM8bpWlzbWigSSphwptPikhOgWEdebbErSt8p9xI D40iRH2Sh2VUBbEN7/hMOXt+PPDeWStzOzwZeUSEIK0wXA1XbzmwxaMxChHxr1rcR87T 1FIP8a093oP3wEGQhdQ/inW4R1opr5RWA8rxUVa76sfqfHjCb8hEAfkW1LNYUq0+I0f+ 0Kff7LluJ5jlQip5gqsHl8oVOOq0YJc0q1HElxxAXCRCZDArkHdxa/4Eqa2q7OZOyvM+ WY6/Ul11hm9ha5nI5MQ0X3Myxf6PjbW4SMLezoZogR4frmjeWJt0m1oFlPbZfX+XPji3 f3TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692136995; x=1692741795; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qy4ZYC5HvIhsaCaFm4KMLYmu1Fjl2J9JeOIyWMPqwpI=; b=TQEP6HySBZLeW7xjXFX3F2VVitC9yN3tEc+xnCBQnWRJMX6ZLuwjonvG8L57jZwION 1qEJYcb+yqYD4DIecHYDocHuGZoJnsZ0UAYhddIiT1rbqTLR01qtMo0UF9dwBj1cAKGO Hm2kyWCFG28BMZHK6I3mgO71GMDkfOYyHtXefto5MTxxY402Y3G7cNffQzHcs7Q/Zc6R nzn2GtHLX4RxzgTx6LMhxqT5xQByj93MBD5zRHKiXrxrC6r4mEaq9Yt6LLLXv1Rg7coW x0reKyg73tbWlBBW9Lff26DN7ENjrr0qjfhb+wJAbfPZbYVlUa2IGWR26GxaAxVtbHtM ntaA== X-Gm-Message-State: AOJu0Yz8N5+McKwqIfqxUtjA42LjnF88rW4iUQL8yj9IpQ3pRzfA2jgb nb6cVWZwmWDxAtIPDWKkaEFErR2/VhE= X-Google-Smtp-Source: AGHT+IEEUZXfBKAv4VXxoo1om8B1PTZ2K7BfAAOqtuMkx0fMeb4BMsAyjlQ9gsmRjRCy5U05LRJw/Q== X-Received: by 2002:a05:6602:2202:b0:790:d813:2d38 with SMTP id n2-20020a056602220200b00790d8132d38mr20407635ion.11.1692136995215; Tue, 15 Aug 2023 15:03:15 -0700 (PDT) Received: from [10.0.2.153] (c-174-51-218-141.hsd1.co.comcast.net. [174.51.218.141]) by smtp.gmail.com with ESMTPSA id c24-20020a05660221d800b00783737db8ebsm4013593ioc.38.2023.08.15.15.03.14 for <65317@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Aug 2023 15:03:14 -0700 (PDT) Message-ID: <975cccf4-62bf-7036-3ecf-77270f3db717@gmail.com> Date: Tue, 15 Aug 2023 16:03:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: bug#65317: Acknowledgement ([PATCH 1/1] gnu: Add go-1.21.) Content-Language: en-US To: 65317@debbugs.gnu.org References: <20230815195313.46418-1-cox.katherine.e@gmail.com> From: Katherine Cox-Buday In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 65317 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) It looks like as written this suffers from https://github.com/golang/go/issues/61921 (relevant code here: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/golang.scm?h=master#n671). I'm trying to figure out what the correct course of action is for Guix. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 15 19:21:54 2023 Received: (at 65317) by debbugs.gnu.org; 15 Aug 2023 23:21:54 +0000 Received: from localhost ([127.0.0.1]:37061 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW3MH-00012i-Cc for submit@debbugs.gnu.org; Tue, 15 Aug 2023 19:21:53 -0400 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]:46301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW3ME-00012U-4V for 65317@debbugs.gnu.org; Tue, 15 Aug 2023 19:21:52 -0400 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-6bcade59b24so4888654a34.0 for <65317@debbugs.gnu.org>; Tue, 15 Aug 2023 16:21:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692141704; x=1692746504; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=VHXZM0iJu03BUTFaoGAWKS4SKttxXqC1gdbrxXmojng=; b=mlOYG1SbsCdu4ICOM/MLxzpaQC6rlM6WovzwquoyNEc8X0g7MI9vkpn9+SFuX0JQLo D8dxV3w/47JXRmoP+U8KhSwiNUrh4n8UCrHb0w5JLVIu3N0NbQpmGfDmF0jaqEfhd4QH K/O9jlAVLC+0/No3Ru1dPIa5mapMtWwDnrpyUeiU4Ep6VnHsLijHHo+IqpZJqbDbnqKX KosaNpdCjXlOq0NiBUKSbYQF8wFSzvBG2CWkzGy6zJisuNajtON5qM6Ph38Gsqi8BlQd /ZCPg4sU4A12PdUHRlwInO6e/GwduRLzafU0Y4y+3jpWh68CAB2pvSmUMFUBMUP/F+Tp dcrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692141704; x=1692746504; 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=VHXZM0iJu03BUTFaoGAWKS4SKttxXqC1gdbrxXmojng=; b=BUT7jN9pmBtgseccoB/nAnyFRLOITXbpQlqKpNoWiNm0gSeZ/3GYOhhTOweq+S6kkF WS63nZoQK8ImtLhD2CYZ9LzJioXdsgT5srphJA6zy1cRmPMbrzk9Sy+99htQsZfl5hjr v7RMAIpToPPTD2RQP72v9Nd/5mKojNoslg7ZAhUa2lv2jHlVACrk7ZWzC9AkujMx5owB cT8P6wfT0Jq4wGKBrUOU6DHbtRnAd5IbSpqj5fJ9S4qFm0437/xwi0oTZVIyudZHlHb0 7KUp47J9hbHK4Dki1P4Z+/svib57GWvM2QDGjlf3+QQluApq14vtWLhzc34OqfkWisYQ DesQ== X-Gm-Message-State: AOJu0YzMkvvq/lNW977Qs2XT/WI8836qdZI20aKePefDHvw0WuAv1urw yx5crS3TQzPvdMBAHYffm/RTEZBqucU= X-Google-Smtp-Source: AGHT+IGWEJ2pubyITxRZ6QP01xuJmO2AaH+Ol/Yk4tSzRlRWR6Kh0dnRyUyAdn5Rmgarpi5T/uDv2w== X-Received: by 2002:a05:6870:56a9:b0:1bc:f15:c9ef with SMTP id p41-20020a05687056a900b001bc0f15c9efmr131460oao.19.1692141704233; Tue, 15 Aug 2023 16:21:44 -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 g6-20020a02b706000000b0041d73d0a412sm3942043jam.19.2023.08.15.16.21.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 16:21:43 -0700 (PDT) From: Katherine Cox-Buday To: 65317@debbugs.gnu.org Subject: [PATCH v2 1/1] gnu: Add go-1.21. Date: Tue, 15 Aug 2023 17:20:40 -0600 Message-ID: <20230815232142.79498-1-cox.katherine.e@gmail.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65317 Cc: Katherine Cox-Buday X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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..26022ea211 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" "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 From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 15 19:29:53 2023 Received: (at submit) by debbugs.gnu.org; 15 Aug 2023 23:29:53 +0000 Received: from localhost ([127.0.0.1]:37075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW3U1-0001Fc-Cu for submit@debbugs.gnu.org; Tue, 15 Aug 2023 19:29:53 -0400 Received: from lists.gnu.org ([2001:470:142::17]:32966) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qW3Ty-0001FN-Mh for submit@debbugs.gnu.org; Tue, 15 Aug 2023 19:29:52 -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 1qW3Tt-0002ds-CY for guix-patches@gnu.org; Tue, 15 Aug 2023 19:29:45 -0400 Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qW3Tr-0007H0-8B for guix-patches@gnu.org; Tue, 15 Aug 2023 19:29:45 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1qW3Tn-0003bI-6c for guix-patches@gnu.org; Wed, 16 Aug 2023 01:29:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: guix-patches@gnu.org From: Katherine Cox-Buday Subject: Re: [bug#65317] [PATCH v2 1/1] gnu: Add go-1.21. Date: Tue, 15 Aug 2023 17:29:29 -0600 Message-ID: References: <20230815195313.46418-1-cox.katherine.e@gmail.com> <20230815232142.79498-1-cox.katherine.e@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Content-Language: en-US In-Reply-To: <20230815232142.79498-1-cox.katherine.e@gmail.com> Received-SPF: pass client-ip=116.202.254.214; envelope-from=gcggp-guix-patches@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 18 X-Spam_score: 1.8 X-Spam_bar: + X-Spam_report: (1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-1.045, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 2.1 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This version solves the problem by reversing the symlinking done during install as suggested in https://github.com/golang/go/issues/61921. Instead of: - mv bin $out/bin - ln -s ../../bin $out/lib/go/bin Content analysis details: (2.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (cox.katherine.e[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received' headers 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -1.0 NICE_REPLY_A Looks like a legit reply (A) 1.6 FORGED_MUA_MOZILLA Forged mail pretending to be from Mozilla X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.1 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This version solves the problem by reversing the symlinking done during install as suggested in https://github.com/golang/go/issues/61921. Instead of: - mv bin $out/bin - ln -s ../../bin $out/lib/go/bin Content analysis details: (1.1 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.2 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level mail domains are different 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (cox.katherine.e[at]gmail.com) -0.0 SPF_HELO_PASS SPF: HELO matches SPF record 1.0 FORGED_GMAIL_RCVD 'From' gmail.com does not match 'Received' headers 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and EnvelopeFrom freemail headers are different -1.0 NICE_REPLY_A Looks like a legit reply (A) -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager 1.6 FORGED_MUA_MOZILLA Forged mail pretending to be from Mozilla This version solves the problem by reversing the symlinking done during install as suggested in https://github.com/golang/go/issues/61921. Instead of: - mv bin $out/bin - ln -s ../../bin $out/lib/go/bin we need to do: - mv bin $out/lib/go/ - ln -s lib/go/bin $out/bin This is because GOROOT_FINAL no longer has the intended effect and the binaries are expecting binaries to be run from GOROOT which is $out/lib/go. From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 16 11:35:57 2023 Received: (at control) by debbugs.gnu.org; 16 Aug 2023 15:35:58 +0000 Received: from localhost ([127.0.0.1]:41869 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWIYv-0000HG-MB for submit@debbugs.gnu.org; Wed, 16 Aug 2023 11:35:57 -0400 Received: from mail-ua1-x929.google.com ([2607:f8b0:4864:20::929]:60512) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWIYt-0000H0-9P for control@debbugs.gnu.org; Wed, 16 Aug 2023 11:35:55 -0400 Received: by mail-ua1-x929.google.com with SMTP id a1e0cc1a2514c-7a006828e99so453221241.0 for ; Wed, 16 Aug 2023 08:35:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692200149; x=1692804949; h=subject:from:to:message-id:date:from:to:cc:subject:date:message-id :reply-to; bh=zEbt0UXjTZQefxO7l7wqH1+R4A8/MJWDiIwLM3vLf3M=; b=hRYI6CYsOZxFaFrqyMioui4zE15cTQFE0O+qra0FSdoC5cMtoxNijfUQZxhWE6K8gx hyRKb9aencBba/hZJFj/7On1Dh4Ssqsw974vOQrbW3m9ndNlN884AI7v4eONQx9nJ+EE KB6Mxh+YLI22ILgYdIg1NFHkfmA2KppZbMyI7njHIEpi0C2JgKST0liRegnDmvhanggG L4/XIJexS+4pSLXjU/M0wUU2/ob8y+L2kF74LPYOh12uEiUQN+qh8XoGHTKlRXeWxTG4 PSh0JAUnZ08C81Qy3NjLCO1/mCRbmWMKAhjglKjKfCOdufxhc6SQsik25QZNOMFgLWQM 7bcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692200149; x=1692804949; h=subject:from:to:message-id:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zEbt0UXjTZQefxO7l7wqH1+R4A8/MJWDiIwLM3vLf3M=; b=EvLvzV7GaVZzYvXXEZllfU0pq28HyCIA03bAzhidG6ubcv/95ZRQrZbyR4sdwXh9tO oDFBogwJl/FkAFu+UwrcBrVomLlunNkswbhwWq/PRqUyiZNy2kiQ6RRjH7pyzna24ux9 GxuuQveVXxixuGt7YXwwvcpZ0b6GM676En7pMv+oV0NcpcTd/kI1dTX3zM/fuP5qV4wI 3SsX5wWNOR6Jrglxavtda1FN4ZA55TCaEwFrXd9JUiccwTtVtak2y7UmSVqyS/2QFBpd GF/ZihwhUbJHxDZCzSjUkr4Q92IJs+RGr9BGv5mgD7H1vSpRwHM2eVr2X9pRXmb1HZBk Nfmw== X-Gm-Message-State: AOJu0YwuzO6N/d/jysxPW1TXmV1v37tAZJjYzeuWssb5sgt7ArlQZ0k0 gwP421sHGt/eyxPy8yF0Ojnc46KSzuE= X-Google-Smtp-Source: AGHT+IEI0hO2C43YNxZlswImUVqXoF7u5M5LiatNZ2nUZ83VePM0yG91Zy7wFPO3PLmPuTRgINGZIg== X-Received: by 2002:a05:6102:7b7:b0:447:b88e:ca61 with SMTP id x23-20020a05610207b700b00447b88eca61mr1915294vsg.10.1692200149338; Wed, 16 Aug 2023 08:35:49 -0700 (PDT) Received: from hurd (dsl-152-182.b2b2c.ca. [66.158.152.182]) by smtp.gmail.com with ESMTPSA id v6-20020a0ce1c6000000b006418c076f59sm4308474qvl.100.2023.08.16.08.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 08:35:48 -0700 (PDT) Date: Wed, 16 Aug 2023 11:35:47 -0400 Message-Id: <87r0o3huek.fsf@gmail.com> To: control@debbugs.gnu.org From: Maxim Cournoyer Subject: control message for bug #65317 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 65317 + moreinfo quit From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 17 15:41:02 2023 Received: (at 65317) by debbugs.gnu.org; 17 Aug 2023 19:41:03 +0000 Received: from localhost ([127.0.0.1]:45658 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWire-0005Lz-2P for submit@debbugs.gnu.org; Thu, 17 Aug 2023 15:41:02 -0400 Received: from mail-ot1-x336.google.com ([2607:f8b0:4864:20::336]:52352) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qWirb-0005LR-Lx for 65317@debbugs.gnu.org; Thu, 17 Aug 2023 15:41:00 -0400 Received: by mail-ot1-x336.google.com with SMTP id 46e09a7af769-6bca66e6c44so218314a34.0 for <65317@debbugs.gnu.org>; Thu, 17 Aug 2023 12:40:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692301253; x=1692906053; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=CcGzzH4K9Z0FFOY2Aw87o9lyaopZu6eenahelcCor90=; b=kW4YZIPlqcoBC09vqy3nZg3qjRYGjzH87HN1cUp5uuxJd3F/VpGFst3OF6qJmjF7uS UmGTd+dpw0HMHiW8AlwW2F3aYAZnwtIH3Lromxqd+IOW2zq/jCCnz3oDtirdVApyM5Wu /MCnaZ/w+z/jQITAQS5ndbCpg2kZM54aHyVxqFY+bz1bEevDUG8lyx49rkF39RjfYVrC LbKqdvZGpb+nXXFezJsN7JIF998kMA0gv5tKqaF9ou3oZNmZuApj+15Ea183avX5b+Ar e9iypgjvVuaIE+nBa/A6xRcchrHlEwXsrKUHph+5bbZh6WNtc7SnXUkYy8DgtPS2SFG5 9+NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692301253; x=1692906053; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CcGzzH4K9Z0FFOY2Aw87o9lyaopZu6eenahelcCor90=; b=ewlRtDSpNt52hR/K2vwRvG77yxpAtzzNFPhNuQi4zqnwJl1MB1jTApitRS+FO+RGVM IDrsalf2VBWPMJ94OP9W2tGTdDwwtGvy7KbPtXay4RzYsx6YcX8Vv28KW/T3kaJF9VE2 lZ0YuJtjBPH2lZcxhu9NV0acgdJH8bGLBCt5VA6gxx/Hi6HLY1UAr66G8CvP+JVjVEGT 6asBuopmlG5rEJySQ0YkCNZTEhc/IASgxj2J3n43xoIFxCr9ttgzPsMRjYwQ3oU7xkCJ 1hyY3wu5H0X5eSvytF8MuAn4xiYI/HpBuDEf+wZIrIVLkTTlPJ9gEnLkR5x7jOl3U5+z qp5g== X-Gm-Message-State: AOJu0YwV1nY2yx0YdspELRa9yg9xgbr/GTHWPzPjUKnlpZTiemdQOePT orru1vDWWrfWmyynD463vUkDtZenqXU= X-Google-Smtp-Source: AGHT+IGH+cY2Pjs6fFqu8P+EhHIWrEuO+Z0zqjzNP5FAvlAGy9fBLtjKEIhQ/kn2sPm9xDQvgJIhsw== X-Received: by 2002:a9d:74ca:0:b0:6bd:680:dc13 with SMTP id a10-20020a9d74ca000000b006bd0680dc13mr309844otl.21.1692301253527; Thu, 17 Aug 2023 12:40:53 -0700 (PDT) Received: from [10.0.2.153] (c-174-51-218-141.hsd1.co.comcast.net. [174.51.218.141]) by smtp.gmail.com with ESMTPSA id l12-20020a9d734c000000b006b9cc67386fsm176317otk.66.2023.08.17.12.40.50 for <65317@debbugs.gnu.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Aug 2023 12:40:51 -0700 (PDT) Message-ID: <70b0c79d-060b-af95-d295-b23ec522b4a7@gmail.com> Date: Thu, 17 Aug 2023 13:40:50 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [bug#65317] [PATCH v2 1/1] gnu: Add go-1.21. Content-Language: en-US To: 65317@debbugs.gnu.org References: <20230815195313.46418-1-cox.katherine.e@gmail.com> <20230815232142.79498-1-cox.katherine.e@gmail.com> From: Katherine Cox-Buday In-Reply-To: <20230815232142.79498-1-cox.katherine.e@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -1.0 (-) X-Debbugs-Envelope-To: 65317 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) On 8/15/23 5:20 PM, Katherine Cox-Buday wrote: > * 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..26022ea211 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" "lib" "VERSION" "pkg/include" "pkg/tool")) We also need to install go.env here. See https://github.com/golang/go/issues/61928. There is also some new functionality outlined in the GOTOOLCHAIN environment variable that we need to consider. From https://go.dev/doc/toolchain : "The go command can use its bundled Go toolchain as well as other versions that it finds in the local PATH or downloads as needed. [...] When GOTOOLCHAIN is set to local, the go command always runs the bundled Go toolchain. [...] When using GOTOOLCHAIN=auto or GOTOOLCHAIN=+auto, the Go command downloads newer toolchains as needed. These toolchains are packaged as special modules with module path golang.org/toolchain and version v0.0.1-goVERSION.GOOS-GOARCH. Toolchains are downloaded like any other module, meaning that toolchain downloads can be proxied by setting GOPROXY and have their checksums checked by the Go checksum database. Because the specific toolchain used depends on the system’s own default toolchain as well as the local operating system and architecture (GOOS and GOARCH), it is not practical to write toolchain module checksums to go.sum. Instead, toolchain downloads fail for lack of verification if GOSUMDB=off. GOPRIVATE and GONOSUMDB patterns do not apply to the toolchain downloads." I think we should leave this set to "auto" for the following reasons: - The toolchain is now considered part of a module's dependencies, and it will be downloaded just like any other dependency. - This seems to be a major stance the Go project is taking on how things work, and if our package doesn't perform these automatic downloads it will be surprising/confusing for Go developers. - Automatic downloads do not pollute the user's path nor do they attempt to pollute the store. - When our packages are built with > 1.21.0, we'll still have reproducible builds because any modules requiring a greater versioned toolchain will fail to download it due to our isolated build container and thus the build will fail and the packager will still have to reference the correct version of Go. More details here: https://go.dev/blog/toolchain > + > + (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 From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 17 15:43:33 2023 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 To: 65317@debbugs.gnu.org Subject: [PATCH v3 1/1] gnu: Add go-1.21. 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-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 65317 Cc: Katherine Cox-Buday X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * 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 From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 13 07:13:19 2023 Received: (at 65317) by debbugs.gnu.org; 13 Nov 2023 12:13:19 +0000 Received: from localhost ([127.0.0.1]:57613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2Voc-0008Uj-VQ for submit@debbugs.gnu.org; Mon, 13 Nov 2023 07:13:19 -0500 Received: from mout02.posteo.de ([185.67.36.66]:53165) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2Voa-0008UU-Fv for 65317@debbugs.gnu.org; Mon, 13 Nov 2023 07:13:17 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 7AF13240103 for <65317@debbugs.gnu.org>; Mon, 13 Nov 2023 13:12:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1699877548; bh=nhxUBGUM6XQ9W1V1V8JXan8PV8EEuXf8Q1AAYCfE/Es=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=oVXz9wHcJiU2uosae/06voh40RqRqWXvRsOxlCJuV2dSsGHRD5/5H1o72Zbblf4Yq lcMdWB4AMWDi035DhqAVsHKaozimILtjoMZDK9FuOhRCnfJc96aNgeufAWjMWsD2Z/ aiWOrUlhqLw/JuWdQeTlEcUgXJl/Gi8Em2mN4BS+0kmkdPQ4peqGblXau6yo8g8veQ HP2+zJrrMgz3Fdj1ZOFnrgYT1bHE5Cp3S+bqxBQn+vgLHI7xmuDi9EQeznzmcSuZWo GuWIMLFeYs76RfUPo0WESGOH1XOYuaDCp/Ql96YktkXh/7x3Si4kcy+lvOy0WjIiYR i3n+S+jF17yeA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4STSwq13DFz9rxL; Mon, 13 Nov 2023 13:12:27 +0100 (CET) References: <20230815195313.46418-1-cox.katherine.e@gmail.com> <20230817194323.11985-1-cox.katherine.e@gmail.com> From: Mekeor Melire To: Katherine Cox-Buday Subject: Re: [bug#65317] [PATCH v3 1/1] gnu: Add go-1.21. Date: Mon, 13 Nov 2023 12:05:52 +0000 In-reply-to: <20230817194323.11985-1-cox.katherine.e@gmail.com> Message-ID: <87il655008.fsf@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65317 Cc: 65317@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This patch works for me: go-1.21 builds and runs fine. Let's get the patch committed! From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 22 15:24:32 2023 Received: (at 65317) by debbugs.gnu.org; 22 Nov 2023 20:24:32 +0000 Received: from localhost ([127.0.0.1]:59944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5tlv-0005hr-Bu for submit@debbugs.gnu.org; Wed, 22 Nov 2023 15:24:31 -0500 Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]:44241) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5tlt-0005hf-7d for 65317@debbugs.gnu.org; Wed, 22 Nov 2023 15:24:30 -0500 Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-548b54ed16eso262194a12.0 for <65317@debbugs.gnu.org>; Wed, 22 Nov 2023 12:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700684660; x=1701289460; darn=debbugs.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=6/XJhxWBMiZ/VuHFsvucHZo5+mB8k9gyfnGrodbo9Ig=; b=FGm8o6PkSJMlkZ6pkrblGnnFJIOFDYXw7sgC+6KZyTEOBSg20tSuIDYQBauNcYBsDs 9a+6rwXTr57k2Dv8gqY+VHvbP2QV0C45JVwm5t3IJzgHFvOFdZON4JQRTrNE9jM8oO6O dcjINPbs+NAAoxy0VhAvHV2t6sYSG3UhCjfXYJvhVidvvj2qXnrLc6Zg9W2VBwSPa3pW FsjDRGFOJEHSoTkRr4vx22/AYrzZI7GRkdvTmLYU04lxfZFXmzMs0S23mhtc/8+x5yBx 1jcNKLERhHN0FlTylBGlCAPxOT0ls1dsw7mHziMvKAfMahsZg0pj5vhzoJ7M6zGc5Qym YwdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700684660; x=1701289460; 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=6/XJhxWBMiZ/VuHFsvucHZo5+mB8k9gyfnGrodbo9Ig=; b=aBpycm3MgHXtcmiqgxrLWx44HmTeTk8K6CxiVtX8rI3A7OhdzVifXMtS4BDh0Btiiw FyOZ9ZA65sFnd3/FlD6pSPVwoM2Z+UpndWMihWKAvsazAEQqyvvYv/Y3ZBQQkRKunsSp rQf84JLRCSfLC451vRDx44hmIBBOhMuuKReF6fBZTB2NavI1NhDTxN4rGo7S7rcHo36y fDTdS8N3q4g/SMJAxmXGVIWFZBWKkq3OA1Km051GZwZcPHx38EaleOsyp3a5bGSEIxxf ojEd8AXJvlTyrvFoOd48QlygOyKlyHjeuEBI56jzHHQJartgGj1kckhlpCe+3NnZQsqg Niqw== X-Gm-Message-State: AOJu0YzDKwzZOAuPXZEUMkKBwJjgHHudgjMhg5FSVZFfKIWDN9WJtn2N vZw+BEpptHfx2RnOUUPHZwCb4nFJows= X-Google-Smtp-Source: AGHT+IHJe+J+tCOB3GvigVXghJIKyvk1x7DcBbjJJLfd/A5gpbj/W2CC5qoKuIIwbfeE+MYEPSAXlw== X-Received: by 2002:a50:fe92:0:b0:541:29c8:9575 with SMTP id d18-20020a50fe92000000b0054129c89575mr2597226edt.28.1700684659570; Wed, 22 Nov 2023 12:24:19 -0800 (PST) Received: from localhost (87-97-122-20.pool.digikabel.hu. [87.97.122.20]) by smtp.gmail.com with ESMTPSA id w25-20020aa7cb59000000b0054879002b6csm155404edt.84.2023.11.22.12.24.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 12:24:18 -0800 (PST) From: =?UTF-8?q?V=C3=96R=C3=96SK=C5=90I=20Andr=C3=A1s?= To: 65317@debbugs.gnu.org Subject: [PATCH] gnu: Add go-1.21. Date: Wed, 22 Nov 2023 21:21:49 +0100 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Debbugs-Cc: Katherine Cox-Buday Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65317 Cc: Katherine Cox-Buday X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) From: Katherine Cox-Buday * gnu/packages/golang.scm (go-1.21): New variable. Change-Id: I7c06319c3a8a39c4d6d08964d5e1b848827f6ea0 --- Just updated to 1.21.4 and added std definition gnu/packages/golang.scm | 133 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 9c707e5414..28d8d3d248 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -969,6 +969,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.4") + (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 + "0xp1mqjbbs53bjg00d4a37af5p1by28xnflj2xi5kchcpmlqn5nz")))) + (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 @@ -1011,6 +1143,7 @@ (define-public go-std-1.17 (make-go-std go-1.17)) (define-public go-std-1.18 (make-go-std go-1.18)) (define-public go-std-1.19 (make-go-std go-1.19)) (define-public go-std-1.20 (make-go-std go-1.20)) +(define-public go-std-1.21 (make-go-std go-1.21)) (define-public go-0xacab-org-leap-shapeshifter (let ((commit "0aa6226582efb8e563540ec1d3c5cfcd19200474") base-commit: b150c546b04c9ebb09de9f2c39789221054f5eea -- 2.41.0 From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 31 15:45:54 2023 Received: (at 65317-done) by debbugs.gnu.org; 31 Dec 2023 20:45:55 +0000 Received: from localhost ([127.0.0.1]:47107 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rK2h0-0004re-BH for submit@debbugs.gnu.org; Sun, 31 Dec 2023 15:45:54 -0500 Received: from mail-4316.protonmail.ch ([185.70.43.16]:35685) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rK2gy-0004fB-2X for 65317-done@debbugs.gnu.org; Sun, 31 Dec 2023 15:45:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1704055544; x=1704314744; bh=aeh3euNjwv1pQ3MSLhHbHRp12sKCBrHO2Mrn8MdZ88g=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=GEzpMVCREiJfKGaZfLB4CfC/BRhMRSHkHLvb8NXMVjYl/Og3/xyTx45yO7fHohwWB 4qEHTaUxyfeG0Ko8Orl0nmyZljbKQp/1N8VzU1XkvG5smB9oUlGOy5hsfSXkVxRBBu PDtMIOSkH89Fl/i9hjRzTNgXIwG1ciqBmHODb9It4Cn7YTKNBVnnQHOm3xGEpqKooy IBZjwiDxf4zM79JgShtST0N0U6oTGs2UPQK+nrSxo9eE8n9Hv6c08JsXi0xYuk59nn KvU+8qglIiBZ8GzVjJeojLuoVz3g4kKuEwgvHmxQdVcdCJ0Ao0h4O7gYcwCQDuuMlr 5+6uhEr8aZNiA== Date: Sun, 31 Dec 2023 20:45:20 +0000 To: =?utf-8?B?VsOWUsOWU0vFkEkgQW5kcsOhcw==?= , Katherine Cox-Buday , Katherine Cox-Buday From: John Kehayias Subject: Re: [bug#65317] [PATCH] gnu: Add go-1.21. Message-ID: <87ttnyp0de.fsf@protonmail.com> Feedback-ID: 7805494:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 65317-done Cc: 65317-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi all, On Wed, Nov 22, 2023 at 09:21 PM, V=C3=96R=C3=96SK=C5=90I Andr=C3=A1s wrote= : > From: Katherine Cox-Buday > > * gnu/packages/golang.scm (go-1.21): New variable. > Thanks for your patience and hard work here Katherine! I'm no expert on go but the packaging (and helpful comments!) looked good to me and it built and ran locally. I just did a minor reformatting of a comment or two and (finally!) pushed as 37c33eb0d4f0baecd5f7c7b251b32f78fcfa6641 Thanks again! > Change-Id: I7c06319c3a8a39c4d6d08964d5e1b848827f6ea0 > --- > > Just updated to 1.21.4 and added std definition > I split off the adding of the standard library as c314115dd054c000116dfc4a75df8e1a5e56e715 and gave a co-author line to Andr=C3=A1s, thanks for the contribution! While I saw go has 1.21.5 and so I tested that it built locally and pushed that update as 19f5302d136783d861b42107ae5e2920bbd769d9. Thanks again everyone! John From unknown Sun Jun 22 11:35:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 29 Jan 2024 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator