Skip to content

Do not use tar --recursive-unlink when unpacking layer sources - #168

Merged
viktordick merged 1 commit into
mainfrom
fix-recursive-unlink
Aug 5, 2026
Merged

viktordick merged 1 commit into
mainfrom
fix-recursive-unlink

Conversation

@viktordick

Copy link
Copy Markdown
Collaborator

GNU tar before 1.35 (e.g. Ubuntu 22.04) tries to remove the extraction root itself if the tarball contains "." as a member, which fails with

tar: .: Cannot unlink: Invalid argument

and makes the whole layer-init/layer-update run fail. Clear the target directory in Python instead. This is equivalent: --recursive-unlink emptied the same hierarchy, and tar rewrites every member on extraction in any case, so no additional disk load.

GNU tar before 1.35 (e.g. Ubuntu 22.04) tries to remove the extraction
root itself if the tarball contains "." as a member, which fails with

    tar: .: Cannot unlink: Invalid argument

and makes the whole layer-init/layer-update run fail. Clear the target
directory in Python instead. This is equivalent: --recursive-unlink
emptied the same hierarchy, and tar rewrites every member on extraction
in any case, so no additional disk load.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@Wiseqube Wiseqube left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@viktordick
viktordick merged commit 757a427 into main Aug 5, 2026
5 checks passed
@viktordick
viktordick deleted the fix-recursive-unlink branch August 6, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants