Skip to main content

installed_modules

Function installed_modules 

Source
pub fn installed_modules(store_root: &Path) -> Vec<PathBuf>
Expand description

Every installed .wasm module under the store, sorted for determinism.

Sorting is not cosmetic: registration order decides which compressor wins a name collision, and #498 requires the same corpus to produce the same answer on every run.

Gated on wasm: this exists to feed the module loader, and a build without that feature (the lean-ctx-embed facade, for one) has nothing to feed. addon list deliberately does not use it — the CLI groups by name and version, which this flat list cannot express. Every module the extension registry should load: one version per addon.

The store keeps versions side by side, like every other pack kind, so after an upgrade @ns/demo/1.0.0 and @ns/demo/1.1.0 both exist on disk. Walking the whole tree would hand the registry two modules with the same file stem and let load order decide which one wins — and load order was sorted paths, where "10.0.0" < "9.0.0", so upgrading 9 to 10 would silently keep running version 9. Old code that keeps running is the failure this whole channel is careful about elsewhere; it should not arrive through the back door.

One version is chosen per addon by directory mtime — “the one you installed last”. Not by parsing the version: the manifest contract calls version author-declared and free-form, so it is not reliably orderable, whereas the install that wrote the directory is a fact.