The tebako Ruby runtime factory. This repository builds the prebuilt Ruby runtime packages that tebako packages run on, and publishes them as releases.
tebako packages a Ruby application into a single executable by stitching the app onto a prebuilt runtime. Someone has to build that runtime once, per Ruby version and per platform, so that packagers and end users never compile anything. That someone is this repository.
- Pre-patched Ruby source releases from
tamatebako/ruby: one
tfs-ruby-<version>-src.tar.gzasset per supported Ruby version (plus per-platform scenario variants), verified against the release'sSHA256SUMS. The pin lives inbuild/lib/tebako_runtime_builder/source_fetcher.rb(DEFAULT_RELEASE); a dispatch from the source factory bumps it by pull request, and the same pull request extends the build vocabulary (tools/sync_matrix_vocabulary.rb), so onboarding a Ruby version is a source-factory release with no manual edits here. - The tebako driver stack (link unit) and the
tfsimage CLI from tamatebako/tebako releases, pinned bycontract.yml'slink_unit_releaseand verified against the release's checksum sidecars. - CI containers from tebako-ci-containers for the Linux legs.
Releases are the interface everywhere: this repository never consumes another project's source tree.
Each release tag v$(cat VERSION) carries, per Ruby version × platform:
- the runtime executable
(
tebako-runtime-<tebako-version>-ruby-<ruby-version>-<platform>) — the interpreter with the tebako driver linked in; - the runtime filesystem image (
<runtime>.tfs) — the Ruby standard library and gems as a single mountable image, shipped next to the executable (the executable mounts it at boot; nothing is extracted). The image also carries the interpreter install's command scripts in/binand declares them asprovides.entrypointsin its L1 manifest (spec 30 §2's spawn surface):gem,irb,rake,bundle,rdocand the rest of the line's bin inventory are whattebako run ruby:<command>and a payload'sruntimeedgeexpose:list dispatch to. The declaration is derived from the actual staged inventory and is read back out of the packed image before the artifact uploads; - the Windows Ruby DLL (
<runtime>.dll) on Windows only, where the runtime is a shared build so native extensions can bind against it; - a
.sha256sidecar next to every served asset — the trust anchor resolvers verify downloads against; - a
.manifest.jsonshard per package — the package's manifest entry (versions, checksums, sizes, mount root, image layout, build provenance, contract version, and the image/DLL companions); - detached OpenPGP signatures (
.asc) for every served name on signing-enabled lines.
The machine-readable resolution index is this repository's
tpkg-registry.yaml on the main branch, rendered from the release's
shards by the publish pipeline (tools/registry_update.rb) and landed by
bot pull request — never hand-edited, except status: withdrawn marks.
Older release lines are immutable: packages published under the
<= 0.16.32 lines keep their original
tebako-runtime-<tebako-version>-<ruby-version>-<platform> spelling (no
ruby language segment) and stay installable forever; release lines
>= 0.17.0 compose the name with the language segment. Tooling accepts
both spellings.
- Byte-immutable payloads. A published payload asset never changes under its name. Metadata (checksums, shards) is derivable and may be regenerated, but always describes the bytes actually served.
- Contract version. The loader ↔ runtime protocol (environment
variables, argument layout, image handoff) is versioned as an integer
in
contract.yml(schema inschema/), locked in CI against the constant compiled into the runtime itself. A semantic change to that protocol bumps the integer by exactly one in both places in the same commit. - Verification at fetch, never per run. Downloads are verified
against the
.sha256sidecars when they are installed into the local store; running a package performs no verification and no installation. - Every leg is gated before upload. A freshly built runtime is boot-smoked in its own CI leg (see below); a failed smoke blocks the upload, and the publish pipeline fails loudly on any missing artifact.
The platform and Ruby vocabulary lives in .github/matrix.json;
scripts/compute_matrix.rb derives each run's legs from
.github/build-graph.yaml (a leg runs only when something it reads
changed). The Ruby version sets are extended automatically on each
source-factory release (see "What this repository consumes").
Platforms today: linux-gnu and linux-musl, macOS, and Windows (ucrt64),
each on x86_64 and arm64 where the upstream and driver support holds.
The windows/arm64 leg is wired but stays disabled until the product
publishes the arm64 Windows link unit; publish runs additionally require
the TEBAKO_SERVE_WINDOWS_ARM64 repository variable.
tools/build_runtime --ruby 3.3.7produces runtime-packages/tebako-runtime-$(cat VERSION)-3.3.7-<platform>
plus its .tfs image (see tools/build_runtime --help for output path,
build prefix, source mirror/release overrides, and parallelism).
Running the executable standalone needs the image handoff:
TEBAKO_RUNTIME_IMAGE=$PWD/runtime-packages/<runtime>.tfs \
runtime-packages/<runtime> --tebako-extract layout.github/workflows/ holds a multi-staged hierarchy:
_build-platform.yml (the per-platform build/publish unit), four thin
platform triggers (build-<platform>.yml), bump-source-pin.yml (the
source-release pin bump), and publish.yml (the release coordinator).
The architecture, cache layout, and determinism invariants are documented
in docs/build-chain.md — read it before touching any workflow, the roll
tooling, or a cache key.
VERSION— the package version: package names and the release tag follow it (v$(cat VERSION)).contract.yml+schema/— the loader ↔ runtime contract version and its JSON schema;scripts/check_contract_version.rblocks it against the compiled-in constant.build/— the self-contained CMake build project (adapted to the pre-patched source):CMakeLists.txt,cmake/,cmake-scripts/,src/,include/, codegen templates inresources/, and the Ruby build tooling inlib/.tools/build_runtime— the build entry point (fetch → verify → build → package);tools/registry_update.rbrenders the registry mirror from a release's shards;tools/sync_matrix_vocabulary.rbkeeps the dispatch vocabulary in step with the source factory's releases.Brewfile— macOS host build dependencies (CI).
bundle install
bundle exec rspecspec/boot_smoke_spec.rb (tag :boot_smoke) boots a built runtime
executable and exercises the packaged context from inside: the virtual
filesystem syscall surface, image IO and $LOAD_PATH resolution, gem
home and bundler, file locking, the openssl canary, dynamic extension
loading, the JIT support matrix, a compiled magnus (Ruby/Rust)
extension fixture that proves the executable's export surface serves the
ruby-rust gem ecosystem, and the spawn surface through the spec-17 entry
wire (--tebako-entry gem --version — the exact argv a shim hands the
runtime).
Point TEBAKO_RUNTIME_ROOT at a runtime root — a directory holding
exactly one tebako-runtime-* executable (a build leg's
runtime-packages/, a tebako-home runtime cache dir) or the executable
path itself — and run:
TEBAKO_RUNTIME_ROOT=runtime-packages bundle exec rspec --tag boot_smokeWithout the variable the class skips in a plain run and fails loudly when targeted explicitly. CI runs the tag against each freshly built runtime before the artifact upload.