mod eb_engine_export

module eb_engine_export

Export the tables a browser needs to answer a widget without the solver.

eb-stack compiled to WebAssembly answers every widget, and until that exists a page can still answer the ones whose whole behaviour is a lookup plus a few lines of mechanical application. eb_easyblock established the shape: emit the table from here, apply it there, and keep a cross-check that compares the two implementations over many inputs.

Two tables live here.

The template spec carries EasyBuild’s TEMPLATE_CONSTANTS verbatim and a list saying which derived key follows which rule. The rule vocabulary is deliberately tiny and closed, so a consumer applies rules rather than reimplementing build_templates. Adding a key in eb_parse without adding it here is what the cross-check catches.

The hierarchy table carries the generations hierarchy::known_hierarchy answers from fixtures. That one is pure data: a consumer looks up a parent and reads the members in order, with no rule to apply.

Variables

const EXPORTED_HIERARCHY_GENERATIONS: &[(&str, &str)]

Generations known_hierarchy answers from a fixture.

Kept beside the fixture list it mirrors: a generation added there and not here exports nothing, and the widget says the generation is unknown rather than inventing a chain.

const TEMPLATE_RULES: &[(&str, &str)]

How a derived template value is produced from the recipe’s own fields.

Serialised as a string so the consumer matches on a closed set. Anything outside this vocabulary belongs in the engine proper, not in a page.

Functions

fn hierarchy_table() -> Value

The known toolchain hierarchies, parent first in each entry’s parent.

members keeps the framework’s order: most minimal subtoolchain first, the named toolchain last. A consumer must not sort it.

fn resolve_templates(name: &str, version: &str) -> Value

Values the derived-key rules produce for name and version.

The toolchain is system with an empty version, which is what a consumer without a recipe universe can know. A key whose rule does not apply is left out. Python’s py* keys are present only when name is Python.

fn template_spec() -> Value

The template constants plus the derived-key rules, as JSON.