0005-apps-bring-their-own-on-a-small-platform.md (3597B)
1 # 0005. Apps bring everything but a small platform, as on a Mac 2 3 Date: 2026-10-16 4 5 ## Status 6 7 Proposed. Amends ADR-0002 and ADR-0003: an app's base is the platform below, not a system 8 image, and the thin-jail runner becomes the fallback for apps that can't bring their own. 9 10 ## Context 11 12 ADR-0002 had each app name a whole system image as its base, by digest, and ADR-0003 a runner to 13 give it that base in a thin jail. That answers "Linux has no guaranteed base" in full, at the 14 cost of a layer store, a runner and images of gigabytes. 15 16 Measured on our own apps, it's more than they need. A Rust app is nearly self-contained already: 17 Teleprinter is 36 MB and links only glibc (libc, libm, libgcc_s), loading libwayland-client, 18 libxkbcommon and the GPU's EGL/GL/Vulkan when it runs. Bundling the first two adds a few hundred 19 kilobytes. What can't be bundled is short: 20 21 - **The GPU's drivers**, which must match the hardware and, for NVIDIA, the kernel. They're the 22 system's, whatever else the app brings (as ADR-0003 already decided). 23 - **glibc**, which loads those drivers, and which runs old programs on newer versions but not 24 the reverse: Teleprinter built on Ubuntu 26.04 needs glibc 2.43. 25 26 That is the macOS model: the system guarantees a small, stable set of frameworks, and an app 27 brings everything else in its folder. It's simpler than a runner for every app, and 28 it's what users expect of an `.app`. 29 30 ## Decision 31 32 - **The Patina platform** is the short list Patina OS guarantees every app, versioned. A version 33 only ever gains; what it promises stays as long as Patina OS ships it. 34 - **Platform 1** (x86_64 and aarch64 Linux): 35 - glibc 2.39 or later (Ubuntu 24.04's): `libc.so.6`, `libm.so.6`, `libgcc_s.so.1`, 36 `libstdc++.so.6`; 37 - Wayland and input: `libwayland-client.so.0`, `libwayland-egl.so.1`, `libxkbcommon.so.0`, 38 and xkb's data; 39 - graphics, from the system's drivers: `libEGL.so.1`, `libGL.so.1`, `libvulkan.so.1`; 40 - the session's services: the Wayland socket, PipeWire (with its PulseAudio socket), the 41 session D-Bus, fonts in `/usr/share/fonts`, and CA certificates in `/etc/ssl/certs`. 42 - **An app brings everything else** in its folder: libraries in `lib/` (found through 43 `$ORIGIN`), data, its own fonts if it wants them. 44 - **app.toml says `platform = 1`** (an optional key in format 1, ADR-0004). Without it, the app 45 runs on whatever system it's on, as before. 46 - **Apps are built against the platform's floor**: in an environment with glibc 2.39, so they 47 run on 2.39 and everything later. A Patina SDK image (Ubuntu 24.04 with Rust) does that. 48 - **`base` and the runner (ADR-0003) stay as the fallback**, for apps whose dependencies can't 49 be bundled cleanly (deep GTK or Python stacks). They're no longer the default, and aren't 50 built until such an app needs them. 51 52 ## Consequences 53 54 - Most apps are a folder of tens of megabytes that runs as it is, with no runner, no layer store 55 and no jail. 56 - Patina OS must keep platform 1's libraries and services in every image from now on; dropping 57 one is a new platform version and a break for the apps that named the old one. 58 - Apps built on a newer system than the floor (as Teleprinter is today, on 26.04) still run on 59 Patina OS, but don't meet platform 1 until rebuilt with the SDK. 60 - No sandbox by default: a folder app runs as the user, as a Mac app does outside the App Store. 61 Sandboxing, if it comes, grows from the runner's list (ADR-0003). 62 - FreeBSD gets a platform of its own (its libc, the same Wayland and graphics libraries), named 63 the same way, when there's a FreeBSD Patina OS.