Skip to content

Port to plan9 (386, amd64, arm) - #855

Merged
tannevaled merged 3 commits into
mainfrom
plan9-port
Nov 1, 2026
Merged

tannevaled merged 3 commits into
mainfrom
plan9-port

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Summary

Ports rbgo to plan9 (386, amd64, arm), the last go tool dist list target it did not compile for. GOOS=plan9 go vet ./... passes for all three, for both the default and rbgo_core builds. Refs #832 (closed after the release is verified).

Bibliography opened: syscall/errors_plan9.go, syscall/syscall_plan9.go (ErrorString.Is, Errno, Note), os/error_plan9.go, os/exec_plan9.go, os/user/lookup_plan9.go and syscall/dir_plan9.go in go1.27.3; errno.go's own account of MRI's Init_syserr (undefined_error, set_syserr).

  • Errno: Plan 9 errors are strings. Errno::X::Errno takes the Linux value and the message glibc's wording (MRI's fallback for a name the platform lacks). A failed call is mapped to a class by the stdlib's own rules (syscall.ErrorString.Is, os/error_plan9.go), exact syscall texts first. An unrecognised string stays a plain SystemCallError with its message. The table and rules are pure Go in a tag-free file, with a unit test that runs on every platform (including a check that the Linux table has exactly the host's names, and the host's values on Linux).
  • Process / IO: Process.kill writes a note via os.(*Process).Signal; getrlimit and the other POSIX process calls and File#flock raise NotImplementedError; File::Stat from syscall.Dir; File.utime/lutime, umask, PStore lock and subprocess (/bin/rc -c) seams.
  • Gems: nats.go, franz-go and apache/thrift (via parquet) do not build; NATS, Kafka and Parquet become graceful modules (as the store gems did in v0.8.3). gopher-lua is test-only (miniredis); those tests are skipped on plan9.
  • CI: plan9 added to compile on every target. No lane runs anything on a Plan 9 kernel; the README says so.
  • No behaviour change elsewhere: call sites that used syscall.Errno directly go through errnoOfError / errIsErrno, which are the same errors.As / errors.Is on every other platform.

Test plan

  • GOOS=plan9 GOARCH={386,amd64,arm} go vet ./...
  • GOOS=plan9 go vet -tags rbgo_core ./... (amd64)
  • full suite, -race, 100% coverage on linux and macOS (CI)

🤖 Generated with Claude Code

tannevaled and others added 3 commits November 1, 2026 03:51
Plan 9's syscall package has no errno numbers, no Kill, Flock, Getrlimit,
Stat_t or Umask, and four gem drivers do not build there. This adds the
plan9 variants of every seam so `GOOS=plan9 go vet ./...` passes for 386,
amd64 and arm.

- Errno: Linux numbers and glibc strerror text on plan9 (the MRI
  undefined-name fallback), and a pure-Go string classification built
  from the Go standard library's own rules (syscall.ErrorString.Is,
  os/error_plan9.go), unit-tested on every platform.
- Process.kill writes a note through os.(*Process).Signal; getrlimit and
  the other POSIX process calls raise NotImplementedError; File#flock
  raises NotImplementedError; File::Stat comes from syscall.Dir.
- nats, kafka and parquet (nats.go, franz-go, apache/thrift do not build)
  become graceful modules: require works, the first operation raises
  NotImplementedError.

Refs #832

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
plan9 joins the "compile on every target" matrix (vet, default and rbgo_core,
for 386, amd64 and arm). The README states what works on plan9 and what
raises, and that no CI lane runs anything on a Plan 9 kernel.

Refs #832

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
errnoStrerror takes its starting text from errnoGoText (Go's own on every
platform, glibc's table on plan9) instead of a platform branch that no host
test could reach.

Refs #832

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant