astrid-runtime/astrid · error
Compiled WASM binary is a symlink
Error message
Compiled WASM binary is a symlink: {} What it means
Artifact integrity guard in locate_wasm_binary: the compiled .wasm under target/<target>/<profile>/ exists but is a symlink rather than a real file. Symlinked outputs can be stale or point outside the target directory, so packaging is refused. Usually indicates an unusual build setup ( wrappers, ccache-style linking, or manual artifact placement).
Solutions
- Rebuild the crate; Cargo should emit a regular file artifact
- Remove any post-build steps that symlink the .wasm output
- Copy (not link) the artifact into place if a script relocates it
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at crates/astrid-build/src/rust.rs:629 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/9ef3a76a88455a07.
Report an issue: GitHub.
Appendix: source
Thrown at crates/astrid-build/src/rust.rs:629
.join(format!("{wasm_name}.wasm"));
let artifact_metadata = match fs::symlink_metadata(&candidate) {
Ok(metadata) => metadata,
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()
)
})?;View on GitHub (pinned to affd8760f4)