internal/pkg: move dependency flooding to cache
All checks were successful
Test / Create distribution (push) Successful in 47s
Test / Sandbox (push) Successful in 2m50s
Test / ShareFS (push) Successful in 4m46s
Test / Sandbox (race detector) (push) Successful in 5m16s
Test / Hpkg (push) Successful in 5m24s
Test / Hakurei (push) Successful in 5m40s
Test / Hakurei (race detector) (push) Successful in 7m27s
Test / Flake checks (push) Successful in 1m42s

This imposes a hard upper limit to concurrency during dependency satisfaction and moves all dependency-related code out of individual implementations of Artifact. This change also includes ctx and msg as part of Cache.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-09 01:51:39 +09:00
parent f2430b5f5e
commit f712466714
11 changed files with 680 additions and 409 deletions

View File

@@ -121,8 +121,8 @@ func checkTarHTTP(
tarDir := stubArtifact{
kind: pkg.KindExec,
params: []byte("directory containing a single regular file"),
cure: func(c *pkg.CureContext) error {
work := c.GetWorkDir()
cure: func(t *pkg.TContext) error {
work := t.GetWorkDir()
if err := os.MkdirAll(work.String(), 0700); err != nil {
return err
}
@@ -136,8 +136,8 @@ func checkTarHTTP(
tarDirMulti := stubArtifact{
kind: pkg.KindExec,
params: []byte("directory containing a multiple entries"),
cure: func(c *pkg.CureContext) error {
work := c.GetWorkDir()
cure: func(t *pkg.TContext) error {
work := t.GetWorkDir()
if err := os.MkdirAll(work.Append(
"garbage",
).String(), 0700); err != nil {
@@ -153,8 +153,8 @@ func checkTarHTTP(
tarDirType := stubArtifact{
kind: pkg.KindExec,
params: []byte("directory containing a symbolic link"),
cure: func(c *pkg.CureContext) error {
work := c.GetWorkDir()
cure: func(t *pkg.TContext) error {
work := t.GetWorkDir()
if err := os.MkdirAll(work.String(), 0700); err != nil {
return err
}
@@ -197,7 +197,7 @@ func checkTarHTTP(
{"error passthrough", pkg.NewTar(stubArtifact{
kind: pkg.KindExec,
params: []byte("doomed artifact"),
cure: func(c *pkg.CureContext) error {
cure: func(t *pkg.TContext) error {
return stub.UniqueError(0xcafe)
},
}, pkg.TarGzip), nil, pkg.Checksum{}, stub.UniqueError(0xcafe)},