summaryrefslogtreecommitdiff
path: root/pim/doc/gotchas.md
diff options
context:
space:
mode:
authorCalvin Morrison <calvin@pobox.com>2026-08-22 13:16:49 -0400
committerCalvin Morrison <calvin@pobox.com>2026-08-22 13:16:49 -0400
commit8a3d2c99bff60cb775ebc42516c0c3912d54ba3d (patch)
treefd136a3b7927146763cdc11e6be07c71f92bb92c /pim/doc/gotchas.md
parent9aacce8b3b54060d0037eca897856d7273e6e5e8 (diff)
pim: personal information management, starting with a calendar
A calendar as a file tree, and tools that only know the tree: events/date/yyyy/mm/dd/hhmm-summary as lived events/uuid/<uid>/ as stored ctl query alarm changed lib/cal owns all of that. A backend supplies events and, where its protocol allows, takes changes back -- six methods. cmd/icalfs is the first: it reads .ics files from a directory and nothing else, because fetching is rc/fetch's job and hget already exists. That keeps net/http out of the binary and makes a subscribed calendar and a local one the same thing. The tools are rc on purpose. If the tree needs a compiled program to be useful, the tree is the wrong shape. Three things were added to the tree because the rc port needed them: a path from an occurrence to its event, epoch seconds beside RFC3339, and a numeric slot for all-day events so test(1) can compare it. ctl reports caps, so a tool can say "read only" instead of trying and failing. A published .ics is read only: nowhere to PUT, and no METHOD:REQUEST to reply to. CalDAV would be read write rsvp schedule, and that is the next backend. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'pim/doc/gotchas.md')
-rw-r--r--pim/doc/gotchas.md62
1 files changed, 62 insertions, 0 deletions
diff --git a/pim/doc/gotchas.md b/pim/doc/gotchas.md
new file mode 100644
index 0000000..cc3892a
--- /dev/null
+++ b/pim/doc/gotchas.md
@@ -0,0 +1,62 @@
+# Go on 9front
+
+All verified on `lab.qcow2`, not inferred.
+
+## Go 1.24.x is broken on plan9/amd64
+
+Every binary dies before `main`:
+
+ M structure uses sizeclass 1792/0x700 bytes; incompatible with mutex flag mask 0x3ff
+ fatal error: runtime.m memory alignment too small for spinbit mutex
+ runtime.lockVerifyMSize() lock_spinbit.go:97
+
+The spinbit mutex landed in 1.24 and `runtime.m` falls in a sizeclass that
+cannot meet its alignment. Tested: **1.23.11 ok, 1.24.4 broken, 1.25.14 ok,
+1.27.0 ok**. The host's installed Go is 1.24.4 -- precisely the broken one --
+so `mk.sh` pins `GOTOOLCHAIN=go1.27.0`.
+
+## TLS needs a CA bundle you supply
+
+Go's x509 looks only at `/sys/lib/tls/ca.pem` on plan9, and 9front ships
+none:
+
+ SystemCertPool ERR: open /sys/lib/tls/ca.pem: file does not exist
+
+Copy any bundle there and HTTPS works -- verified TLS 1.3 with full cert
+verification. Already installed on `lab.qcow2`.
+
+## Networking is /net, not a helper program
+
+Go opens `/net/tcp/clone`, writes `connect`, and resolves through
+`/net/cs` and `/net/dns` (`net/fd_plan9.go`, `net/ipsock_plan9.go`). No
+`exec.Command`, no webfs. It is what `dial(2)` does.
+
+## No native graphics yet
+
+`9fans.net/go/draw` is a complete libdraw port and *builds* for
+`GOOS=plan9`, but at runtime it does
+
+ cmd := exec.Command(devdraw, os.Args[0], "(devdraw)")
+
+which is plan9port's helper. 9front has no `devdraw`. A native transport
+means opening `/dev/draw` and reading `/dev/mouse`, `/dev/kbd` -- plain
+file I/O, no cgo, a few hundred lines under an already-complete library.
+Nobody has written it.
+
+## Building
+
+Cross-compile from Linux; do not put a toolchain on the guest. A native
+plan9/amd64 toolchain builds fine via `bootstrap.bash` (needs a bootstrap
+Go >= 1.24.6), but it is 249MB unpacked -- `compile` alone is 27MB --
+against a 3MB `ical/fs`.
+
+Getting binaries in, with an HTTP server on the host:
+
+ hget http://10.0.2.2:8099/fs > /tmp/icalfs # qemu user-net host
+
+## The guest clock is skewed by the host's timezone
+
+`run.sh` passes `-rtc base=localtime`, so the guest's idea of *UTC* equals
+the host's *local* time. With the host on EDT the guest is 4h behind real
+UTC. Anything time-sensitive must be generated in the guest's frame --
+take `date -n` from the guest, not from the host.