Github messages for voidlinux
 help / color / mirror / Atom feed
From: fosslinux <fosslinux@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Go 1.4 bootstrap
Date: Sat, 05 Dec 2020 03:36:04 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26953@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

There is a new pull request by fosslinux against master on the void-packages repository

https://github.com/fosslinux/void-packages go-bootstrap
https://github.com/void-linux/void-packages/pull/26953

Go 1.4 bootstrap
This PR reintroduces the C Go bootstrap for supported architectures, which was removed over a year ago.

**Why use the C Go bootstrap:**

- Allows Go to be bootstrapped without a pre-existing version of Go.
- Doesn't require gcompat on musl, which is often buggy.
- Allows for flexibility in the way the binaries are used in the bootstrap.
- https://bootstrappable.org

Furthermore, this doesn't drop any architecture support, as architectures that were not supported by Go 1.4 (namely, ppc) can still be bootstrapped via binaries.

@q66 Can you check this still works on ppc?
@the-maldridge maintainer

A patch file from https://github.com/void-linux/void-packages/pull/26953.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-go-bootstrap-26953.patch --]
[-- Type: text/x-diff, Size: 3885 bytes --]

From fd6e5c33ba4e0e7b5cff749bb464fd29d0897fa3 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sat, 5 Dec 2020 13:25:41 +1100
Subject: [PATCH 1/2] New package: go1.4-bootstrap-20171003.

---
 srcpkgs/go1.4-bootstrap/INSTALL.msg |  4 +++
 srcpkgs/go1.4-bootstrap/template    | 39 +++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+)
 create mode 100644 srcpkgs/go1.4-bootstrap/INSTALL.msg
 create mode 100644 srcpkgs/go1.4-bootstrap/template

diff --git a/srcpkgs/go1.4-bootstrap/INSTALL.msg b/srcpkgs/go1.4-bootstrap/INSTALL.msg
new file mode 100644
index 00000000000..142aeabbc1b
--- /dev/null
+++ b/srcpkgs/go1.4-bootstrap/INSTALL.msg
@@ -0,0 +1,4 @@
+This is a copy of the official Go language toolchain binaries as provided by
+the project on its download page. Please do keep in mind that it is almost
+definitely not what you want to use and exists purely for the purpose of
+bootstrapping the official compiler package (called simply 'go').
diff --git a/srcpkgs/go1.4-bootstrap/template b/srcpkgs/go1.4-bootstrap/template
new file mode 100644
index 00000000000..fd12cd3825b
--- /dev/null
+++ b/srcpkgs/go1.4-bootstrap/template
@@ -0,0 +1,39 @@
+# Template file for 'go1.4-bootstrap'
+pkgname=go1.4-bootstrap
+version=20171003
+revision=1
+archs="x86_64* i686* aarch64* armv[67]l*"
+wrksrc="go"
+short_desc="Go Programming Language 1.4 bootstrap package"
+maintainer="fosslinux <fosslinux@aussies.space>"
+license="BSD-3-Clause"
+homepage="https://golang.org/doc/install/source"
+distfiles="https://dl.google.com/go/go1.4-bootstrap-${version}.tar.gz"
+checksum=f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52
+nostrip=yes
+noverifyrdeps=yes
+
+case "${XBPS_TARGET_MACHINE}" in
+	aarch64*) GOARCH=arm64 ;;
+	arm*) GOARCH=arm ;;
+	i686*) GOARCH=386 ;;
+	x86_64*) GOARCH=amd64 ;;
+	*) broken="Unsupported architecture ${XBPS_TARGET_MACHINE}" ;;
+esac
+export GOARCH
+
+do_build() {
+	unset GCC CC CXX LD LDFLAGS
+	unset CGO_CXXFLAGS CGO_CFLAGS CGO_ENABLED
+
+	cd src
+	CGO_ENABLED=0 GOROOT="${PWD}" GOROOT_FINAL="/usr/lib/go1.4" ./make.bash
+}
+
+do_install() {
+	vmkdir usr/lib/go1.4
+	vcopy bin usr/lib/go1.4
+	vcopy src usr/lib/go1.4
+	vcopy pkg usr/lib/go1.4
+	vlicense LICENSE
+}

From fd811f2af1a907fa20eeda1390fb24ba351fbb33 Mon Sep 17 00:00:00 2001
From: fosslinux <fosslinux@aussies.space>
Date: Sat, 5 Dec 2020 13:26:05 +1100
Subject: [PATCH 2/2] go: use go1.4-bootstrap where possible.

---
 srcpkgs/go/template | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/go/template b/srcpkgs/go/template
index 977c87da8d0..54f6e7a46b7 100644
--- a/srcpkgs/go/template
+++ b/srcpkgs/go/template
@@ -4,7 +4,6 @@ version=1.15.5
 revision=1
 create_wrksrc=yes
 build_wrksrc=go
-hostmakedepends="go1.12-bootstrap"
 short_desc="Go Programming Language"
 maintainer="Michael Aldridge <maldridge@voidlinux.org>"
 license="BSD-3-Clause"
@@ -24,6 +23,19 @@ case "${XBPS_TARGET_MACHINE}" in
 	*) broken="Unsupported architecture ${XBPS_TARGET_MACHINE}" ;;
 esac
 
+_src_bootstrap=0
+case "${XBPS_MACHINE}" in
+	aarch64*) _src_bootstrap=1 ;;
+	arm*) _src_bootstrap=1 ;;
+	i686*) _src_bootstrap=1 ;;
+	x86_64*) _src_bootstrap=1 ;;
+esac
+if [ "${_src_bootstrap}" = "1" ]; then
+	hostmakedepends="go1.4-bootstrap"
+else
+	hostmakedepends="go1.12-bootstrap"
+fi
+
 if [ "$CROSS_BUILD" ]; then
 	if [ "${XBPS_MACHINE%%-musl}" = "${XBPS_TARGET_MACHINE%%-musl}" ]; then
 		broken="Cross-compiling to different libc is not supported"
@@ -36,7 +48,11 @@ do_build() {
 	# dependency
 	unset CGO_CXXFLAGS CGO_CFLAGS CGO_ENABLED
 
-	export GOROOT_BOOTSTRAP="/usr/lib/go1.12"
+	if [ "${_src_bootstrap}" = "1" ]; then
+		export GOROOT_BOOTSTRAP="/usr/lib/go1.4"
+	else
+		export GOROOT_BOOTSTRAP="/usr/lib/go1.12"
+	fi
 	export GOROOT=$PWD
 	export GOROOT_FINAL="/usr/lib/go"
 	export GOARCH=${_goarch}

             reply	other threads:[~2020-12-05  2:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05  2:36 fosslinux [this message]
2020-12-05  4:05 ` q66
2020-12-30  6:49 ` the-maldridge
2020-12-30  6:49 ` [PR PATCH] [Closed]: " the-maldridge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26953@inbox.vuxu.org \
    --to=fosslinux@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).