Jguer/yay · error

unable to write .SRCINFO

Error message

unable to write .SRCINFO: %w

What it means

Returned by srcinfoExists when writing the generated .SRCINFO text to disk via os.WriteFile fails; the underlying filesystem error is wrapped. Makepkg produced valid output but the file at targetDir/.SRCINFO could not be persisted — typically a permissions issue, a read-only mount, or a full disk. Note the file is written with 0o600 permissions.

Solutions

  1. Check write permissions on the target directory
  2. Free disk space if the filesystem is full
  3. Ensure the directory is not on a read-only mount
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at local_install.go:50 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/b83a6c8af4bd3089. Report an issue: GitHub.

Appendix: source

Thrown at local_install.go:50

	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)
		}

		if srcinfo == "" {
			return fmt.Errorf("generated .SRCINFO is empty, check your PKGBUILD for errors")
		}

		if err := os.WriteFile(srcInfoDir, []byte(srcinfo), 0o600); err != nil {
			return fmt.Errorf("unable to write .SRCINFO: %w", err)
		}

		return nil
	}

	return fmt.Errorf("%w: %s", ErrNoBuildFiles, targetDir)
}

func installLocalPKGBUILD(
	ctx context.Context,
	run *runtime.Runtime,
	cmdArgs *parser.Arguments,
	dbExecutor db.Executor,
) error {
	aurCache := run.AURClient
	noCheck := strings.Contains(run.Cfg.MFlags, "--nocheck")

	if len(cmdArgs.Targets) < 1 {

View on GitHub (pinned to 328f4b4939)