astrid-runtime/astrid · error

Compiled WASM binary is not a regular file

Error message

Compiled WASM binary is not a regular file: {}

What it means

Sibling integrity guard in locate_wasm_binary: the .wasm candidate's metadata shows it is neither a regular file nor a symlink (e.g. a directory, fifo, or device node occupies the expected artifact path). The builder refuses to package anything but a regular compiled binary. Practically means something overwrote or squatted on the expected output path.

Solutions

  1. Clean the target directory and rebuild so a real .wasm file is emitted
  2. Check what occupies the expected artifact path
  3. Ensure no script replaces the artifact with a non-file
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/astrid-build/src/rust.rs:632 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/c85f4df886d9bc50. Report an issue: GitHub.

Appendix: source

Thrown at crates/astrid-build/src/rust.rs:632

        Err(error) if error.kind() == std::io::ErrorKind::NotFound => bail!(
            "Could not locate compiled WASM binary at `target/{target}/{PROFILE}/{wasm_name}.wasm` under configured target directory {}",
            target_root.display()
        ),
        Err(error) => {
            return Err(error).with_context(|| {
                format!(
                    "Failed to inspect compiled WASM binary {}",
                    candidate.display()
                )
            });
        },
    };

    if artifact_metadata.file_type().is_symlink() {
        bail!("Compiled WASM binary is a symlink: {}", candidate.display());
    }
    if !artifact_metadata.is_file() {
        bail!(
            "Compiled WASM binary is not a regular file: {}",
            candidate.display()
        );
    }

    // A regular artifact beneath a symlinked parent could still resolve
    // outside the configured root. Canonicalize only for containment; return
    // Cargo's path so callers retain the authoritative configured location,
    // including when the target root itself is a legitimate symlink.
    let resolved_target_root = fs::canonicalize(target_root).with_context(|| {
        format!(
            "Failed to resolve target directory {}",
            target_root.display()
        )
    })?;
    let resolved_candidate = fs::canonicalize(&candidate).with_context(|| {
        format!(
            "Failed to resolve compiled WASM binary {}",

View on GitHub (pinned to affd8760f4)