astrid-runtime/astrid · error
`cargo` is not installed or not in PATH. Rust compilation…
Error message
`cargo` is not installed or not in PATH. Rust compilation failed.
What it means
Environment prerequisite check in verify_cargo_available: spawning `cargo --version` failed, so the Rust toolchain is either not installed or not reachable via PATH. Raised before any compilation begins so the user gets a clear toolchain error instead of a cryptic cargo-spawn failure mid-build. Called by build.
Solutions
- Install Rust via rustup (https://rustup.rs)
- Ensure `cargo` is on PATH (`which cargo`)
- If using an isolated environment, install the Rust toolchain there too
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/astrid-build/src/rust.rs:106 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of astrid-runtime/astrid@affd8760f4 (2026-09-09).
Data as JSON: /api/errors/b32ffa58db0ada6a.
Report an issue: GitHub.
Appendix: source
Thrown at crates/astrid-build/src/rust.rs:106
Some(&wasm_path),
dir,
&asset_refs,
wit_staging.as_deref(),
)?;
crate::artifact::sign_archive_with_runtime_key(&out_file)?;
info!("Successfully built Rust capsule: {}", out_file.display());
Ok(())
}
/// Verify that `cargo` is installed and available on PATH.
fn verify_cargo_available() -> Result<()> {
if std::process::Command::new("cargo")
.arg("--version")
.output()
.is_err()
{
bail!("`cargo` is not installed or not in PATH. Rust compilation failed.");
}
Ok(())
}
/// Resolve package metadata for the crate in `dir`.
fn resolve_package_metadata(
dir: &Path,
) -> Result<(cargo_metadata::Metadata, String, String, String, PackageId)> {
// Resolve the full dependency graph (not no_deps) so we can locate
// the astrid-sdk source directory for WIT file bundling.
let meta = cargo_metadata::MetadataCommand::new()
.current_dir(dir)
.exec()
.context("Failed to parse Cargo metadata")?;
let package = meta
.packages
.iter()View on GitHub (pinned to affd8760f4)