shithub: docs.9front.org

Download patch

ref: f0cd86b36645450066044b0601f2eb6ed7b04339
parent: da7049fa562890ae2a49bbfdccd0e0274475649f
author: Moody <j4kem00dy@gmail.com>
date: Sat Aug 8 14:09:01 EDT 2020

Add instructions for building golang from source using 9legacy bootstraps

--- /dev/null
+++ b/building-go.md
@@ -1,0 +1,31 @@
+Building Go from source on 9front
+=================================
+
+For building go on 9front its best to leverage ramfs for faster build times.
+It also is reccomended to use the 9legacy bootstrap tars if you lack an existing installation.
+
+First start by downloading and extracting the tar balls:
+
+	ramfs
+	cd /tmp
+	hget http://www.9legacy.org/download/go/go1.14.1-plan9-amd64-bootstrap.tbz | bunzip2 -c | tar x
+	hget https://golang.org/dl/go1.14.7.src.tar.gz | gunzip -c | tar x
+
+Now we will need a place that we want to be our GOROOT, something like /sys/lib/go/amd64-1.14.7 will work.
+Create the destination dir and bind our go source dir in /tmp over it.
+
+	mkdir -p /sys/lib/go/amd64-1.14.7
+	bind -c go /sys/lib/go/amd64-1.14.7
+	# change directories to the new location so GOROOT gets set properly when building
+	cd /sys/lib/go/amd64-1.14.7/src
+	GOROOT_BOOTSTRAP=/tmp/go-plan9-amd64-bootstrap
+	build.rc
+
+After building the tree in /tmp needs to be copied in to the right location.
+
+	unmount /sys/lib/amd64-1.14.7
+	dircp /tmp/go /sys/lib/amd64-1.14.7
+	unmount /tmp
+	# You could also bind the binaries in if you choose
+	cp /sys/lib/amd64-1.14.7/bin/* /amd64/bin
+