~bigbes/ci-cacher: 333189a2

archive: restore trees with read-only directories; bump to 0.2.2

DecodeDir applied each archived mode as its entry landed, so a 0555
directory became read-only the moment it was created and the first file
written into it failed with EACCES. That is not an edge case: the Go
module cache is 0555 directories and 0444 files throughout, and it is the
main thing dir download is pointed at. Build #295 died on the first cache
HIT of the new gomod key, having passed on the miss.

Directories are now created with the owner-write bit forced on and their
recorded mode applied after extraction finishes, deepest-first. Files are
written writable and chmod'ed after the copy, and a read-only file left
by an earlier restore is replaced rather than treated as an error —
re-restoring over a populated module cache is normal in CI.

Both tests fail against the previous DecodeDir with the same 'permission
denied' the build reported.

Eugene Blikh <bigbes@gmail.com> — 2026-08-06 22:16:13 UTC

Commit 333189a20b7bb2b7440b083e151afd24bb5a61d4view raw patch

Parent(s): 46be89f3

4 changed file(s)

FileStatus+
CHANGELOG.md M +15
VERSION M +1 -1
internal/archive/archive.go M +65 -3
internal/archive/archive_test.go M +110