{"record":{"id":"ac323b4f35e051c9","repo":"Jguer/yay","slug":"cannot-find-pkgbuild-and-srcinfo-in-directory","errorCode":null,"errorMessage":"cannot find PKGBUILD and .SRCINFO in directory","messagePattern":"cannot find PKGBUILD and \\.SRCINFO in directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"local_install.go","lineNumber":25,"sourceCode":"\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"path/filepath\"\n\t\"strings\"\n\n\t\"github.com/Jguer/yay/v13/pkg/db\"\n\t\"github.com/Jguer/yay/v13/pkg/dep\"\n\t\"github.com/Jguer/yay/v13/pkg/runtime\"\n\t\"github.com/Jguer/yay/v13/pkg/settings\"\n\t\"github.com/Jguer/yay/v13/pkg/settings/exe\"\n\t\"github.com/Jguer/yay/v13/pkg/settings/parser\"\n\t\"github.com/Jguer/yay/v13/pkg/sync\"\n\n\tgosrc \"github.com/Morganamilo/go-srcinfo\"\n\t\"github.com/leonelquinteros/gotext\"\n)\n\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}","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/Jguer/yay/blob/328f4b4939fb35f38c2f7c7ce3b8638a839bafa5/local_install.go#L7-L43","documentation":"Sentinel error (ErrNoBuildFiles) meaning a directory passed as a local build target contains neither a readable .SRCINFO nor a PKGBUILD that could be used to generate one. srcinfoExists stats both files; when both are absent the wrapped error names the offending directory. It fires before any build attempt, purely on filesystem presence checks.","triggerScenarios":"Thrown at local_install.go:25 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["cd into the directory containing the PKGBUILD and re-run 'yay -B .'","Clone or download the PKGBUILD from the AUR or ABS into the target directory","Verify the directory path was typed correctly"],"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"}