bootstrapping the latest go on 9front

the latest go seems to work great on 9front! I found it slightly tricky to figure out how to install the toolchain, but it ended up being very simple overall.

go can very easily cross-compile to another operating system, so I started from my linux machine with go already installed. I cloned the repository, checked out the go1.26.3 tag, and ran GOOS=plan9 ./make.bash in the src directory.

once built, binaries are left in the bin directory. the binaries for the target system are left in plan9_amd64 (or whatever your target architecture may be), and I just moved them to the root of the bin dir so that it would use the plan 9 versions on the 9front side.

I cloned the repository in 9front. I couldn’t figure out how to check out a tag, but I was able to run git/branch release-branch.go1.26 to switch to the release. it is important to use a release version because otherwise, it attempts to perform git incantations to generate a version string and fails.

with GOROOT_BOOTSTRAP=/mnt/term/<path to go repository>, I ran ./make.rc, and the go toolchain was successfully bootstrapped. I added the following lines to my /lib/profile:

GOROOT=/lib/go # or wherever you put it
bind -qa $GOROOT/bin /bin
go expects to find CA certificates at /sys/lib/tls/ca.pem. 9front does not come with any CA certificates, but I was able to just copy them from my linux system.

cp /mnt/term/etc/ssl/certs/ca-certificates.crt /sys/lib/tls/ca.pem