Repository navigation
Remove remaining unused external libzip 1.2.0 build paths #4248
Description
Problem
The PHP build system retains external libzip 1.2.0 build and staging paths even though no supported PHP build appears to link that library.
The stale 1.2.0 copies in the generic PHP Dockerfile are an immediate clean-build bug addressed by #4108: packages/php-wasm/compile/build.js builds only the base image before invoking Docker, while Git tracks only libzip 1.9.2 artifacts. Retaining those copies makes a clean checkout fail before producing the PHP runtime package.
This issue tracks the remaining PHP 5.2 and Makefile cleanup separately.
Findings
- [PHP] Cleanup 7.2 and 7.3-specific build code #3137 removed the PHP 7.2/7.3 build path that linked external libzip 1.2.0 and made modern PHP builds use libzip 1.9.2.
- Fix external PHP extension ABI exports #4108 removes the stale generic-Dockerfile copies so clean modern runtime builds use the tracked 1.9.2 artifacts: Fix external PHP extension ABI exports #4108 (comment)
- The Makefile still defines Asyncify and JSPI build targets for libzip 1.2.0: https://github.com/WordPress/wordpress-playground/blob/trunk/packages/php-wasm/compile/Makefile#L25-L55
- Add PHP 5.2 WebAssembly builds and runtime support #3501 added the dedicated PHP 5.2 Dockerfile, which separately stages libzip 1.2.0 and copies it into
/root/lib: https://github.com/WordPress/wordpress-playground/blob/trunk/packages/php-wasm/compile/php/Dockerfile-5-2#L83-L91 and https://github.com/WordPress/wordpress-playground/blob/trunk/packages/php-wasm/compile/php/Dockerfile-5-2#L153-L159 - PHP 5.2 uses
--enable-zip, whoseconfig.m4compiles PHP's bundled ZIP/libzip sources and declares only external zlib: https://github.com/php/php-src/blob/php-5.2.17/ext/zip/config.m4 - The PHP 5.2 Dockerfile adds
libz.ato final linker inputs but never adds externallibzip.a, indicating that its external 1.2.0 staging is also unused.
Proposed cleanup
- Remove the libzip 1.2.0 Asyncify and JSPI targets from the Makefile.
- Remove libzip 1.2.0 staging from
Dockerfile-5-2. - Preserve libzip 1.9.2 for modern PHP builds.
Verification
- Rebuild PHP 5.2 for web and Node using both Asyncify and JSPI.
- Verify the PHP 5.2 ZIP extension loads and can create and read a ZIP archive in each relevant runtime.
- Rebuild at least one modern PHP runtime to confirm the libzip 1.9.2 path remains unchanged.
AI assistance
OpenAI gpt-5.6-sol via OpenCode was used to trace the current clean-build orchestration, inspect tracked libzip artifacts and PHP 5.2's bundled ZIP configuration, and draft this issue. Chris Huber reviewed and owns the report.
Activity
[-]Remove unused external libzip 1.2.0 build[/-][+]Remove remaining unused external libzip 1.2.0 build paths[/+]