Remove the Rust host (host-wasm)
CI / test (push) Canceled after 0s

The MoonBit host (wasmhost/, build/wasmhost) is the only host now. Gone:
host-wasm/ (Rust on the wasmtime crate, ~5,700 lines incl. Cargo.lock),
the run-rust, run-drm-rust and host-wasm recipes, and `just install --rust`
(both the recipe and session/install.py now stop with an error naming the
removal instead of quietly ignoring the flag). remote-build.sh builds and
pulls build/wasmhost. README, wasmhost/README and docs no longer describe a
second host, apart from short history notes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DPL5hiBxpbLoeUM9xfZayq
This commit is contained in:
Claude committed 2026-11-26 04:19:19 +00:00
1 parent 024f18ce61
commit 41c6ec1135
31 files changed
+59 -5827

No files matched your search

+4 -4
View File
@@ -219,7 +219,7 @@ using the **same WIT and the same build outputs** (the components are standard;
only `host/` changes), then (c) from M5 as the path to real windows. The WIT stays
host-agnostic: nothing in `wit/` mentions JS, a browser or a window system. What
does **not** transfer is `host/src/desktop.mjs`; it is intentionally small
(~200 lines) and is the executable spec for the Rust host.
(~200 lines) and was the executable spec for the native host (now the MoonBit `wasmhost/`).
## 9. Interface catalogue
@@ -255,8 +255,8 @@ Designed next (no WIT yet): `window-registry`/`wm-policy`/`decoration`, `search-
## 11. Roadmap
> Status as of 2026-11-25: M0 is done; the native host (M3) exists as the MoonBit wasmhost
> (default) and the Rust host-wasm; the compositor hosts real Wayland clients (M5, in MoonBit
> Status as of 2026-11-26: M0 is done; the native host (M3) is the MoonBit wasmhost on the
> wasmtime C API (a Rust host on the wasmtime crate came first and was removed on 2026-11-26); the compositor hosts real Wayland clients (M5, in MoonBit
> rather than smithay) and runs as a DRM/KMS + libinput login session (M8). Settings, power and
> clipboard from M6 are in; notifications, tray, vfs and packaging are not.
@@ -274,7 +274,7 @@ Designed next (no WIT yet): `window-registry`/`wm-policy`/`decoration`, `search-
## 12. Open design questions (with recommendations)
1. **Host language/long-term host** — Rust+wasmtime native host vs trying to keep even the host in MoonBit. *Recommend Rust+wasmtime for M3; revisit MoonBit-native host only if wasmtime's C API gains full component embedding.*
1. **Host language/long-term host** — Rust+wasmtime native host vs trying to keep even the host in MoonBit. *Recommend Rust+wasmtime for M3; revisit MoonBit-native host only if wasmtime's C API gains full component embedding.* Resolved: the host is MoonBit (`wasmhost/`) on the wasmtime C API, whose component model support turned out to be enough; the Rust host was removed on 2026-11-26.
2. **Render-list vs textures** — *Recommend render-list as the default, `buffer-surface` resource only for non-vector content (§4).*
3. **UI toolkit inside components** — adopt `moon-gpui` or a tiny immediate-mode helper (`lib/ui`)? *Recommend `lib/ui` until moon-gpui has a stable scene package and a flatten-to-draw-op adapter, then migrate widget internals; keep the WIT draw-op vocabulary as the stable boundary.*
4. **Text and fonts** — host-provided shaping (`text` interface) vs components bundling a shaper. *Recommend host-provided: layout needs metrics from the same engine that rasterises.*
+3 -3
View File
@@ -1,9 +1,9 @@
# Toolchain: what works today (verified 2026-11-24)
> This page records the M0 toolchain proof (browser/Node host via jco). Since then the
> components also run natively under wasmtime: the default host is the MoonBit
> [wasmhost](../wasmhost/README.md) on the wasmtime C API, with the Rust
> [host-wasm](../host-wasm/README.md) as a fallback. For the current build see the
> components also run natively under wasmtime: the host is the MoonBit
> [wasmhost](../wasmhost/README.md) on the wasmtime C API (an earlier Rust host on the
> wasmtime crate was removed on 2026-11-26). For the current build see the
> [README](../README.md). Pinned versions live in `scripts/versions.env`.
Everything here was run on x86_64 Linux (glibc 2.43 locally; CI uses
+3 -4
View File
@@ -97,9 +97,8 @@ is reported and the running instance stays (see [reloading.md](reloading.md)).
## Hosts
All three module hosts serve desktop modules: the native compositor and the MoonBit
`build/wasmhost` (both through `compositor/wasm/wasm_stub.c`) and the Rust `host-wasm`
(`src/plasmoid.rs`, bound with the `desktop-export` world). The compositor-as-wasm reaches them
Both module hosts serve desktop modules: the native compositor and the MoonBit
`build/wasmhost`, both through `compositor/wasm/wasm_stub.c`. The compositor-as-wasm reaches them
through `desktop-backdrop`, `desktop-scroll`, `desktop-tick` and `publish-desktop` in
`wit/host/plasmoids.wit`. The settings module reads the list through the `wallpaper`
capability's `desktops`, `current-desktop` and `set-desktop` (`wit/capabilities.wit`).
@@ -115,5 +114,5 @@ XDG_CONFIG_HOME=$(mktemp -d) CHANDRA_TEST_CONFIG=1 \
moon test --target native --warn-list -a -p chandra/desktop/compositor/host --filter "*desktop*"
```
Also checked headless on `build/wasmhost` and `host-wasm` (`--gfx-out`) with `:desktop` set in
Also checked headless on `build/wasmhost` (`--gfx-out`) with `:desktop` set in
state.edn.
+2 -2
View File
@@ -61,8 +61,8 @@ capability (`wit/capabilities.wit`):
rig's X server through server.py, exactly as from the web library, and Openbox stacks them over
Chandra's window.
Served by every host: the wasmer/wasmtime stub (`compositor/wasm/wasm_stub.c`), the MoonBit
wasmhost and the Rust `host-wasm`.
Served by every host: the wasmer/wasmtime stub (`compositor/wasm/wasm_stub.c`), and the MoonBit
wasmhost.
Code: `components/gamerig-library` (bindings and a thin stub), `lib/gamelib` (model, JSON,
layout, drawing, input; tests in `lib/gamelib/gamelib_test.mbt`), `compositor/shell/gamelib.mbt`
-1
View File
@@ -26,7 +26,6 @@ for a new compositor or host; `just reload` picks up new panel modules in a runn
| Flag | What it changes |
|---|---|
| `--link` | Symlink the session into this checkout instead of copying: after that, rebuilding (`just compositor-wasm wasmhost modules`) is all the next login needs, no root. The checkout must stay where it is. Face unlock is copied either way. |
| `--rust` | Use the Rust host (`host-wasm`, about 2 minutes to build cold) instead of the MoonBit one |
| `--native` | Install the native compositor (system-cc release build) instead of the wasm one |
| `--pam` | Also turn face unlock on for `polkit-1` and `sudo` (Settings > Session can do it later) |
| `--no-face` | Leave face unlock out |
+3 -3
View File
@@ -113,7 +113,7 @@ starting with `ok` or `error`. Several commands may be sent on one connection.
The compositor handles the socket in its main loop (`compositor/host/control.mbt`, from
`ChandraCompositor::step`), and the listening socket and its clients are among the fds the idle
loop waits on, so an idle desktop still sleeps (about 0.4% CPU, unchanged) and wakes for a
command. It is the same code on the MoonBit host, the Rust host and the native build.
command. It is the same code on the MoonBit host and the native build.
## Not reloadable
@@ -125,7 +125,7 @@ WM, portal backend or host need a new session: log out and back in.
## Status
Tested headless on both hosts (`build/wasmhost` and `host-wasm`) with the modules from
`build/components`: `ping`, `list`, `reload`, `reload NAME`, a module replaced by a broken file
Tested headless on `build/wasmhost` (and on the Rust host, since removed) with the modules
from `build/components`: `ping`, `list`, `reload`, `reload NAME`, a module replaced by a broken file
(reported, old instance kept), SIGUSR1, and idle CPU before and after. Tests:
`compositor/host/control_test.mbt`. Not yet run against an installed login session.
+2 -2
View File
@@ -1,7 +1,7 @@
# Rendering, animations and machines without a GPU
Chandra draws the desktop on the CPU on every machine: the host (build/wasmhost, or the Rust
host) rasterises each frame into its own framebuffer and hands it to the display (KMS, X11, a
Chandra draws the desktop on the CPU on every machine: the host (build/wasmhost)
rasterises each frame into its own framebuffer and hands it to the display (KMS, X11, a
nested Wayland window). A GPU never makes Chandra's own frames cheaper. What it changes is how
much CPU is left: with a GPU, apps (browsers, video, games) draw there; without one they draw
with llvmpipe or their own software paths on the same cores as Chandra.
+1 -1
View File
@@ -15,7 +15,7 @@ Everything below works with sudo, doas or pkexec too; run0 is only preferred whe
## Installing the login session
```bash
just install # flags: --link, --rust, --native, --pam, --no-face; and `just uninstall`
just install # flags: --link, --native, --pam, --no-face; and `just uninstall`
```
These go through `scripts/as-root`, which uses run0 if systemd is PID 1 and run0 is installed,
+1 -2
View File
@@ -52,8 +52,7 @@ right and 6px down. Hover and pressed show as a ring around the button.
- `compositor/scene/scene.mbt`: `WindowStyle` (frame sizes, button layout and hit test,
`button_at`) and `build_window_decoration`, which returns the frame as draw ops in the frame's
own coordinates, shadow included. Every host draws them as they are: the software renderer
(compositor/renderer), the MoonBit host (wasmhost/bin/raster.mbt) and the Rust host
(host-wasm/src/raster.rs) have no shadow of their own and redraw `SHADOW_PAD` (18px) around a
(compositor/renderer) and the MoonBit host (wasmhost/bin/raster.mbt) have no shadow of their own and redraw `SHADOW_PAD` (18px) around a
window that changed.
- `compositor/host/compositor.mbt`: `window_style` (the style in use; `frame_top()`,
`frame_side()`, `frame_rect()`), `sync_window_style` (applies the setting: the work area, the