Development
nix develop # pinned Go, gopls, golangci-lint, just, sway; CGO_ENABLED=0
just demo # the lys-ui-hello showcaseGates
just fmt-check # gofumpt and gci formatting
just check # go vet, golangci-lint, go test, build
just race # the suite under the race detector
just gpu # the GPU renderer's tests on lavapipe
just headless # the compositor-in-the-loop suite on a private headless sway
just atspi # the AT-SPI bridge on a private accessibility bus
just atspi-verify # the bridge against real at-spi2-core
just demos-package # the demos and the headless clients as Nix builds themThe same compositor-in-the-loop suite runs against Hyprland in just checks shell-hyprland-vms (needs KVM): one NixOS VM boot that tests the shell on Hyprland, then hands the outputs to a Hyprland of the suite's own.
just docker <recipe> runs a recipe in a container that sees only the dev shell's store paths, the checkout, its own Go caches, /dev/kvm and the GPU render and driver nodes. It has no DRM card nodes, host runtime dir, session bus or display socket. just docker race 16g raises its memory cap.
| Recipe | Does |
|---|---|
just bench | runs the benchmarks (bench/baseline.md has the method and the allocation budgets the tests enforce) |
just goldens | regenerates the golden-image snapshots |
just gallery | opens the gallery |
just docshots ../docs/public/ui-widgets | screenshots every widget for the widgets page; without the argument the shots go to ui/docs/public/components, which the site does not read |
Test isolation
A package whose tests build applications or dial a bus runs under lys-lib's testhome (TestMain calls testhome.Run): HOME and the XDG directories point at a scratch directory, the session bus, the system bus and the sound server at sockets in it that nothing serves, and every variable naming a compositor or display is unset. A test that needs a bus, a compositor or a sound server starts its own (dbustest, wltest, pulsetest). Each such package has a test calling testhome.RequireNoHostSession, which fails when the process could reach the session of whoever runs it.
A recipe that boots a session for the tests (just headless, the Hyprland VM gate) names it: LYS_TEST_SESSION is that session's runtime directory. The session then stays in place, and the guard holds the runtime directory, the buses, the sound server and the display to exactly that directory or the scratch home, wherever it lies. In the VM it is /run/user/1000, which on a developer's machine would be the desktop's; only the name tells the two apart.
Tests in package app build applications with NewTestApplication, which closes them when the test ends; a test there calling NewApplication itself fails TestEveryTestApplicationIsBuiltToBeClosed.
Dependencies
Pure Go, no cgo. Besides lys-lib, lys-ui imports stubbedev/memory-go, golang.org/x/image and golang.org/x/sys.
lys-lib adds ebitengine/purego, kettek/apng, rivo/uniseg, golang.org/x/net and golang.org/x/text. Its third_party directory holds patched copies of neurlang/wayland, godbus/dbus, go-text/typesetting, srwiley/oksvg, srwiley/rasterx, golang.org/x/image/vector, the portable parts of Go's math, and the Vulkan bindings of gogpu/wgpu.
Found at runtime:
libvulkan, opened through purego by the GPU renderer. Without it, windows draw on the CPU, andmedia.OpenFile's video, which decodes on the renderer's Vulkan video queue, does not play.