# Upgrading a dependency

> A playbook for each dependency of the framework — where its version is held, what has to move with it, the patches to carry over, the checks that will go red and what is re-recorded afterwards.

Source: https://omardev29.github.io/rmp-docs/framework/maintaining/upgrading.html

Every dependency below is pinned, so none of them has to move until there is a reason: a store's requirement, a runner that no longer has the pinned version, a bug upstream has fixed, a feature a game needs. When there is one, this page says what the upgrade touches. Each entry gives where the version is, what moves with it, what to expect red, and what is recorded again afterwards.

## The rules of every upgrade

- **One dependency per pull request.** Two at once cannot be told apart when a run goes red.
- **The pin and every copy of it in the same commit.** `rmp test config` runs `tools/versions_check.sh`, which names a copy that was left behind.
- **A gate that goes red is information.** It is answered by fixing the code, or by re-measuring a number the dependency really changed, with the reason written down. A floor is never lowered and a list that only shrinks never grows to make a bump pass (`CLAUDE.md`, "Never weaken a gate to get green").
- **The full matrix once, at the end.** A debug lane on the families the dependency touches while working ([CI](https://omardev29.github.io/rmp-docs/framework/contributing/ci.html#more)), the whole matrix before merging.
- **The docs after.** A page of this site that names a version or a behaviour that moved is fixed in the same stretch of work, and `FRAMEWORK_REF` bumped.

## The vendored code

### raylib

Where

`thirdparty/raylib`, a committed copy of a release; `RAYLIB_VERSION` in `thirdparty/raylib/src/raylib.h` says which.

The patches

Every change is a row of `thirdparty/raylib/PATCHES.md`, which says where it comes from, and is commented at its site: `PATCHED (raylib_cmake_template)` for the template's, whose copy this is, and `PATCHED (raylib_multiplatform)` for the framework's own. Each row says what to do with it: the backports are dropped once the new release has them; the build-system and backend fixes are re-applied; the fixes of our own are re-applied unless upstream has fixed it — and for those, a test says which. Copy the new release over the old one, then walk the table, top to bottom.

What holds the patches

`EscapeIsTheGamesKeyTest` scans every backend for a key that closes the window without being the exit key; `DrmCardProbeTest` reads the DRM card probe; `tests/rlsw_test.cpp` calls the software renderer's texture lookup at its edges; `tests/configure_test.py` compares raylib's platform list with the branches that select them. A patch that was lost turns one of them red.

What moves with it

raylib-cpp, whose version follows raylib's; the raylib-iOS fork, which is its own copy of raylib and should be the same release, or a game can call a function iOS does not have; the vendored libraries inside raylib (GLFW, miniaudio, the software renderer), which come with it.

Expect red

The render hash (`tests/fixtures/render_hash.txt`) and the e2e shots, if anything drawn changed; the size lines; `tools/ownership_check.sh`, which reads raylib's `Load*` and `Unload*` names from `raylib.h` live; this site's `names` gate, which checks every raylib function a page names against the headers.

Re-record

The render hash with `rmp test render-update`, the e2e goldens with `rmp test e2e-update` in the image, every changed picture looked at; a moved golden is `behaviour-approved`.

Licence

raylib stays modified: `PATCHES.md` stays, rewritten for the new release, and `THIRD_PARTY_LICENSES.md` says the version.

### Clay

Where

`thirdparty/clay/clay.h`, one committed file; two patches in its `PATCHES.md`, both commented at the site: the C++ version guard (NetBSD's GCC 10 reports an older C++ under `-std=c++20`) and the two sizing loops that froze on a layout too large for a float.

Why it is expensive

Clay is before 1.0, its API moves between minor versions, and every file under `src/rmp/ui/` uses it. The facts the UI depends on — one id scheme, strings Clay keeps by pointer, the rectangle Clay emits after an image, a floating element that captures the pointer, the way it measures text a word at a time — are verified one by one in the `rmp-ui-internals` skill, and each has to be checked again on the new version.

Expect red

`tests/ui_layout_test.cpp` and the UI's other tests, `tests/property/ui_text_prop.cpp`, every e2e shot of a menu.

When

Only for a fix a game needs. The frozen copy has no deadline: it is C, in one file.

### cute_tiled, cute_aseprite, cJSON, rres

The four readers of files a game loads. Each one is fed bytes it should not trust, so each one has a fuzz target in `tests/fuzz/` and a committed corpus under `tests/fuzz/corpus/`; after an upgrade, `rmp test fuzz` replays every committed input under the sanitizers, and the nightly campaign searches further.

cute_tiled

Patched and hardened: the six `default:` branches skip a key the parser does not know (a map saved by a recent Tiled has many), and every reader stops at the end of its input. Each site is `/* rmp patch */` and a row of `thirdparty/cute_tiled/PATCHES.md`. `tests/fixtures/map_modern.json` is rejected by the unpatched parser and accepted by ours: if it fails after an upgrade, the patch was lost.

cute_aseprite

Unmodified, pinned by `sha256_cute_aseprite`; the new hash is the one `tools/license_db.py` prints. `prepare_aseprite()` in `src/rmp/assets/aseprite.cpp` walks every chunk before cute_aseprite sees the bytes, so a new chunk type is the thing to read the changelog for.

cJSON

Unmodified, `sha256_cjson`. `src/rmp/save/cjson_impl.c` sets its nesting limit to the save format's maximum depth and deliberately does not turn on its locale support; the save code writes numbers itself and parses under the C locale. Run `tools/test_locales.sh` after an upgrade.

rres

Unmodified, `sha256_rres` over every file, `external/` included — the compression and the encryption `rmp::save` seals saves with. A change in the encryption changes what an old save reads as, and the save tests are what notice: a player's saves must still open after the upgrade.

### raymob

Android's native glue, in C under `thirdparty/raymob` and in Java under `raymob/app/src`. Every patch is marked `[rmp patch]` and listed in `thirdparty/raymob/PATCHES.md`: a heap overflow, a bound check that checked nothing, a detach of the game's own thread, the JNI discipline the C side follows, and a key release sent as a second press. `RaymobJniDisciplineTest` fails on a call that skips the helpers. Upgrade only for a reason; the Android build and Firebase Test Lab are the proof.

### raylib-iOS and ANGLE

The iOS backend is a submodule, `thirdparty/raylib-ios`, pinned to a commit of the fork under the same account. It is the dependency most likely to be forced: a new Xcode or a new iOS SDK can need a change in it, and its upstream is one person's port. To move it:

```shell
git -C thirdparty/raylib-ios fetch origin
git -C thirdparty/raylib-ios checkout COMMIT
git add thirdparty/raylib-ios
```

A fix of your own goes to the fork first, as a commit there, and the submodule then points at it. The row in `thirdparty/FROZEN_VERSIONS.md`'s table and the licence rows — ANGLE's included — follow. The iOS simulator job is the proof; an App Store build is the real one.

### doctest and RapidCheck

Pinned by content (`sha256_doctest`, `sha256_rapidcheck`). doctest ships with every game's tests; RapidCheck is the framework's only. RapidCheck's own doctest integration does not compile, and `tests/property/check.h` is the few lines that replace it: an upgrade checks those still match.

## The Android set

SDK levels, build tools, NDK, AGP, Gradle and JDK move together: AGP's version decides the Gradle it needs and the highest API it supports. The keys are the `android_*` ones, `agp`, `gradle` and `gradle_sha256`, and the files are `raymob/app/build.gradle`, `raymob/build.gradle` and `raymob/gradle/wrapper/gradle-wrapper.properties`. The image carries the SDK and a Gradle home warmed for the set, so this is [the Android bump](https://omardev29.github.io/rmp-docs/framework/maintaining/build-image.html#android-bump), in both repositories.

AGP 9 Do not move to AGP 9 without rewriting `raymob/app/build.gradle` first: Gradle 9 removes `gradle.buildFinished`, AGP 9 removes `applicationVariants`, and that file uses both. That rewrite is the largest single piece of Android work ahead.

AdMob's SDK, `play_services_ads`, can move on its own: an AAR built against a lower SDK works under a higher one. It is still in the warmed Gradle home, so a new version is an image too.

## Xcode and the macOS runner

The keys are `macos_runner` and `xcode`. The Apple jobs select Xcode by version, and a step fails, listing what the runner has, when the pinned one is gone — GitHub keeps a few Xcode versions per runner image and removes old ones. That failure is the signal to bump: pick a version the runner lists, run the debug lane on `macos` and `ios`, and look at the canary, which already builds with the newest one. XcodeGen and the macOS Ninja are downloaded by version and `sha256` (`xcodegen`, `ninja_mac` and their hashes), never from Homebrew.

## Windows

- `windows_runner` is the runner label. The compiler that builds the `.exe` comes with it, pinned by nobody ([the warning](https://omardev29.github.io/rmp-docs/framework/maintaining/how-it-fits.html#families)).
- `mesa` and `mesa_sha256`: the software OpenGL the Windows render test runs on. Test only; the release zip is checked not to carry it.
- Pillow: one hash per Python version the runner can have. When the runner's Python moves to a version with no hash in the block, the install refuses and the icon step fails: add that version's `win_amd64` wheel hash, from PyPI, as a new `pillow_sha256_cp3XX_win_amd64` key.
- `upx_sha256_win64`, with the UPX version.

## clang-format and clang-tidy

The keys are `clang_format` and `clang_tidy`, and the image's `CLANG_TOOLS_VERSION`. A new clang-format reformats files that were already right, and a new clang-tidy finds warnings nobody owed. So the bump is three commits, in one pull request:

1. The versions, in the image and in the framework.
2. `rmp fmt` over the whole tree, alone in its commit, so the review can skip it.
3. Every new clang-tidy warning fixed, or carried with a `NOLINT` that names the check and says why; `tools/lint_debt.txt` only goes down (`bash tools/lint.sh debt` lowers it, nothing adds to it). Read every automatic fix: `misc-const-correctness`'s have been wrong. Check that the `CustomChecks` still run: they need `--experimental-custom-checks`, and a query that no longer parses is one warning line and nothing else; `ClangTidyGuidelineTest` shows each firing on a probe.

This site's Guidelines compile their examples through the same clang-tidy, and its `enforcement` gate reads the framework's `.clang-tidy`: a check that was renamed or removed shows there too.

## The tools inside the image

Emscripten

`EMSDK_COMMIT` and `EMSCRIPTEN_VERSION` in the image, `emscripten` in the framework. A new one can change the web build's size, its JavaScript, and what `web-backends.yml` fingerprints for each backend: run it by hand. Never add `ASYNCIFY` back to get a `while` loop (`CLAUDE.md`, "Web has no `while` loop").

zig

In the image (`ZIG_VERSION`, its hashes, and `ZIG_WARM_GLIBC`, which must be the `[linux] glibc` default), and in the framework as `zig` and `zig_sha256_*`, which `tools/linux_build.sh` uses when it downloads it on a laptop. zig is before 1.0 and changes its command line between versions; the script is what moves.

CMake and Ninja

The image's `CMAKE_VERSION` and `NINJA_VERSION`, the `cmake` and `ninja_linux` keys. The framework asks for CMake 3.30 or newer; Android's CMake is the SDK's own, `android_sdk_cmake`.

UPX

The image's `UPX_VERSION`, and `upx` with its three hashes. Every packed size line moves.

LLVM and Mull

Together or not at all: [the LLVM bump](https://omardev29.github.io/rmp-docs/framework/maintaining/build-image.html#llvm-bump). The coverage floors and every mutation floor are measured again.

cppcheck

From the apt snapshot. A newer one finds new things; the rule is zero findings in `src/rmp`, and a suppression says why on its line.

actionlint and shellcheck

actionlint by version and hash, shellcheck from apt. actionlint reads no shell without shellcheck: the image's smoke check proves both run.

butler

By version and hash; itch.io's publishing only.

## CI's own pins

GitHub Actions

Every `uses:` is a full commit with its tag in a comment, and a test fails on one that is not. Dependabot proposes their bumps monthly, in both repositories. Merge them: an action whose runtime GitHub deprecates stops running on its own date, pinned or not.

The Linux runner labels

`ubuntu-24.04` and `ubuntu-24.04-arm` are written in the workflows, not in the `versions` block. When GitHub retires them, every occurrence moves in one commit, in this site's workflows too. The jobs run in the image, so what changes is the host: Docker, the kernel the DRM job loads vkms into.

The BSDs

The `freebsd`, `openbsd` and `netbsd` keys are read by the generator when it makes the BSD matrix. An old release loses its package mirror: move to a release `cross-platform-actions` supports, which can mean bumping that action too. The BSD targets are best effort, and a failure there after a green fast lane is a platform-specific bug fixed once.

Playwright

`package.json` and `package-lock.json`; Dependabot's npm pull requests. The browser it downloads is keyed to its version.

## Finding out what is newer

The canary's upstream report says what is newer than the pins it knows how to ask about: the NDK, AGP, Gradle, Mesa, the macOS Ninja and XcodeGen. It never fails a build; it is information. Everything else — raylib, Clay, Emscripten, zig, LLVM, the clang tools — is looked up by hand, and only when there is a reason to upgrade.
