An experimental port of Go is available for the Plan 9 from Bell Labs operating system.
The Plan 9 port of Go is available for the following architectures:
- 386
- amd64
- arm
The current Go distribution has been tested successfully on:
- Plan 9 from Bell Labs (386 and arm) kernel
- 9front amd64 kernel
- Charles Forsyth's 9k (amd64) kernel
Plan 9 requires a kernel providing the following system calls:
- tsemacquire (available since 2012-06-30)
- nsec (available since 2014-05-15)
A fix to the pread system call is required, so pread will not update the channel offset when reading a file:
The TCP connection control file must handle the "close" message to be able close a TCP connection gracefully, while waking up the readers:
A fix to Fossil is required to increment Qid.vers after a wstat, so a truncate followed by a read will return the content of the new file instead of the cached content.
You will need support for SHA-2 signatures in X.509 certificates, so you could download sources from repositories hosted on GoogleSource, GitHub and so on.
If you're running Plan 9 on Raspberry Pi, you'll require the latest bcm kernel from Richard Miller.
Since Go is written in Go, you may want to bootstrap Go with Go 1.4.3, which is the latest release of Go written in C.
However, since the Go 1.4 runtime wasn't mature enough on Plan 9, we recommend you to bootstrap from a more recent version of Go, using another operating system.
First, install Go 1.4:
cd /tmp
git clone -b go1.4.3 https://go.googlesource.com/go go1.4
cd go1.4/src
hget http://9legacy.org/go/patch/syscall-exec.diff | ape/patch -p2
make.rc
The syscall-exec patch is required if you're running a machine with SMP enabled.
Then, set the GOROOT_BOOTSTRAP
environment variable:
GOROOT_BOOTSTRAP=/tmp/go1.4
Finally, install the latest version of Go:
cd /tmp
git clone https://go.googlesource.com/go
cd go/src
all.rc
bind -a /tmp/go/bin /bin
Go is now ready to use.
First, you must have installed Go on this operating system, following the Go installation instructions.
Then, you can cross-compile a Go toolchain for Plan 9:
cd $GOROOT/src
GOOS=plan9 GOARCH=386 ./bootstrap.bash
Then, the bootstrap toolchain will be available in ../../go-plan9-386-bootstrap.tbz
.
Finally, you can extract this archive to your Plan 9 machine.
For example:
cd /tmp
tar xzf go-plan9-386-bootstrap.tbz
bind -a /tmp/go-plan9-386-bootstrap/bin /bin
Go is now ready to use.
You'll be able to use this installation of Go to bootstrap future Go releases, by setting the GOROOT_BOOTSTRAP
environment variable:
GOROOT_BOOTSTRAP=/tmp/go-plan9-386-bootstrap
A binary package for plan9/386 is available.
This binary package is used to bootstrap Go on the plan9/386 builder.
cd /tmp
hget -o gobootstrap-plan9-386.tar.gz https://storage.googleapis.com/go-builder-data/gobootstrap-plan9-386.tar.gz
mkdir gobootstrap-plan9-386
cd gobootstrap-plan9-386
tar xzf ../gobootstrap-plan9-386.tar.gz
You'll be able to use this binary package of Go to bootstrap Go, by setting the GOROOT_BOOTSTRAP
environment variable:
GOROOT_BOOTSTRAP=/tmp/gobootstrap-plan9-386
Git is not available on Plan 9. However a Git wrapper is available as a simple rc script. It includes everything you need to use the go tool.
Three Plan 9 builders are currently running and reporting the results to the Go Dashboard:
- plan9-386 is running Plan 9 from Bell Labs (386 kernel) on Google Compute Engine (new-style builder)
- plan9-arm is running Plan 9 from Bell Labs (arm kernel) on a Raspberry Pi 3 (old-style builder)
- plan9-amd64-9front is running 9front (amd64 kernel) on a virtual machine (old-style builder)
The Plan 9 port of Go is considered experimental and is still a work-in-progress. There is a number of known issues available on the Go issue tracker.
Many issues are currently open on the Go issue tracker with the OS-Plan9 label.
The Plan 9 port of Go is a community-driven port. Any help to improve the Go port on Plan 9 would be highly appreciated.
Many people have contributed to the Plan 9 port of Go. Since December 2013, the Plan 9 port of Go is maintained by David du Colombier.