{"record":{"id":"41d632c3f8d0460a","repo":"astrid-runtime/astrid","slug":"capsule-toml-component-declares-both-file-and-e","errorCode":null,"errorMessage":"Capsule.toml component declares both `file` and `entrypoint`; refusing an ambiguous executable path","messagePattern":"Capsule\\.toml component declares both `file` and `entrypoint`; refusing an ambiguous executable path","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust.rs","lineNumber":747,"sourceCode":"        return Ok(());\n    };\n\n    let Some(components) = component_item.as_array_of_tables_mut() else {\n        bail!(\"Capsule.toml component must be an array of tables\")\n    };\n    if components.len() != 1 {\n        bail!(\n            \"Capsule.toml declares {} components, but this build packages exactly one cdylib\",\n            components.len()\n        );\n    }\n    let component = components\n        .get_mut(0)\n        .context(\"Capsule.toml component array unexpectedly empty\")?;\n    let has_file = component.get(\"file\").is_some();\n    let has_entrypoint = component.get(\"entrypoint\").is_some();\n    if has_file && has_entrypoint {\n        bail!(\n            \"Capsule.toml component declares both `file` and `entrypoint`; refusing an ambiguous executable path\"\n        );\n    }\n\n    let key = if has_file {\n        \"file\"\n    } else if has_entrypoint {\n        \"entrypoint\"\n    } else {\n        \"file\"\n    };\n    if let Some(item) = component.get(key)\n        && item.as_str().is_none()\n    {\n        bail!(\"Capsule.toml component `{key}` must be a string\")\n    }\n    component.insert(key, toml_edit::value(packaged_name));\n    Ok(())","sourceCodeStart":729,"sourceCodeEnd":765,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust.rs#L729-L765","documentation":"Manifest-binding guard in bind_manifest_to_packaged_wasm: the [components] table in Capsule.toml declares both `file` and `entrypoint` for the single component, making the executable path ambiguous. Since the build packages exactly one cdylib whose path is known, the manifest must identify it via exactly one key; both present means a contradictory user edit and packaging aborts.","triggerScenarios":"Thrown at crates/astrid-build/src/rust.rs:747 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep only `file` (preferred for packaged cdylibs) and delete `entrypoint`","Or keep only `entrypoint` if that is your intended layout","Rebuild after making the component path unambiguous"],"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"}