# How it all fits

> The framework as a system — its repositories, the rmp command, the generator, CMake, Gradle and Xcode, the toolchain of every family of targets, the workflows and the build image — and what each part reads from the others.

Source: https://omardev29.github.io/rmp-docs/framework/maintaining/how-it-fits.html

[Architecture](https://omardev29.github.io/rmp-docs/framework/architecture.html) is the game's side: the layers a frame goes through. This page is the maintainer's side: the repositories, the programs that turn a checkout into a binary for each target, and the places where one part reads a version or a file from another. When something breaks after years of nobody touching it, the break is at one of these joints.

## The repositories

Every arrow is a pin: a digest, a commit, or a copy. None of them moves unless someone moves it.

[raylib_multiplatform](https://github.com/omardev29/raylib_multiplatform)

The framework: the library, the vendored libraries under `thirdparty/`, the tools, the tests, the examples, the workflows. A game is not a fork of it but a copy of the files `INCLUDE` in `tools/rmp.py` lists, made by `rmp new`; from then on the game keeps the framework it was made with, and only `rmp update`, run on purpose, moves it.

[raylib-build-image](https://github.com/omardev29/raylib-build-image)

Two images: `ghcr.io/omardev29/raylib-build`, the toolchain of every Linux, web and Android job, and `ghcr.io/omardev29/raylib-run-alpine`, the Alpine the musl build is started on. The framework pins both by digest. The build image's Gradle home is warmed by building the framework's Android project at a commit the image names, so the two repositories point at each other: [an Android bump](https://omardev29.github.io/rmp-docs/framework/maintaining/build-image.html#android-bump) moves them in a set order.

[raylib-iOS](https://github.com/omardev29/raylib-iOS)

raylib has no iOS backend of its own. The framework's comes from a fork of a third party's port, kept under the same account so that the commit it pins cannot vanish with somebody else's repository; `thirdparty/raylib-ios` is the submodule, used by the iOS target only.

[rmp-docs](https://github.com/omardev29/rmp-docs)

This site, made of HTML fragments and of the framework's headers by one Python script, and checked against the framework at the commit in its `FRAMEWORK_REF` file. Its CI runs in the build image the framework pins at that commit, read from the framework's `ci.yml`, so the site never keeps a digest of its own. A daily workflow checks the site against the framework's newest commit and keeps one issue open while they disagree.

Plans and the record of what was decided live in a fourth repository of documents, checked out around the framework on Omar's machine and beside it in the cloud; the framework's `CLAUDE.md` says where. Nothing builds from it.

## From a checkout to a binary

1. **The launcher.** `rmp` (POSIX sh), `rmp.ps1` and `rmp.cmd` do one thing: find a Python that is 3.11 or newer and hand it `tools/rmp.py` and every argument. Everything `rmp` does is in that one file.
2. **The generator.** `tools/configure.py` reads `raylib_multiplatform.toml`, refuses anything wrong with the line it is on, and writes what every build system reads. CMake runs it on every configure, before `project()`, because the project's own name comes out of it; Gradle and XcodeGen never run CMake, so their jobs run it first. [The config pipeline](https://omardev29.github.io/rmp-docs/framework/config-pipeline.html) has every file it writes.
3. **CMake.** `CMakePresets.json` holds the presets a build is named by — debug and release, their DRM twins, web, the headless memory build and the lint build. `CMakeLists.txt` adds raylib from `thirdparty/raylib`, compiles the framework once into the static `rmp` library, and links the game and every example against it. The files under `cmake/` are what it includes: the hook that runs the generator, the Python it looks for, the sanitizers' probe, the riscv64 toolchain, the game's resources and tests.
4. **Gradle and Xcode.** Android builds through `raymob/`, whose `raymob/app/src/main/cpp/CMakeLists.txt` compiles the same sources with the NDK; iOS through an Xcode project XcodeGen makes from what the generator writes. Neither reads the top-level `CMakeLists.txt`, which is why a header path goes on four lists, not one (`CLAUDE.md`, "A vendored header goes on FOUR include lists").
5. **Packaging.** A release is packed by the release job of each family: UPX on the Linux targets whose packed binary CI starts, the resources bundled into one `resources.rres`, `LICENSES.txt` generated from `THIRD_PARTY_LICENSES.md`, and `tools/size_check.py` holding every binary to its line in `tools/size_budget.txt`.

Nothing in that path downloads anything: there is no `FetchContent`, no package manager and no submodule but iOS's. A clone, a Python of 3.11 or newer, CMake, Ninja and a compiler build the desktop game. The generator uses Python's standard library only; Pillow, when it is there, makes the icons.

## Who builds each family

| Family | Compiler | Where CI builds it | Pinned by |
|---|---|---|---|
| Linux, glibc | zig's clang, aiming at the glibc floor of `[linux] glibc`, through `tools/linux_build.sh` | inside the build image, x64 on `ubuntu-24.04`, arm64 on `ubuntu-24.04-arm` | the image digest; `zig` |
| Linux, musl | zig, for musl | inside the build image; started on the Alpine run image | both digests |
| Linux, riscv64 | the image's `riscv64-linux-gnu` GCC, `cmake/toolchain-riscv64-linux.cmake` | inside the build image, started under QEMU there | the image digest |
| Linux, DRM | the image's own compiler: zig cannot link libdrm, gbm and EGL | inside the build image; started on vkms on a bare runner | the image digest |
| Web | Emscripten | inside the build image | `emscripten`, and the image's emsdk commit |
| Android | the NDK's clang, through Gradle | inside the build image, amd64, offline | the image digest, the Android set |
| Windows | the compiler CMake finds first on the runner | on the `windows_runner` runner image | the runner label only: see below |
| macOS and iOS | Apple's clang from the pinned Xcode | on the `macos_runner` runner image | `xcode`, `xcodegen`, `ninja_mac` |
| The BSDs | each system's own compiler | in a virtual machine started by `cross-platform-actions` | `freebsd`, `openbsd`, `netbsd`; their package mirrors are rolling |

Not pinned The compiler that builds the shipped Windows `.exe` is whichever one CMake finds first on the runner's PATH — the runner's MinGW GCC — and it moves with the runner image. The job reads it back from the CMake cache and prints it, so a failure can be matched to a compiler afterwards, but nothing holds it still. The MSVC that checks the examples compile floats the same way. On Windows, a red run that nobody caused is the first thing to suspect it of.

## The workflows

`ci.yml` is the entry point. Its `config` job runs the generator and turns the enabled targets into a matrix per family, then calls one reusable workflow per family — `_linux.yml`, `_web.yml`, `_windows.yml`, `_android.yml`, `_apple.yml`, `_bsd.yml` — beside the framework's own jobs: lint, tidy, the examples, the e2e scripts, the new game, coverage, the deterministic deep tests, the docs and the API gate. A tag adds the release, which gathers what every family packed, and the itch.io job after it; a full run with Android enabled adds Firebase Test Lab. [CI](https://omardev29.github.io/rmp-docs/framework/contributing/ci.html) says what each push runs.

Three more run on their own, on the framework's repository only:

- `deep.yml`, every night (fuzzing, random seeds) and every Sunday (mutation), opening an issue labelled `nightly-finding` per new failure;
- `canary.yml`, every Monday: the same reusable workflows against the floating versions — the image's `:latest`, the newest runners, Xcode and Mesa — and a report of what is newer than every pin;
- `autofix.yml`, after a red canary: an agent on the broken family's own runner that proposes a fix as a draft pull request.

`web-backends.yml` builds the web game once per `[web] backend` and checks each build is the backend it asked for; it runs by hand and on a push that changes the files that choose the backend.

## The image, in the middle

The build image is the joint most things go through. Every Linux, web and Android job, the lint and tidy jobs, the examples and their scripts, coverage, the deep tests, the new game and this site's own CI run inside it, at the one digest the framework names in `ci.yml`, in `web-backends.yml`, three times in `deep.yml` and in `thirdparty/FROZEN_VERSIONS.md`. Exactness lives there too: the e2e shots are compared pixel for pixel, and the coverage floors and header costs are held, only inside it, because they were measured there. [The build image](https://omardev29.github.io/rmp-docs/framework/maintaining/build-image.html) says what is in it and how to make a new one.

## The gates around it

Around the code sits a set of checks about as large as the code: `tools/` holds a gate per rule (naming, style, ownership, pointers, headers, licences, versions, workflows, portability, shell patterns, seams, sizes), and `tests/` holds tests of the tests — each gate seen red on a planted mistake, the campaign's own rules, the workflows read as text. They are what lets an agent or a person change one file without reading every other one. They are also code to maintain: a renamed step in a workflow, a new compiler warning, a moved line in a vendored file can turn one red with nothing wrong in the game. [Upgrading a dependency](https://omardev29.github.io/rmp-docs/framework/maintaining/upgrading.html) lists, for each bump, which of them to expect.
