{"record":{"id":"dc393d519d59aafc","repo":"astrid-runtime/astrid","slug":"cargo-configuration-include-cycle-detected-at","errorCode":null,"errorMessage":"Cargo configuration include cycle detected at {}","messagePattern":"Cargo configuration include cycle detected at (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-build/src/rust/config.rs","lineNumber":145,"sourceCode":"    build_flags: Option<ParsedRustflags>,\n    target_entries: Vec<(String, ParsedRustflags)>,\n}\n\n#[derive(Default)]\nstruct CargoConfigLoader {\n    active: HashSet<PathBuf>,\n}\n\nimpl CargoConfigLoader {\n    fn load(&mut self, path: &Path, state: &mut CargoConfigState) -> Result<()> {\n        let Some(content) = read_optional_config(path)? else {\n            return Ok(());\n        };\n        let canonical = path\n            .canonicalize()\n            .with_context(|| format!(\"Failed to resolve Cargo configuration {}\", path.display()))?;\n        if !self.active.insert(canonical.clone()) {\n            bail!(\n                \"Cargo configuration include cycle detected at {}\",\n                canonical.display()\n            );\n        }\n\n        let result = self.load_content(&content, &canonical, state);\n        self.active.remove(&canonical);\n        result\n    }\n\n    fn load_content(\n        &mut self,\n        content: &str,\n        path: &Path,\n        state: &mut CargoConfigState,\n    ) -> Result<()> {\n        let doc = content\n            .parse::<toml_edit::DocumentMut>()","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-build/src/rust/config.rs#L127-L163","documentation":"Fired by CargoConfigLoader::load when an include chain re-enters a config file already being loaded (tracked by canonical path in the `active` set). Cargo config `include` directives form a cycle, so loading would recurse forever.","triggerScenarios":"Thrown at crates/astrid-build/src/rust/config.rs:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Break the include cycle in your `.cargo/config.toml` files","Remove the self- or mutual `include` directive","Restructure config layering so includes form a DAG"],"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"}