Jguer/yay · error
cannot find PKGBUILD and .SRCINFO in directory
Error message
cannot find PKGBUILD and .SRCINFO in directory
What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at local_install.go:25 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Jguer/yay@328f4b4939 (2026-09-07).
Data as JSON: /api/errors/ac323b4f35e051c9.
Report an issue: GitHub.
Appendix: source
Thrown at local_install.go:25
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/Jguer/yay/v13/pkg/db"
"github.com/Jguer/yay/v13/pkg/dep"
"github.com/Jguer/yay/v13/pkg/runtime"
"github.com/Jguer/yay/v13/pkg/settings"
"github.com/Jguer/yay/v13/pkg/settings/exe"
"github.com/Jguer/yay/v13/pkg/settings/parser"
"github.com/Jguer/yay/v13/pkg/sync"
gosrc "github.com/Morganamilo/go-srcinfo"
"github.com/leonelquinteros/gotext"
)
var ErrNoBuildFiles = errors.New(gotext.Get("cannot find PKGBUILD and .SRCINFO in directory"))
func srcinfoExists(ctx context.Context,
cmdBuilder exe.ICmdBuilder, targetDir string,
) error {
srcInfoDir := filepath.Join(targetDir, ".SRCINFO")
pkgbuildDir := filepath.Join(targetDir, "PKGBUILD")
if _, err := os.Stat(srcInfoDir); err == nil {
if _, err := os.Stat(pkgbuildDir); err == nil {
return nil
}
}
if _, err := os.Stat(pkgbuildDir); err == nil {
// run makepkg to generate .SRCINFO
srcinfo, stderr, err := cmdBuilder.Capture(cmdBuilder.BuildMakepkgCmd(ctx, targetDir, "--printsrcinfo"))
if err != nil {
return fmt.Errorf("unable to generate .SRCINFO: %w - %s", err, stderr)
}View on GitHub (pinned to 328f4b4939)