{"record":{"id":"a3aafeb2b40c01cc","repo":"Morganamilo/paru","slug":"failed-to-parse-srcinfo","errorCode":null,"errorMessage":"failed to parse srcinfo \"{}\"","messagePattern":"failed to parse srcinfo \"(.+?)\"","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/pkgbuild.rs","lineNumber":277,"sourceCode":"\n        Ok(())\n    }\n\n    fn read_pkg(&self, config: &Config, path: &Path) -> Result<PkgbuildPkg> {\n        let srcinfo_path = path.join(\".SRCINFO\");\n\n        if !srcinfo_path.exists() {\n            self.generate_srcinfo(config, path)?;\n        }\n\n        let srcinfo = Srcinfo::from_path(&srcinfo_path);\n        match srcinfo {\n            Ok(srcinfo) => Ok(PkgbuildPkg {\n                repo: self.name.to_string(),\n                srcinfo,\n                path: path.to_path_buf(),\n            }),\n            Err(err) => Err(anyhow!(err).context(tr!(\n                \"failed to parse srcinfo \\\"{}\\\"\",\n                srcinfo_path.display().to_string()\n            ))),\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\npub struct PkgbuildRepos {\n    pub fetch: Fetch,\n    pub repos: Vec<PkgbuildRepo>,\n}\n\nimpl PkgbuildRepos {\n    pub fn new(fetch: Fetch) -> Self {\n        Self {\n            fetch,\n            repos: Vec::new(),","sourceCodeStart":259,"sourceCodeEnd":295,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/pkgbuild.rs#L259-L295","documentation":"read_pkg parses a .SRCINFO file with the srcinfo crate; on failure it wraps the parser error with context naming the srcinfo path. The message means the SRCINFO on disk is malformed or unreadable for the pkgbuild being processed.","triggerScenarios":"Calling read_pkg (via read_pkgs) on a repository/pkgbuild directory whose .SRCINFO fails srcinfo parsing — missing pkgbase/pkgname fields, bad field syntax, or truncated file.","commonSituations":"A partially-written .SRCINFO from an interrupted makepkg/pkgbuild run; hand-edited .SRCINFO with invalid keys; cloning a local repo whose .SRCINFO generation (makepkg --printsrcinfo) failed earlier.","solutions":["Regenerate the .SRCINFO: run `makepkg --printsrcinfo > .SRCINFO` in the pkgbuild directory.","Inspect the wrapped srcinfo error in the message to find the exact invalid line and fix it.","Verify required fields (pkgbase/pkgname, pkgver, pkgrel) are present and well-formed.","If the file is truncated, re-download/re-clone the pkgbuild source."],"exampleFix":"# before: fix the malformed .SRCINFO by regenerating\ncd ~/.cache/paru/clone/mypkg\nmakepkg --printsrcinfo > .SRCINFO\n# verify\nparu -G mypkg","handlingStrategy":"validation","validationCode":"let path = Path::new(dir).join(\".SRCINFO\");\nlet text = std::fs::read_to_string(&path)?;\nif !text.contains(\"pkgbase\") || !text.contains(\"pkgname\") {\n    panic!(\"{} missing required pkgbase/pkgname\", path.display());\n}","typeGuard":null,"tryCatchPattern":"// handle parse failure per-package without aborting the batch\nmatch read_pkgs(config, repos) {\n    Ok(pkgs) => pkgs,\n    Err(e) => {\n        eprintln!(\"{e:#}; regenerate with: makepkg --printsrcinfo > .SRCINFO\");\n        Vec::new(),\n    }\n}","preventionTips":["Regenerate .SRCINFO after any PKGBUILD edit.","Never hand-edit .SRCINFO files.","Interrupted builds: delete and re-clone the package directory."],"tags":["srcinfo","parsing","pkgbuild","arch-linux"],"backgroundTag":"json-parse-error","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}