internal/pkg: place ephemeral upperdir in tmp
All checks were successful
Test / Create distribution (push) Successful in 48s
Test / Sandbox (push) Successful in 2m58s
Test / ShareFS (push) Successful in 4m58s
Test / Sandbox (race detector) (push) Successful in 5m31s
Test / Hakurei (push) Successful in 5m40s
Test / Hpkg (push) Successful in 5m38s
Test / Hakurei (race detector) (push) Successful in 7m36s
Test / Flake checks (push) Successful in 1m40s

This enables the use of directories made writable this way as scratch space.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-01-08 08:23:16 +09:00
parent 7bd4d7d0e6
commit 23df2ab999

View File

@@ -7,6 +7,7 @@ import (
"os"
"runtime"
"slices"
"strconv"
"syscall"
"time"
@@ -325,7 +326,18 @@ func (a *execArtifact) cure(c *CureContext, hostNet bool) (err error) {
}
if a.paths[i].W {
z.OverlayEphemeral(b.dst, b.src...)
tempUpper, tempWork := temp.Append(
".upper", strconv.Itoa(i),
), temp.Append(
".work", strconv.Itoa(i),
)
if err = os.MkdirAll(tempUpper.String(), 0700); err != nil {
return
}
if err = os.MkdirAll(tempWork.String(), 0700); err != nil {
return
}
z.Overlay(b.dst, tempUpper, tempWork, b.src...)
} else if len(b.src) == 1 {
z.Bind(b.src[0], b.dst, 0)
} else {