Skip to main content

verify_extension_command

Function verify_extension_command 

Source
pub fn verify_extension_command(
    manifest: &PluginManifest,
    plugin_dir: &Path,
) -> Result<Option<PathBuf>, CommandVerifyError>
Expand description

Verify that the extension binary declared by crate::extensions::manifest::ExtensionManifest::command actually exists and is executable inside plugin_dir. Used as the post-condition check after run_setup_script succeeds, so a build script that exits 0 but doesn’t produce the promised binary surfaces a clear error instead of silently breaking spawn at runtime.

Mirrors the host-side resolution rules in crate::extensions::manager except absolute plugin extension commands are rejected: shipped extension binaries must be plugin-relative.

  • command is absolute: reject
  • command is bare (no path separator): skip — it’s a PATH lookup, not a plugin-shipped artifact
  • command is relative with separators: join with plugin_dir, canonicalize, ensure it stays inside plugin_dir, then verify

Returns Ok(None) when the manifest declares no extension or the command is a bare PATH lookup (nothing to verify). Returns Ok(Some(resolved_path)) on successful verification.