Conversation
@henderkes There's no urgent things. Just when you return from your vacation, and if you have time, it would be best we could discuss what modifications are still needed for the current framework of v3. Please feel free to contact me if you'd like. Currently I've finished the major part of framework according to RFC, but I haven't ported most of the implementation yet, mainly to prevent major changes to the framework structure from requiring massive modifications. And for anyone: If you have any feedback on the framework design, please let me know. |
|
I haven't had much of a look yet and the changelist is quite massive, so it might be a good idea to chat about it one evening after I had a rough glance. I'll give everything (especially vendor mode) a play and rewrite the static-php/packages properly on top of the new branch. Might have to add versioned packages to it first though, because that's the part still holding up apk and proper apt support. |
|
For a quick reference for command mode, in the current branch, the available commands:
The remaining commands and some of the option implementations may not have been tested. |
You mean the dependencies' version from artifacts? |
No, I mean versioned .deb packages like php-zts8.3-... Nothing on the spc side.
Why is --build-cli deprecated? What would be the new way to build multiple SAPIs at once? |
I'm thinking of something like I haven't decided any changes yet, but anyway we should current deprecate |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR moves StaticPHP v3 toward the alpha stage by introducing a large set of v3 package/registry definitions, adding many new library/extension build recipes, and updating tooling/config (Composer, PHPStan, docs, CI) to match the new module/registry structure.
Changes:
- Added many new
Package\Library,Package\Extension, andPackage\Artifactclasses to support building additional libraries/extensions across Unix/Windows targets. - Introduced
spc.registry.ymland extensive new YAML package definitions underconfig/pkg/**andconfig/artifact/**. - Updated dev tooling and docs (Composer/PHPStan/CaptainHook, guides, CI workflows) to reflect v3 structure and new shared-extension build support.
Reviewed changes
Copilot reviewed 292 out of 967 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Package/Library/net_snmp.php | Adds net-snmp library build/patch steps for Unix targets. |
| src/Package/Library/mpir.php | Adds Windows build steps and VS detection for mpir. |
| src/Package/Library/mimalloc.php | Adds Unix CMake build for mimalloc with musl handling. |
| src/Package/Library/libzip.php | Adds CMake build for libzip (Unix/Windows) and pkg-config patching. |
| src/Package/Library/libyaml.php | Adds Unix autoconf + Windows CMake build with Windows-only pre-patch. |
| src/Package/Library/libuv.php | Adds CMake build for libuv (Unix/Windows) with pkg-config patching on Unix. |
| src/Package/Library/libuuid.php | Adds Unix build for libuuid and writes a generated uuid.pc. |
| src/Package/Library/liburing.php | Adds Linux build for liburing with musl-specific patching and libc logic. |
| src/Package/Library/libunistring.php | Adds Unix autoconf build for libunistring and la patching. |
| src/Package/Library/libtiff.php | Adds Unix build for libtiff with configure-file patches and optional deps. |
| src/Package/Library/libssh2.php | Adds CMake build for libssh2 (Unix/Windows) with optional zlib on Unix. |
| src/Package/Library/librdkafka.php | Adds librdkafka patching + Unix CMake build with optional deps. |
| src/Package/Library/librabbitmq.php | Adds CMake build for librabbitmq and Windows renaming of lib output. |
| src/Package/Library/libpng.php | Adds Unix autoconf build and Windows CMake build with post-build lib rename. |
| src/Package/Library/libmpdec.php | Adds Unix autoconf build and a Windows NMake build with static lib discovery. |
| src/Package/Library/libmemcached.php | Adds Unix CMake build for libmemcached on Linux/Darwin. |
| src/Package/Library/libmaxminddb.php | Adds CMake build for libmaxminddb (Unix/Windows) with Windows lib name fixup. |
| src/Package/Library/liblz4.php | Adds patches and build steps for liblz4 across Unix/Windows. |
| src/Package/Library/libjxl.php | Adds Unix CMake build for libjxl with ZigToolchain AVX512 handling. |
| src/Package/Library/libjpeg.php | Adds CMake build for libjpeg-turbo (Unix/Windows) + pkg-config patching/renames. |
| src/Package/Library/libiconv_win.php | Adds Windows build steps and VS detection for libiconv-win. |
| src/Package/Library/libiconv.php | Adds Unix autoconf build for libiconv with libcharset install step. |
| src/Package/Library/libheif.php | Adds CMake patching/build for libheif and pkg-config patching. |
| src/Package/Library/libffi_win.php | Adds Windows build steps and VS detection for libffi-win with header patch. |
| src/Package/Library/libffi.php | Adds Unix autoconf build for libffi with Linux lib64->lib fixup and Darwin host/target args. |
| src/Package/Library/libedit.php | Adds patching and Unix autoconf build for libedit with pkg-config patching. |
| src/Package/Library/libde265.php | Adds Unix CMake build for libde265 and pkg-config patching. |
| src/Package/Library/libcares.php | Adds Apple header patch + Unix autoconf build for c-ares with pkg-config patching. |
| src/Package/Library/libavif.php | Adds Windows-source patch + CMake build for libavif across platforms. |
| src/Package/Library/libargon2.php | Adds Linux Makefile patch + Unix build/install steps and cleanup. |
| src/Package/Library/libaom.php | Adds CMake build for libaom (Unix/Windows), with Zig-specific env tweak. |
| src/Package/Library/libacl.php | Adds a hook to patch PHP’s Makefile and builds libacl on Unix. |
| src/Package/Library/lerc.php | Adds Unix CMake build for lerc. |
| src/Package/Library/ldap.php | Adds configure-time patching and Unix build for OpenLDAP with pkg-config adjustments. |
| src/Package/Library/krb5.php | Adds Unix autoconf build for krb5 with dependency-derived LIBS and pkg-config patching. |
| src/Package/Library/jbig.php | Adds patching + Unix build steps for jbigkit. |
| src/Package/Library/idn2.php | Adds Unix build for libidn2 with optional dependencies and pkg-config/la patching. |
| src/Package/Library/gmssl.php | Adds CMake build for GmSSL, including Windows-specific generator/config. |
| src/Package/Library/gmp.php | Adds Unix autoconf build for gmp with CFLAGS tweak and pkg-config patching. |
| src/Package/Library/gettext_win.php | Adds Windows build steps and VS detection + vcxproj runtime library patching. |
| src/Package/Library/gettext.php | Adds Unix build for gettext with optional deps and ZTS-specific threading flags. |
| src/Package/Library/freetype.php | Adds Unix/Windows CMake build for freetype with CMake 4 compat handling. |
| src/Package/Library/fastlz.php | Adds small Unix build recipe for fastlz with explicit tool invocation. |
| src/Package/Library/bzip2.php | Adds patch + Unix/Windows build steps for bzip2. |
| src/Package/Library/attr.php | Adds Unix build for attr with autogen steps and pkg-config patching. |
| src/Package/Extension/zlib.php | Adds custom PHP configure arg logic for zlib across Unix. |
| src/Package/Extension/zip.php | Adds custom PHP configure arg logic for zip across Unix. |
| src/Package/Extension/yaml.php | Adds Windows-only patch for yaml’s config.w32 static libyaml linking. |
| src/Package/Extension/yac.php | Adds source patching hooks for yac before buildconf. |
| src/Package/Extension/xz.php | Adds Windows buildconf patch for xz extension config.w32. |
| src/Package/Extension/xlswriter.php | Adds configure args and Unix/Windows build patches for xlswriter. |
| src/Package/Extension/xhprof.php | Adds buildconf hook for xhprof to symlink into PHP tree and patch config.m4. |
| src/Package/Extension/uv.php | Adds validation and Windows/unix build patches for ext-uv. |
| src/Package/Extension/trader.php | Adds buildconf patch for trader config.m4 macro naming. |
| src/Package/Extension/swow.php | Adds configure arg logic and buildconf symlink/patching for swow. |
| src/Package/Extension/sqlsrv.php | Adds Windows flags removal patches for sqlsrv config.w32 and Makefile. |
| src/Package/Extension/spx.php | Adds buildconf/configure patches to fix static/shared build issues for spx. |
| src/Package/Extension/snmp.php | Adds buildconf patching for snmp extension and injects pkg-config libs. |
| src/Package/Extension/redis.php | Adds configure arg logic for redis across Unix/Windows with optional deps. |
| src/Package/Extension/readline.php | Adds musl static readline patching around make stage. |
| src/Package/Extension/rdkafka.php | Adds config.m4 patching, source patching, and configure arg logic for rdkafka. |
| src/Package/Extension/rar.php | Adds macOS-specific compiler flag patch for rar extension. |
| src/Package/Extension/protobuf.php | Adds validation to prevent unsupported PHP versions and grpc conflict. |
| src/Package/Extension/phar.php | Adds micro-SAPI patching and shared-build config.m4 swapping for phar. |
| src/Package/Extension/pgsql.php | Adds PHP 8.4+ pgsql configure env overrides and shared build env tweaks. |
| src/Package/Extension/pdo_sqlsrv.php | Adds Windows SDL flag removal and PHP 8.5+ source layout adjustment. |
| src/Package/Extension/pdo_sqlite.php | Adds configure patch for sqlite3_column_table_name. |
| src/Package/Extension/pdo_odbc.php | Adds buildconf patch for iconv linkage and configure args for ODBC. |
| src/Package/Extension/password_argon2.php | Adds cli smoke test and configure arg selection depending on PHP/openssl. |
| src/Package/Extension/parallel.php | Adds ZTS validation and config.m4 patch to remove hardcoded PHP_VERSION. |
| src/Package/Extension/opentelemetry.php | Adds Unix make-stage env CFLAGS tweak. |
| src/Package/Extension/openssl.php | Adds PHP 8.0 + OpenSSL3 workaround and configure arg logic for argon2. |
| src/Package/Extension/mongodb.php | Adds Windows buildconf patch and configure args for mongodb with optional deps. |
| src/Package/Extension/memcached.php | Adds configure args for memcached with libmemcached/fastlz integration. |
| src/Package/Extension/memcache.php | Adds buildconf/configure patches to support static/shared builds. |
| src/Package/Extension/mbstring.php | Adds configure args for mbstring and toggling mbregex. |
| src/Package/Extension/mbregex.php | Adds a “no-op” custom configure arg stub for mbregex. |
| src/Package/Extension/maxminddb.php | Adds buildconf patch to flatten new maxminddb source layout. |
| src/Package/Extension/intl.php | Adds Windows buildconf patch to use PHP_INTL_SHARED rather than hardcoded true. |
| src/Package/Extension/imap.php | Adds ZTS restriction validation, buildconf patches, and configure args for imap. |
| src/Package/Extension/imagick.php | Adds configure args and disables OMP function probe. |
| src/Package/Extension/glfw.php | Adds patching to stage ext-glfw into PHP tree and inject Linux X11 flags. |
| src/Package/Extension/gd.php | Adds configure args based on detected library packages. |
| src/Package/Extension/ffi.php | Adds CentOS 7 specific patch application hook for FFI. |
| src/Package/Extension/excimer.php | Adds shared env adjustment to remove -lphp from LIBS. |
| src/Package/Extension/event.php | Adds configure args for event and macOS-specific php_config.h patch. |
| src/Package/Extension/ev.php | Adds Windows buildconf patch to respect PHP_EV_SHARED. |
| src/Package/Extension/dio.php | Adds buildconf patch to copy missing header for dio. |
| src/Package/Extension/decimal.php | Adds symbol rename and Windows dep ordering fix for decimal extension. |
| src/Package/Extension/amqp.php | Adds Windows header patching to remove #warning directives. |
| src/Package/Artifact/pkg_config.php | Adds pkg-config source patch hook for GCC 15 compatibility. |
| src/Package/Artifact/openssl.php | Adds post-extract patch for OpenSSL 1.1 on Darwin. |
| src/Package/Artifact/libaom.php | Adds musl-specific libaom patch hook. |
| src/Package/Artifact/imagick.php | Adds imagick patch hook for PHP 8.4 compatibility based on ext version. |
| src/Package/Artifact/gmssl.php | Adds gmssl source patch to rename OPENSSL_* functions. |
| src/Package/Artifact/bzip2.php | Adds bzip2 Makefile -fPIC patch hook. |
| src/Package/Artifact/attr.php | Adds attr patch hook (musl/macOS) for gethostname declaration. |
| spc.registry.yml | Introduces core registry config and PSR-4 mappings for v3 packages/artifacts/commands. |
| phpstan.neon | Updates PHPStan config (PHP 8.4 target, ignores, exclude paths). |
| docs/zh/guide/manual-build.md | Documents new shared-extension patch points. |
| docs/zh/guide/action-build.md | Updates Action build docs to include shared extensions and FrankenPHP notes. |
| docs/en/guide/manual-build.md | Fixes table formatting and documents new shared-extension patch points. |
| docs/en/guide/action-build.md | Updates Action build docs to include shared extensions and FrankenPHP notes. |
| config/pre-built.json | Removes old pre-built configuration JSON. |
| config/pkg/target/zig.yml | Adds zig target package definition. |
| config/pkg/target/vswhere.yml | Adds vswhere target package definition for Windows. |
| config/pkg/target/upx.yml | Adds upx target package definition. |
| config/pkg/target/strawberry-perl.yml | Adds Strawberry Perl target package definition for Windows. |
| config/pkg/target/rust.yml | Adds rust target package definition. |
| config/pkg/target/re2c.yml | Adds re2c target package definition (source + static bin). |
| config/pkg/target/protoc.yml | Adds protoc target package definition. |
| config/pkg/target/pkg-config.yml | Adds pkg-config target definition with hosted binaries. |
| config/pkg/target/php.yml | Adds PHP target and virtual-target definitions, including php-micro. |
| config/pkg/target/php-sdk-binary-tools.yml | Adds PHP SDK tools target package for Windows. |
| config/pkg/target/nasm.yml | Adds nasm target package for Windows. |
| config/pkg/target/musl-toolchain.yml | Adds musl toolchain target package definitions. |
| config/pkg/target/jom.yml | Adds jom target package for Windows. |
| config/pkg/target/htop.yml | Adds htop target definition (source + ncursesw dep). |
| config/pkg/target/go-xcaddy.yml | Adds Go/xcaddy tool target definition. |
| config/pkg/target/go-win.yml | Adds Go tool target definition for Windows. |
| config/pkg/target/frankenphp.yml | Adds frankenphp target definition including OS-specific deps and bins. |
| config/pkg/target/curl.yml | Adds curl target package definition and dependency graph. |
| config/pkg/lib/*.yml | Adds many new library package definitions (sources, deps, headers, static libs, licensing). |
| config/pkg/ext/*.yml | Adds many php-extension package definitions (sources, deps, arg types, OS constraints). |
| config/artifact/php-src.yml | Adds php-src artifact definition with licensing and mirror info. |
| config/artifact/ncurses.yml | Adds ncurses artifact definition using hosted binary and filelist source. |
| config/artifact/musl-wrapper.yml | Adds musl-wrapper artifact source definition. |
| config/artifact/glfw.yml | Adds glfw artifact definition for php-glfw source. |
| composer.json | Updates required PHP version to 8.4, updates dependencies/dev-tooling, and changes autoload mappings. |
| captainhook.json | Updates pre-push/pre-commit hook commands and adds config linting hook. |
| README.md | Renames project to StaticPHP and updates messaging/wording. |
| README-zh.md | Renames project to StaticPHP and updates wording. |
| README-en.md | Removes old stub file (English README moved). |
| .php-cs-fixer.php | Updates fixer finder paths to new tests namespace/directory. |
| .github/workflows/tests.yml | Expands PR workflow branches to include v3. |
| .github/workflows/build-windows-x86_64.yml | Adds with-suggested-libs workflow input. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
For gnu docker, do you think we should update to alma 8 or drop it entirely and rely on zig? |
To be honest, if conditions permit, I will try to avoid using Docker anyway. But whether to keep gnu-docker depends on whether we absolutely have to use it to build anything. I prefer to avoid using Docker, especially when Zig can almost completely cover it.
|
|
We could drop Docker entirely. Zig also supports building musl-linked binaries, both static and dynamic. It's just that it produces slow binaries on php < 8.5. |
Important notes
STATUS: dev ->
alpha-> beta -> rc -> stableContribution notes:
alphaversion, any changes should be merged intov3-dev, notv3.alphaversion, any changes should be merged intov3and we will deprecatev3-devbranch.betaversion.RFCs
Progress of refactoring
bin/refactoringbin/spcfor v3bin/spc-alpine-dockerbin/spc-gnu-dockerbin/docker-entrypoint.shbin/setup-runtimev3 new modules
bootstrapfile for initialization (StaticPHP v3 #980) (src/bootstrap.php)init-registrycommand for vendor userCommands refactoring
ConsoleApplication dynamic generating commands for
targettype packages (StaticPHP v3 #980)Custom commands in external registry (StaticPHP v3 #980)
DownloadCommand
--from-zip,--all,--with-openssl11have been removed (StaticPHP v3 #980)--without-suggests,--for-packages,--ignore-cache,--parallel,--no-shallow-clone(StaticPHP v3 #980)--with-php,--clean,--custom-url,--custom-git,--no-alt,--with-php(StaticPHP v3 #980)--for-extensions,--for-libs,--without-suggestions,--ignore-cache-sources,--prefer-pre-built(StaticPHP v3 #980)BaseCommand
BuildLibsCommand
--alloption forbuild:libs(StaticPHP v3 #980)BuildPHPCommand -> BuildTargetCommand with
phppackage--with-libs: Keep for compatibility, add--with-packagesoption (StaticPHP v3 #980)--build-shared--build-all: Special parsing in v3 (StaticPHP v3 #980)--no-strip,--disable-opcache-jit,--build-{sapi},--with-config-file-path,--with-config-file-scan-dir,--with-hardcoded-ini,--with-micro-fake-cli,--with-added-patch (-P),--without-micro-ext-test,--with-upx-pack,--with-micro-logo,--enable-micro-win32,--with-frankenphp-apphas been moved tophppackage definition (StaticPHP v3 #980)no-stripdisable-opcache-jitwith-config-file-pathwith-config-file-scan-dirwith-hardcoded-iniwith-micro-fake-cliwith-addeed-patchwithout-micro-ext-testwith-upx-packwith-micro-logoenable-micro-win32with-frankenphp-appbuild-sharedwith-packages(with-libs)build-allbuild-{sapi}exceptbuild-frankenphp(StaticPHP v3 #980)build-frankenphpwith-suggests(with-suggested-libs,with-suggested-exts)no-download(StaticPHP v3 #980)with-clean#[StaticPHP\Attribute\Package\Info](StaticPHP v3 #980)phppackagebuildstage before (StaticPHP v3 #980)CraftCommand
DeleteDownloadCommand
DoctorCommand (StaticPHP v3 #980) (Just command, not Doctor items)
DumpExtensionsCommand
DumpLicenseCommand
ExtractCommand (Just command, not Extractor)
for-extensions(StaticPHP v3 #980)for-libs(StaticPHP v3 #980)for-packages(StaticPHP v3 #980)without-suggestsforfor-*options (StaticPHP v3 #980)InstallPkgCommand ->InstallPackageCommand
skip-extractMicroCombineCommand
SPCConfigCommand
SwitchPhpVersionCommand
Dev commands
Doctor module
Legacy modules (v2 only - SPC namespace)
These modules exist in v2 but are refactored/merged into new v3 modules: