diff options
Diffstat (limited to 'internal/pkg/pkg.go')
| -rw-r--r-- | internal/pkg/pkg.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/internal/pkg/pkg.go b/internal/pkg/pkg.go index 9a8dc9fd..a8fb91ba 100644 --- a/internal/pkg/pkg.go +++ b/internal/pkg/pkg.go @@ -22,6 +22,7 @@ import ( "slices" "strings" "sync" + "sync/atomic" "syscall" "testing" "unique" @@ -466,6 +467,11 @@ const ( // pathnames allocated during [Cache.Cure]. dirTemp = "temp" + // dirExecScratch is the directory name appended to Cache.base for scratch + // space setting up the container started by [Cache.EnterExec]. Exclusivity + // via Cache.inExec. + dirExecScratch = "scratch" + // checksumLinknamePrefix is prepended to the encoded [Checksum] value // of an [Artifact] when creating a symbolic link to dirChecksum. checksumLinknamePrefix = "../" + dirChecksum + "/" @@ -481,7 +487,7 @@ type cureRes struct { // subject to the cures limit. Values pointed to by result addresses are safe // to access after the [sync.WaitGroup] associated with this pendingArtifactDep // is done. pendingArtifactDep must not be reused or modified after it is sent -// to Cache.cureDep. +// to cure. type pendingArtifactDep struct { // Dependency artifact populated during [Cache.Cure]. a Artifact @@ -553,6 +559,9 @@ type Cache struct { unlock func() // Synchronises calls to Close. closeOnce sync.Once + + // Whether EnterExec has not yet returned. + inExec atomic.Bool } // IsStrict returns whether the [Cache] strictly verifies checksums. |
