Skip to main content

Module targets

Module targets 

Source
Expand description

Mirror of the Scrollcase box-format target model.

A target is the (platform, arch, accelerator) triple a box is built for, plus a CUDA ABI version when the accelerator is CUDA. box_target_id turns it into the canonical slug that appears in archive names, object keys and registry routes, so every implementation of the format must agree character for character. The golden cases in fixtures/target-id-contract.json are what “agree” means, and tests/contract.rs proves this mirror against them.

The adapter describes what a target implies for the extracted tree. Only the parts a consumer relies on are carried here: the interpreter layout it must find, the inherited variables that can change which code that interpreter loads, and the platform assertion a self-test opens with. The builder’s own adapter additionally names the archive backend, the conda subdir and the native library inspector — all of them decisions taken while a box is produced, none of them observable by something that only unpacks and runs one.

The native host is expressed in Rust’s own OS/ARCH vocabulary rather than Node’s darwin/arm64. Those strings never appear in a signed document; they only answer “may this host run this box”, and each implementation answers it in the terms its own runtime reports.

Structs§

BoxTarget
The (platform, arch, accelerator) triple a box is built for.
BoxTargetAdapter
What a target implies for the extracted tree.
PythonLayout
Layout of the interpreter inside an extracted box.

Functions§

assert_host
The host check with the host injected, so every target can be exercised on one machine.
assert_native_host
Ensures this host is the operating system and architecture the box ships for.
assert_python_entry_point
Ensures a release’s entry point agrees with the adapter’s standalone Python layout.
box_target_adapter
Returns the adapter for a validated box target.
box_target_adapters
Lists every adapter, for contract tests and for callers enumerating supported targets.
box_target_id
Returns the canonical target slug used in box filenames, object keys and routes.