The entry recipes
The exports of the recipes service.
See: Recipes, builders and the cache: The builder in the repository, Declarations: The services of the declarations in the repository
recipes module with an entry
- Hash
32dee536829fcce84cc56cb8f8ac3c3658c97b0e4da8c0013a3d30b4f5c5a877- Size
143360 bytes- Exports
9- Imports
0- Imported by
0- License
- MIT
The exports of the recipes service
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/system/recipes |
| Boot image | yes: in the boot image, 143360 bytes in this build |
| Build settings | none: the defaults of the source |
| Imports | none |
| Imported by | none |
Neighbours
It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.
Exports
| Export | What it does |
|---|---|
register(head: Recipe_Head, inputs: Table(Recipe_Input_Row, Read), arguments: Bytes(Read)) -> Table(Recipe_Reference) | keeps a recipe by its hash, so build and cache_lookup name it with 32 bytes |
register_evaluation(output: Bytes(Read)) -> Table(Recipe_Reference) | keeps the recipe that a declaration names, from the output of its evaluation: outputs.default of a project, as the evaluator wrote it |
build(recipe: Recipe_Reference, mode: Integer) -> Table(Recipe_Build_Row) | realises a registered recipe |
cache_lookup(recipe: Recipe_Reference) -> Table(Realisation_Row) | gives the realisation of a recipe in the local store, with no build |
builds() -> Table(Recipe_Build_Row) | gives the newest builds, oldest first, at most 32 |
realisations() -> Table(Realisation_Row) | gives each realisation of the local store |
status(out: Recipes_Status) -> Integer | writes aggregate recipes service counters into out |
build_count() -> Integer | returns the build requests whose mode and recipe the service accepted, whatever their outcome |
cache_hits() -> Integer | returns the builds that a cached realisation answered, from the local store or from a remote cache, with no build in the sandbox |
entry() | initializes the delegated recipes service ring and loops over build and provenance commands until stopped |
register
register(head: , inputs: (, Read), arguments: (Read)) -> ()
register keeps a recipe by its hash, so build and cache_lookup name it with 32 bytes.
- head: the builder hash, the output kind, the date of the recipe and the bound of its output in blocks.
- inputs: one row for each input, a name and a hash, at most 32.
- arguments: the bytes of the argument record, at most 4096.
- result: one row: the recipe hash.
The result is 1, or a negative number with an error record: ERROR_NO_CALLER, ERROR_ACTS_FOR_PRINCIPAL, ERROR_NOT_READY, or ERROR_RECIPE with the refusal as the value found.
head:inputs: (, Read)arguments: (Read)
()- When it fails
- a negative result, and the error record
src/modules/system/recipes/exports.odin:75
register_evaluation
register_evaluation(output: (Read)) -> ()
register_evaluation keeps the recipe that a declaration names, from the output of its evaluation: outputs.default of a project, as the evaluator wrote it. The service copies the bytes into its own memory before it reads them, converts them with the one conversion of the contract, and registers the record under the hash that the evaluator wrote.
- output: the output of the evaluation, whose value is a recipe.
- result: one row: the recipe hash.
The result is 1, or a negative number with an error record: ERROR_NO_CALLER, ERROR_ACTS_FOR_PRINCIPAL, ERROR_NOT_READY, or ERROR_RECIPE with the refusal as the value found: a bare hash, an input below the first level, a value that is no recipe, a damaged output, too many inputs, arguments too large.
See: Applications as projects: The export of the service in the repository
output: (Read)
()- When it fails
- a negative result, and the error record
src/modules/system/recipes/exports.odin:137
build
build(recipe: , mode: ) -> ()
build realises a registered recipe. A mode that takes the cache gives a realisation of the local store at once, with no build; on a miss the service builds the recipe, keeps its output and its realisation, and the next build of the recipe is a hit.
- recipe: the recipe hash that register gave.
- mode: the Build_Mode word: 1 Cache_First, 2 Build_Only, 3 Cache_Only, 4 Verify.
- result: one row: the outcome, the recipe hash and the output hash.
The result is 1, or a negative number with an error record: ERROR_NO_CALLER, ERROR_ACTS_FOR_PRINCIPAL, ERROR_NOT_READY, or ERROR_BUILD with the refusal as the value found.
recipe:mode:
()- When it fails
- a negative result, and the error record
src/modules/system/recipes/exports.odin:177
cache_lookup
cache_lookup(recipe: ) -> ()
cache_lookup gives the realisation of a recipe in the local store, with no build.
- recipe: the recipe hash.
- result: one row when the store holds a realisation of the recipe.
The result is 1 when the store holds one, 0 when it holds none, or a negative number with an error record: ERROR_NO_CALLER or ERROR_NOT_READY.
recipe:
()- When it fails
- a negative result, and the error record
src/modules/system/recipes/exports.odin:212
builds
builds() -> ()
builds gives the newest builds, oldest first, at most 32.
The result is the count of builds, or a negative number with an error record: ERROR_NO_CALLER or ERROR_NOT_READY.
- none
()- When it fails
- a negative result, and the error record
src/modules/system/recipes/exports.odin:235
realisations
realisations() -> ()
realisations gives each realisation of the local store.
The result is the count of realisations, or a negative number with an error record: ERROR_NO_CALLER or ERROR_NOT_READY.
- none
()- When it fails
- a negative result, and the error record
src/modules/system/recipes/exports.odin:247
status
status(out: ) ->
status writes aggregate recipes service counters into out.
out:
- When it fails
- a negative result, and the error record
src/modules/system/recipes/main.odin:61
build_count
build_count() ->
build_count returns the build requests whose mode and recipe the service accepted, whatever their outcome. A request refused for its mode or for its recipe does not count: status() counts it as a refusal.
- none
- When it fails
- a negative result, and the error record
src/modules/system/recipes/main.odin:84
cache_hits
cache_hits() ->
cache_hits returns the builds that a cached realisation answered, from the local store or from a remote cache, with no build in the sandbox.
- none
- When it fails
- a negative result, and the error record
src/modules/system/recipes/main.odin:94
entry
entry()
entry initializes the delegated recipes service ring and loops over build and provenance commands until stopped.
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/system/recipes/main.odin:232
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | The holder of the role Recipes: the cache of the realisations and the recipes in its private store. See: Recipes, builders and the cache in the repository | |
| Other terms of its start grant set | on_demand = true | |
| Budget that it asks for |
| Working memory budget for the freestanding recipes service process, including local object staging and realisation tables. |
The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module (its line); the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).
Recipe_Head record of a module
A record of the module recipes: 56 bytes, aligned on 8 bytes, 0 bytes of padding.
output_kind_wordi6408 bytessource_date_unixi6488 bytesoutput_block_limiti64168 bytesbuilder_hashHash(32)2432 bytes
Table wire form
A wire form of the module contract: one word of a call. Records of one description that follow each other (a table).
Recipe_Input_Row record of a module
A record of the module recipes: 104 bytes, aligned on 8 bytes, 0 bytes of padding.
kind_wordi6408 byteshashHash(32)832 bytesnameText(64)4064 bytes
Bytes wire form
A wire form of the module contract: one word of a call. Bytes with no description.
Recipe_Reference record of a module
A record of the module recipes: 32 bytes, aligned on 1 bytes, 0 bytes of padding.
recipe_hashHash(32)032 bytes
Error_Record record of a module
A record of the module recipes: 56 bytes, aligned on 8 bytes, 0 bytes of padding.
kindi6408 bytesuniti6488 bytesoperationi64168 bytesargumenti64248 bytesvaluei64328 byteslimiti64408 bytesfoundi64488 bytes
Integer wire form
A wire form of the module contract: one word of a call. A signed integer of 64 bits, in a register.
Recipe_Build_Row record of a module
A record of the module recipes: 96 bytes, aligned on 8 bytes, 0 bytes of padding.
outcome_wordi6408 bytesrefusal_wordi6488 bytesoutput_kind_wordi64168 bytesmode_wordi64248 bytesrecipe_hashHash(32)3232 bytesoutput_hashHash(32)6432 bytes
Realisation_Row record of a module
A record of the module recipes: 112 bytes, aligned on 8 bytes, 0 bytes of padding.
origin_wordi6408 bytesoutput_kind_wordi6488 bytesrecipe_hashHash(32)1632 bytesoutput_hashHash(32)4832 bytessigner_public_keyHash(32)8032 bytes
Recipes_Status record of a module
A record of the module recipes: 56 bytes, aligned on 8 bytes, 0 bytes of padding.
total_buildsi6408 bytescache_hits_locali6488 bytescache_hits_remotei64168 byteslocal_buildsi64248 bytesverify_agreementsi64328 bytesverify_disagreementsi64408 bytestotal_refusalsi64488 bytes
