Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Go on Harvey

Fazlul Shahriar edited this page Feb 19, 2021 · 7 revisions

Go programming language in Harvey

The Go wiki has some documentation on Plan 9 support: https://github.com/golang/go/wiki/Plan9

Pre-build binaries

Binaries can be downloaded from http://9legacy.org/download.html and https://github.com/fhs/go-plan9-binaries/releases

Building from source

Bootstrapping Go

For now, we must use another operating system to have Go working on Harvey, as we do with normal C programs compiling in Linux and running in Harvey. So let's go to install Go first in Linux, if you use any other OS supported by Go, pay attention to instructions for your platform.

For Go 1.5 and later you need a go install to bootstrap the go compiler written in go.

mkdir go1.4
cd go1.4
git clone [email protected]:golang/go.git go
cd go/src
git checkout release-branch.go1.4
bash make.bash

Building Go for Harvey

Now make a dir for Go 1.5 for Harvey:

mkdir go1.7
export GOROOT_BOOTSTRAP=~/go1.4/go
cd go1.7
git clone [email protected]:Harvey-OS/go
cd go/src
git checkout plan9port
GOOS=plan9 bash make.bash

And you have Go ready for building programs for Harvey or for building Go itself in Harvey. Just move to the place where your Go program is:

GOOS=plan9 /where-go-is/bin/go build 

or whatever.go if you just want to do one file. And you can run it on harvey.

We usually drawterm in to Harvey for having all files there, and usually doing:

bind /mnt/term/home /home

so all paths work.