mod eb_engine_export¶
- module eb_engine_export¶
Export the tables a browser needs to answer a widget without the solver.
eb-stackcompiled 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_easyblockestablished 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_CONSTANTSverbatim 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 reimplementingbuild_templates. Adding a key ineb_parsewithout adding it here is what the cross-check catches.The hierarchy table carries the generations
hierarchy::known_hierarchyanswers 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_hierarchyanswers 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.memberskeeps 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
nameandversion.The toolchain is
systemwith 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’spy*keys are present only whennameisPython.
- fn template_spec() -> Value¶
The template constants plus the derived-key rules, as JSON.