Expand description
Producing the two files a plugin release carries.
This is the mirror image of crate::install: instead of turning a published crate
into a cdylib on the user’s machine, it turns a checkout into the assets that let
crate::install::prebuilt skip the build entirely.
{crate}-{version}-{target}.{so|dylib|dll} <-- the cdylib
{crate}-{version}-{target}.toml <-- the plugin manifest, verbatim§Why these names
crate::install::prebuilt builds its download URL by putting these two names after
.../releases/download/v{version}/. Producing and consuming are one convention:
change either side alone and every release silently falls back to building from
source. Nothing here may be renamed without renaming it there too.
§What it does
cargo metadatathe plugin’s manifest, for the crate name and version.- Check that the plugin manifest beside it declares the same version — a manifest
that lags behind
Cargo.tomlwould publish assets nobody can consume. - Generate the wrapper — the same one
crate::installbuilds, coming from the privatewrappermodule — with the plugin as a path dependency, andcargo build --release --target <triple>it. - Copy the cdylib and the plugin manifest into the output directory under the names
above, and — when the build target is this machine —
dlopenthe result to prove it really exports the entry symbol.
A failed build leaves the generated wrapper in the temp directory, which is where someone looks to see why; a successful one removes it again.
§Layout
The naming convention above is written down once, in PackedAssets::base_name.
naming says where the generated wrapper is built, which is a lifetime question
rather than a naming one.
Structs§
- Pack
Options - Options for
build. - Packed
Assets - The two files that were written.
Functions§
- build
- Builds a plugin checkout into the two files a release carries.