Jguer/yay · error · ErrSelfReferential

self-referential dependencies not allowed

Error message

 self-referential dependencies not allowed

What it means

Graph API sentinel error returned by Graph.DependOn when the child and parent arguments are the same node, i.e. an attempt to record that a package depends on itself. It is a structural integrity check that fires before any edge is added and prevents corrupting the topological sort.

Solutions

  1. Remove the self-referencing entry from the dependency list of the package
  2. Fix the data source (PKGBUILD depends array or repo metadata) that produced the self-dependency
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at pkg/dep/topo/errors.go:7 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/8a629ace78a00df9. Report an issue: GitHub.

Appendix: source

Thrown at pkg/dep/topo/errors.go:7

package topo

import "errors"

var (
	// ErrSelfReferential is returned when attempting to create an edge where a node depends on itself.
	ErrSelfReferential = errors.New(" self-referential dependencies not allowed")

	// ErrConflictingAlias is reserved for when a "provides" alias is defined more than once.
	// Note: current Graph APIs overwrite provides entries; this error is not currently returned.
	ErrConflictingAlias = errors.New(" alias already defined")

	// ErrCircular is returned when attempting to create an edge that would introduce a cycle.
	ErrCircular = errors.New(" circular dependencies not allowed")
)

View on GitHub (pinned to 328f4b4939)