From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id iAZvG65jXmVfVAAAG6o9tA:P1 (envelope-from ) for ; Wed, 22 Nov 2023 21:25:18 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iAZvG65jXmVfVAAAG6o9tA (envelope-from ) for ; Wed, 22 Nov 2023 21:25:18 +0100 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 F23935D882 for ; Wed, 22 Nov 2023 21:25:17 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=FGm8o6Pk; 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=1700684718; 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=6/XJhxWBMiZ/VuHFsvucHZo5+mB8k9gyfnGrodbo9Ig=; b=Z2GB971e+7GrusrX+xq2vtvubyuKI5w5ZNUWLK8iTrSHMykRCh55q4ILZnLsH4/Q0pkNKp YkNiyN5SY6tks8X4crMiG59lixtxCbov+RNvrlz0K59WU8K0rGtJ/nC4TG67MMXgOoS2mR BU1o0//NgThpierNz/ogRH6UfRnO85QlxdZnjT4Ahz+6FZR5FlAxSZc6rM6+lkj6ScuBIl hO+Kj/8lYzDnAGbWxe+dAqHuucxnvHrWkOgUQvmqWXNwgA6UGI8l396wzRjONwYPL3TBd7 9JuIylSQFtbcxe96jmg/QUr8AuycmorxQUjRNPYLSZqD8iSY0prlVHRw9CbnEg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=FGm8o6Pk; 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=1700684718; a=rsa-sha256; cv=none; b=MJaNjwLDMz5nY0IiK6t73ZxKRRYZkw771/dKcL5Ets22pT+CEcackNTchMUlpDajYyUDzH bZ+viwSCIogbPz5PpH+2OQRsMRO4araN15xg08SFTDa5cIqv0fD4BuBDHMzNZ4U7uSI+9Z rxCx9jIsV08U1L1RHgY5PyP8CUy0qY0bYXs/LK/8hv9rkX5EZWOyy+ZJaDP5+RKh5AecsB bVbSSaYDOo03iWnRE7dTf1TCfRhn78ErgBW6DW+B5n2LLTp2Ryo2kMj15GTpaoAFR5LM8O +jgiYqTZsgOMO2SMsfFxElZK6QquAKB/fkH+9M8RAN8lQT1aHhRKenzkbkmrHg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5tmN-0005ou-U4; Wed, 22 Nov 2023 15:24:59 -0500 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 1r5tmN-0005oe-47 for guix-patches@gnu.org; Wed, 22 Nov 2023 15:24:59 -0500 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 1r5tmM-0001cQ-SW for guix-patches@gnu.org; Wed, 22 Nov 2023 15:24:58 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5tmP-0005im-Uq; Wed, 22 Nov 2023 15:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#65317] [PATCH] 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: =?UTF-8?Q?V=C3=96R=C3=96SK=C5=90I_?= =?UTF-8?Q?Andr=C3=A1s?= Original-Sender: "Debbugs-submit" Resent-CC: cox.katherine.e+guix@gmail.com, guix-patches@gnu.org Resent-Date: Wed, 22 Nov 2023 20:25: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 , Katherine Cox-Buday X-Debbugs-Original-Xcc: Katherine Cox-Buday Received: via spool by 65317-submit@debbugs.gnu.org id=B65317.170068467221944 (code B ref 65317); Wed, 22 Nov 2023 20:25:01 +0000 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_?= =?UTF-8?Q?Andr=C3=A1s?= Date: Wed, 22 Nov 2023 21:21:49 +0100 Message-ID: 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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.52 X-Spam-Score: -3.52 X-Migadu-Queue-Id: F23935D882 X-Migadu-Scanner: mx10.migadu.com X-TUID: dAqnfLZBgTIx 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