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

@@ -6,7 +6,6 @@ import (
"io"
"net/http"
"sync"
"syscall"
)
// An httpArtifact is an [Artifact] backed by a [http] url string. The method is
@@ -100,14 +99,9 @@ func (a *httpArtifact) do() (data []byte, err error) {
return
}
// Cure returns syscall.ENOTSUP. Callers should use Data instead.
func (a *httpArtifact) Cure(*CureContext) error {
return syscall.ENOTSUP
}
// Data completes the http request and returns the resulting response body read
// Cure completes the http request and returns the resulting response body read
// to EOF. Data does not interact with the filesystem.
func (a *httpArtifact) Data() (data []byte, err error) {
func (a *httpArtifact) Cure() (data []byte, err error) {
a.mu.Lock()
defer a.mu.Unlock()