{"record":{"id":"9ef3a76a88455a07","repo":"astrid-runtime/astrid","slug":"compiled-wasm-binary-is-a-symlink","errorCode":null,"errorMessage":"Compiled WASM binary is a symlink: {}","messagePattern":"Compiled WASM binary is a symlink: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust.rs","lineNumber":629,"sourceCode":"        .join(format!(\"{wasm_name}.wasm\"));\n    let artifact_metadata = match fs::symlink_metadata(&candidate) {\n        Ok(metadata) => metadata,\n        Err(error) if error.kind() == std::io::ErrorKind::NotFound => bail!(\n            \"Could not locate compiled WASM binary at `target/{target}/{PROFILE}/{wasm_name}.wasm` under configured target directory {}\",\n            target_root.display()\n        ),\n        Err(error) => {\n            return Err(error).with_context(|| {\n                format!(\n                    \"Failed to inspect compiled WASM binary {}\",\n                    candidate.display()\n                )\n            });\n        },\n    };\n\n    if artifact_metadata.file_type().is_symlink() {\n        bail!(\"Compiled WASM binary is a symlink: {}\", candidate.display());\n    }\n    if !artifact_metadata.is_file() {\n        bail!(\n            \"Compiled WASM binary is not a regular file: {}\",\n            candidate.display()\n        );\n    }\n\n    // A regular artifact beneath a symlinked parent could still resolve\n    // outside the configured root. Canonicalize only for containment; return\n    // Cargo's path so callers retain the authoritative configured location,\n    // including when the target root itself is a legitimate symlink.\n    let resolved_target_root = fs::canonicalize(target_root).with_context(|| {\n        format!(\n            \"Failed to resolve target directory {}\",\n            target_root.display()\n        )\n    })?;","sourceCodeStart":611,"sourceCodeEnd":647,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust.rs#L611-L647","documentation":"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).","triggerScenarios":"Thrown at crates/astrid-build/src/rust.rs:629 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}