{"record":{"id":"4eeabc9a0abc6cdf","repo":"astrid-runtime/astrid","slug":"cargo-completed-without-emitting-the-exact-release","errorCode":null,"errorMessage":"Cargo completed without emitting the exact release cdylib artifact {expected_filename}","messagePattern":"Cargo completed without emitting the exact release cdylib artifact (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust.rs","lineNumber":307,"sourceCode":"        );\n    }\n\n    let status = child.wait().context(\"Failed to wait for cargo build\")?;\n\n    if !status.success() {\n        bail!(\n            \"Cargo build failed. Set `[build] target = \\\"wasm32-unknown-unknown\\\"` (Astrid-canonical) or `wasm32-wasip2` in `.cargo/config.toml` and install the matching `rustup target` component.\"\n        );\n    }\n\n    artifacts.sort();\n    artifacts.dedup();\n    match artifacts.as_slice() {\n        [path] => Ok(CompiledWasm {\n            target,\n            path: path.clone(),\n        }),\n        [] => bail!(\n            \"Cargo completed without emitting the exact release cdylib artifact {expected_filename}\"\n        ),\n        _ => bail!(\n            \"Cargo emitted {} release cdylib artifacts named {expected_filename}; refusing to choose an ambiguous artifact\",\n            artifacts.len()\n        ),\n    }\n}\n\nfn inject_getrandom_for_target(target: &str) -> bool {\n    target == GETRANDOM_TARGET\n}\n\n/// Append the custom getrandom cfg without replacing any effective Cargo\n/// rustflags. Cargo's precedence is encoded-rustflags env, plain rustflags env,\n/// target-specific rustflags env, matching target config, then build\n/// rustflags. We modify only the first effective environment source. When\n/// config-derived flags are effective (including when `CARGO_BUILD_RUSTFLAGS`","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust.rs#L289-L325","documentation":"Fired by compile_wasm_with_target when cargo exits successfully but no release artifact matching the expected cdylib filename is found in metadata. Cargo produced something other than the required WASM output.","triggerScenarios":"Thrown at crates/astrid-build/src/rust.rs:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the crate has a cdylib target whose name matches the expected filename","Clean and rebuild `target/` to drop stale metadata","Verify the configured target triple emits the expected artifact"],"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"}