Skip to main content

Module precompile

Module precompile 

Source
Expand description

Compiling WASM artifacts ahead of their first launch.

mur install and mur precompile hand the payloads one command installs or names to Precompiler::precompile_all, which compiles each as Precompiler::precompile does. Each compiled form is stored through the same [CompiledForms] handle and the same stage_root_component that stage_session uses, on an engine from the same build_engine. A form written here therefore has the name, mode, sidecar and stamp a launch would have given it, and launch cannot tell the two apart. This module reads and writes no file itself.

The key is the sha256 of the payload bytes in hand, recomputed here, so a form is only ever compiled from the root wasm of the payload it is named after, as the key contract in compiled_forms requires.

Structs§

PrecompileItem
One payload of a Precompiler::precompile_all batch: the artifact name@version whose payload bytes are payload.
Precompiler
An engine and compiled-forms handle for storing the forms of installed artifacts.

Enums§

Precompiled
What Precompiler::precompile did with one payload. Serialised in snake_case, the outcome mur precompile --json reports.