Module: Tebako::LauncherAbi

Defined in:
lib/tebako/launcher_abi.rb

Overview

Launcher ABI v1 — the bootstrap → runtime handoff contract of the three-part package model (spec §4.4).

A lean package is [tebako-bootstrap][.tfs image slots][tpkg trailer]. A fat package has the same layout plus the runtime package itself as a payload slot (format_id TPKG_FORMAT_RUNTIME, empty mount point, ";sha256=" appended to the trailer's runtime_ref): at first run the bootstrap installs the payload into the shared cache instead of downloading it. Payload slots are never handed over as --tebako-image.

The bootstrap (tamatebako/tebako-bootstrap) parses the trailer of its own executable, resolves the language runtime into the shared cache, and execs it as:

<runtime> --tebako-image <file>:<slot>:<mount-point> ...
        --tebako-entry <argv0> <user args...>

The runtime (a tebako-packaged interpreter built from this repo) consumes that handoff in src/tebako-main.cpp:

--tebako-image <file>:<slot>:<mount-point>
  Repeatable, one per image slot, in slot order. <file> is a package
  file carrying a tpkg manifest trailer (spec 

The three option spellings above are exactly what tebako-bootstrap v1 emits (space-separated values, images before --tebako-entry); the runtime additionally accepts the --opt=value form of each.

Versioning: VERSION is bumped whenever the handoff changes incompatibly. This file is the Ruby-side constant set; src/tebako-main.cpp carries the matching C++ constants — keep the two in sync.

Constant Summary collapse

VERSION =

Launcher ABI version implemented by this gem and by tebako-main.cpp

1
IMAGE_ARG =

Repeatable: hand one image slot of a package file to the runtime

"--tebako-image"
ENTRY_ARG =

Separator: value is the package argv; the rest is application argv

"--tebako-entry"
VERSION_ARG =

Optional: launcher ABI version the bootstrap speaks

"--tebako-launcher-abi"

Class Method Summary collapse

Class Method Details

.image_spec(file, slot, mount_point) ⇒ Object

Format one --tebako-image value per the ABI: "::". (The parser splits on the last two colons, so may itself contain colons — e.g. Windows drive prefixes.)



101
102
103
# File 'lib/tebako/launcher_abi.rb', line 101

def self.image_spec(file, slot, mount_point)
  "#{file}:#{slot}:#{mount_point}"
end