{"record":{"id":"dfa992de5ee9115b","repo":"Jguer/yay","slug":"unable-to-generate-srcinfo-w-s","errorCode":null,"errorMessage":"unable to generate .SRCINFO: %w - %s","messagePattern":"unable to generate \\.SRCINFO: %w - (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"local_install.go","lineNumber":42,"sourceCode":"\nvar ErrNoBuildFiles = errors.New(gotext.Get(\"cannot find PKGBUILD and .SRCINFO in directory\"))\n\nfunc srcinfoExists(ctx context.Context,\n\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,","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/local_install.go#L24-L60","documentation":"Returned by srcinfoExists when a PKGBUILD exists but no .SRCINFO does, and running 'makepkg --printsrcinfo' via the command builder fails. The wrapped error is the makepkg execution failure and stderr is appended, so the message shows why source-info generation failed — commonly a broken PKGBUILD, missing build tooling, or a makepkg syntax error.","triggerScenarios":"Thrown at local_install.go:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Run 'makepkg --printsrcinfo' manually in the target directory to see the failure","Fix syntax or sourcing errors in the PKGBUILD","Ensure makepkg and its dependencies (bash, pacman) are installed"],"exampleFix":null,"handlingStrategy":"fallback","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"}