Skip to content

[v3] - fix(windows): use 7za-only archive extraction for compressed tarballs#1175

Open
luthermonson wants to merge 1 commit into
crazywhalecc:v3from
luthermonson:pr/win-7za-extraction
Open

[v3] - fix(windows): use 7za-only archive extraction for compressed tarballs#1175
luthermonson wants to merge 1 commit into
crazywhalecc:v3from
luthermonson:pr/win-7za-extraction

Conversation

@luthermonson
Copy link
Copy Markdown
Contributor

The previous implementation piped 7za output to Windows' built-in tar.exe to handle gz/xz/bz2 tarballs. This fails on certain archives containing symlinks: Windows tar.exe cannot create symlinks unless the build is running with Developer Mode enabled or with admin privileges, and a failure mid-extract leaves the source tree in a broken state.

Replace the pipeline with a two-pass 7za extraction (compressed wrapper then inner .tar) into a temp directory, with strip-components handled in PHP. 7za silently skips symlinks during tar extraction, which is the desired behavior for spc's source preparation - the symlinks in question are documentation or build-system artifacts that aren't needed for the static build.

The previous implementation piped 7za output to Windows' built-in
tar.exe to handle gz/xz/bz2 tarballs. This fails on certain archives
containing symlinks: Windows tar.exe cannot create symlinks unless the
build is running with Developer Mode enabled or with admin privileges,
and a failure mid-extract leaves the source tree in a broken state.

Replace the pipeline with a two-pass 7za extraction (compressed wrapper
then inner .tar) into a temp directory, with strip-components handled
in PHP. 7za silently skips symlinks during tar extraction, which is
the desired behavior for spc's source preparation - the symlinks in
question are documentation or build-system artifacts that aren't
needed for the static build.
@henderkes henderkes requested a review from crazywhalecc May 28, 2026 05:09
@crazywhalecc
Copy link
Copy Markdown
Owner

crazywhalecc commented May 28, 2026

Same as #1174 . BTW I plan to replace php-sdk-binary-tools to msys2 tools because php-sdk-binary-tools' msys2 is missing some components that we may have to use in the future. It will also need to download separated 7z executable first in our toolchain. But I'll handle it later.

And for full-7za instead of 7za.exe|tar.exe, it's a good way in SPC, but also need some improvement, like FileSystem::copyDir is just slow.

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