Skip to content

Build on OSL 3.0 - #68

Merged
Mistium merged 4 commits into
mainfrom
osl3-migration
Nov 1, 2026
Merged

Mistium merged 4 commits into
mainfrom
osl3-migration

Conversation

@Mistium

@Mistium Mistium commented Nov 1, 2026

Copy link
Copy Markdown
Member

Moves the API to OSL 3.0. The 3.0 compiler rejects main (some variable names are now reserved type names), and the server's /usr/local/bin/osl is already 3.0, so the API can only be built with the old 286ce05 build kept beside it. No endpoint changes.

Renames. Variables named with what 3.0 reserves: result → res, option → pollOption, channel → releaseChannel, xml → sitemapXml, thread → threadComments, set → bannedSet, error → roturError, unknown → unknownProject. None touches a string, object key, JSON field or collection name.

Bytes and characters. In 3.0, string .len counts characters, not bytes. The first response diff caught it: asset sizes came out smaller, because binary data has fewer "characters" than bytes. The 19 places that measure bytes now use .toBytes().len: asset sizes, stored JSON caps, game saves, extension sources, realtime message caps, the settings body cap, the comment file cap and the git inspection cache key. About 80 text limits (title ≤ 100, bio ≤ 300 and so on) now count characters, so non-ASCII text gets the room the limit intends instead of being cut short.

Other 3.0 changes, checked. Arrays are now shared on assignment. Every alias and every array parameter was reviewed, and none changes behaviour. random(a, b) now includes its upper bound, and the API never calls it.

go.mod. 3.0's db package brings new Go modules (modernc sqlite), so go.mod and go.sum change. The first compile on the server downloads them.

Testing. scripts/e2e_smoke.py runs one binary offline, or diffs two. It covers 29 steps: agreement, explore, Classroom availability, sign-in state, create, upload, project and project.json, quota, share, remix, delete, trash, purge, unshare, a 404, a 405 and the /api prefix. main built with the old compiler and this branch built with 3.0 return matching responses, including for an sb3 with 80 KB of non-ASCII text. osl test passes 45/45 on both.

Before deploying. The server's 3.0 binary was built without VCS info, so it isn't known which commit it is. Rebuild it from 5895982f (the commit CI and these tests use) before compiling this. The rest of the deploy is unchanged.

An independent review checked every rename, every byte-sensitive site and the startup order, and found nothing to fix.

There is no visible change.

OSL 3.0 reserves result, set, error, option, xml, thread, unknown and
channel as type names, so variables and parameters with those names no
longer compile.
OSL 3.0 counts characters with string .len. Asset sizes, stored JSON
limits, game saves, extension sources, realtime messages and settings
bodies are budgets in bytes, so they now use .toBytes().len and keep
their old limits and stored sizes.
scripts/e2e_smoke.py starts a compiled API in a fresh data directory with
fake sessions and no Rotur, walks the agreement, explore, classroom,
project, upload, quota, remix and delete routes, and normalizes the JSON
responses. Given two binaries it diffs them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant