internal/pkg: use correct artifact count
All checks were successful
Test / Create distribution (push) Successful in 46s
Test / Sandbox (push) Successful in 2m47s
Test / ShareFS (push) Successful in 4m43s
Test / Sandbox (race detector) (push) Successful in 5m15s
Test / Hpkg (push) Successful in 5m26s
Test / Hakurei (push) Successful in 5m32s
Test / Hakurei (race detector) (push) Successful in 7m36s
Test / Flake checks (push) Successful in 1m42s

This updates buffer sizes and counters to use correct total artifact count.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-08 08:45:37 +09:00
parent 23df2ab999
commit 863e6f5db6

View File

@@ -224,6 +224,11 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
paths[i].src = make([]*check.Absolute, len(p.A))
}
var artifactCount int
for _, p := range a.paths {
artifactCount += len(p.A)
}
if len(paths) > 0 {
type cureArtifact struct {
// Index of pending Artifact in paths.
@@ -231,7 +236,7 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
// Pending artifact.
a Artifact
}
ac := make(chan cureArtifact, len(paths))
ac := make(chan cureArtifact, artifactCount)
for i, p := range a.paths {
for j, d := range p.A {
ac <- cureArtifact{[2]int{i, j}, d}
@@ -265,7 +270,7 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
}
var count int
errs := make([]error, 0, len(paths))
errs := make([]error, 0, artifactCount)
for cr := range res {
count++
@@ -275,7 +280,7 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
paths[cr.index[0]].src[cr.index[1]] = cr.pathname
}
if count == len(paths) {
if count == artifactCount {
break
}
}