MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / validate_module_link_metadata

Function validate_module_link_metadata

xtask/src/main.rs:7582–7626  ·  view source on GitHub ↗
(module: &BuildModuleManifestOut)

Source from the content-addressed store, hash-verified

7580}
7581
7582fn validate_module_link_metadata(module: &BuildModuleManifestOut) -> Result<()> {
7583 if module.link.exports.is_empty() {
7584 bail!("{} has no WASM exports", module.name);
7585 }
7586
7587 match module.kind.as_str() {
7588 "runtime" => {
7589 let missing = required_runtime_abi_exports()
7590 .iter()
7591 .copied()
7592 .filter(|export| !has_wasm_export(&module.link, export))
7593 .collect::<Vec<_>>();
7594 if !missing.is_empty() {
7595 bail!(
7596 "{} is missing required Rust/WASIX ABI exports: {}",
7597 module.name,
7598 missing.join(", ")
7599 );
7600 }
7601 for banned in ["pgl_initdb", "pgl_backend", "PostgresRecoverProtocolError"] {
7602 if has_wasm_export(&module.link, banned) {
7603 bail!(
7604 "{} exports legacy builder-branch lifecycle entrypoint {banned}",
7605 module.name
7606 );
7607 }
7608 }
7609 }
7610 "runtime-support" | "extension" => {
7611 if !module.link.has_dylink0 {
7612 bail!("{} is not a WASM dynamic-linking side module", module.name);
7613 }
7614 if module.link.imports.is_empty() && module.link.dylink_imports.is_empty() {
7615 bail!(
7616 "{} has no imports; side-module linkage is suspicious",
7617 module.name
7618 );
7619 }
7620 }
7621 "tool" => {}
7622 other => bail!("{} has unknown build output kind {other}", module.name),
7623 }
7624
7625 Ok(())
7626}
7627
7628fn validate_build_output_link_closure(outputs: &BuildOutputs) -> Result<()> {
7629 let runtime = outputs

Callers 2

write_manifestMethod · 0.85

Calls 3

has_wasm_exportFunction · 0.85
iterMethod · 0.80

Tested by

no test coverage detected