{"record":{"id":"332d4e0d8f6ceeb9","repo":"Jguer/yay","slug":"generated-srcinfo-is-empty-check-your-pkgbuild-f","errorCode":null,"errorMessage":"generated .SRCINFO is empty, check your PKGBUILD for errors","messagePattern":"generated \\.SRCINFO is empty, check your PKGBUILD for errors","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"local_install.go","lineNumber":46,"sourceCode":"\tcmdBuilder exe.ICmdBuilder, targetDir string,\n) error {\n\tsrcInfoDir := filepath.Join(targetDir, \".SRCINFO\")\n\tpkgbuildDir := filepath.Join(targetDir, \"PKGBUILD\")\n\tif _, err := os.Stat(srcInfoDir); err == nil {\n\t\tif _, err := os.Stat(pkgbuildDir); err == nil {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tif _, err := os.Stat(pkgbuildDir); err == nil {\n\t\t// run makepkg to generate .SRCINFO\n\t\tsrcinfo, stderr, err := cmdBuilder.Capture(cmdBuilder.BuildMakepkgCmd(ctx, targetDir, \"--printsrcinfo\"))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"unable to generate .SRCINFO: %w - %s\", err, stderr)\n\t\t}\n\n\t\tif srcinfo == \"\" {\n\t\t\treturn fmt.Errorf(\"generated .SRCINFO is empty, check your PKGBUILD for errors\")\n\t\t}\n\n\t\tif err := os.WriteFile(srcInfoDir, []byte(srcinfo), 0o600); err != nil {\n\t\t\treturn fmt.Errorf(\"unable to write .SRCINFO: %w\", err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"%w: %s\", ErrNoBuildFiles, targetDir)\n}\n\nfunc installLocalPKGBUILD(\n\tctx context.Context,\n\trun *runtime.Runtime,\n\tcmdArgs *parser.Arguments,\n\tdbExecutor db.Executor,\n) error {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/local_install.go#L28-L64","documentation":"Returned by srcinfoExists when 'makepkg --printsrcinfo' exits successfully but produces empty output, meaning no .SRCINFO content could be derived from the PKGBUILD. The guard fires on the empty-string check before any file is written; it usually indicates a PKGBUILD that parses far enough to run but defines no usable package metadata.","triggerScenarios":"Thrown at local_install.go:46 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the PKGBUILD for missing or malformed pkgname/pkgver/source fields","Test with 'makepkg --printsrcinfo | head' to confirm empty output","Regenerate or fix the PKGBUILD from its upstream source"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"328f4b4939fb35f38c2f7c7ce3b8638a839bafa5","analyzedAt":"2026-09-07T16:45:12.608Z","contentChangedAt":"2026-09-07T16:45:12.608Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}