Jguer/yay · error

failed to parse .SRCINFO

Error message

failed to parse .SRCINFO: %w

What it means

Returned by installLocalPKGBUILD when gosrc.ParseFile fails to parse the .SRCINFO file in a target directory (which srcinfoExists just confirmed exists or generated). The parser error is wrapped, so the message reveals the concrete syntax or format problem — typically malformed key/value lines, bad quoting, or an .SRCINFO produced by an incompatible makepkg version.

Solutions

  1. Delete the stale .SRCINFO and let yay regenerate it via makepkg --printsrcinfo
  2. Regenerate manually with 'makepkg --printsrcinfo > .SRCINFO' to inspect the file
  3. Update makepkg to a version matching the .SRCINFO format
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at local_install.go:80 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Jguer/yay@328f4b4939 (2026-09-07). Data as JSON: /api/errors/36336c0ccb9caefc. Report an issue: GitHub.

Appendix: source

Thrown at local_install.go:80

	cmdArgs *parser.Arguments,
	dbExecutor db.Executor,
) error {
	aurCache := run.AURClient
	noCheck := strings.Contains(run.Cfg.MFlags, "--nocheck")

	if len(cmdArgs.Targets) < 1 {
		return errors.New(gotext.Get("no target directories specified"))
	}

	srcInfos := map[string]*gosrc.Srcinfo{}
	for _, targetDir := range cmdArgs.Targets {
		if err := srcinfoExists(ctx, run.CmdBuilder, targetDir); err != nil {
			return err
		}

		pkgbuild, err := gosrc.ParseFile(filepath.Join(targetDir, ".SRCINFO"))
		if err != nil {
			return fmt.Errorf("%s: %w", gotext.Get("failed to parse .SRCINFO"), err)
		}

		srcInfos[targetDir] = pkgbuild
	}

	grapher := dep.NewGrapher(dbExecutor, aurCache, false, settings.NoConfirm,
		cmdArgs.ExistsDouble("d", "nodeps"), noCheck, cmdArgs.ExistsArg("needed"),
		run.Logger.Child("grapher"))
	graph, err := grapher.GraphFromSrcInfos(ctx, nil, srcInfos)
	if err != nil {
		return err
	}

	opService := sync.NewOperationService(ctx, dbExecutor, run)
	var errs []error
	targets := graph.TopoSortedLayers(func(name string, ii *dep.InstallInfo) error {
		if ii.Source == dep.Missing {
			errs = append(errs, fmt.Errorf("%w: %s %s", ErrPackagesNotFound, name, ii.Version))

View on GitHub (pinned to 328f4b4939)