internal/pkg: rename inputs method
Test / Create distribution (push) Successful in 1m2s
Test / Sandbox (push) Successful in 2m56s
Test / ShareFS (push) Successful in 4m2s
Test / Hakurei (push) Successful in 4m14s
Test / Sandbox (race detector) (push) Successful in 5m46s
Test / Hakurei (race detector) (push) Successful in 6m47s
Test / Flake checks (push) Successful in 1m12s

Inputs is more correct than dependencies in the current terminology.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-07-02 22:59:40 +09:00
parent 3ba6609444
commit 4ad1b75382
11 changed files with 38 additions and 36 deletions
+8 -6
View File
@@ -405,13 +405,13 @@ type Artifact interface {
// Result must remain identical across multiple invocations.
Params(ctx *IContext)
// Dependencies returns a slice of [Artifact] that the current instance
// depends on to produce its contents.
// Inputs returns a slice of [Artifact] the current instance has access to
// while producing its output.
//
// Callers must not modify the retuned slice.
//
// Result must remain identical across multiple invocations.
Dependencies() []Artifact
Inputs() []Artifact
// IsExclusive returns whether the [Artifact] is exclusive. Exclusive
// artifacts might not run in parallel with each other, and are still
@@ -2180,7 +2180,7 @@ func (c *Cache) cure(a Artifact, curesExempt bool) (
break
case FloodArtifact:
deps := a.Dependencies()
deps := a.Inputs()
f := FContext{t, make(map[Artifact]cureRes, len(deps))}
var wg sync.WaitGroup
@@ -2697,6 +2697,8 @@ func IsCollected(err error) bool { return errors.As(err, new(Collected)) }
// [pkg.Artifact]. It returns [Collected].
type Collect []Artifact
var _ Artifact = new(Collect)
// Cure returns [Collected].
func (*Collect) Cure(*FContext) error { return Collected{} }
@@ -2706,8 +2708,8 @@ func (*Collect) Kind() Kind { return kindCollection }
// Params is a noop: dependencies are already represented in the header.
func (*Collect) Params(*IContext) {}
// Dependencies returns [Collect] as is.
func (c *Collect) Dependencies() []Artifact { return *c }
// Inputs returns [Collect] as is.
func (c *Collect) Inputs() []Artifact { return *c }
// IsExclusive returns false: Cure is a noop.
func (*Collect) IsExclusive() bool { return false }