StaticPHP v3
Important notes
STATUS: dev -> alpha -> beta -> rc -> stable
Contribution notes:
- Before we released the first
alphaversion, any changes should be merged intov3-dev, notv3. - After we released the first
alphaversion, any changes should be merged intov3and we will deprecatev3-devbranch. - The structure of StaticPHP v3 may be changed before
betaversion. - Publishing new RFC is welcome.
RFCs
- #959
- #960
- #961
- #962
- #963
- #964
- #985
Progress of refactoring
bin/ refactoring
- [X]
bin/spcfor v3 - [ ]
bin/spc-alpine-docker - [ ]
bin/spc-gnu-docker - [ ]
bin/docker-entrypoint.sh - [ ]
bin/setup-runtime
v3 new modules
- [X] Registry module loading for all configs and packages (#980)
- [ ] Vendor mode support
- [X] Separate a dedicated
bootstrapfile for initialization (#980) (src/bootstrap.php) - [ ] Add
init-registrycommand for vendor user
- [X] Separate a dedicated
Commands refactoring
-
[X] ConsoleApplication dynamic generating commands for
targettype packages (#980) -
[X] Custom commands in external registry (#980)
-
[X] DownloadCommand
- [X] shallow-clone by default (#980)
- [X] clean action (#980)
- [X]
--from-zip,--all,--with-openssl11have been removed (#980) - [X] New options:
--without-suggests,--for-packages,--ignore-cache,--parallel,--no-shallow-clone(#980) - [X] Porting common options:
--with-php,--clean,--custom-url,--custom-git,--no-alt,--with-php(#980) - [X] Porting v2 compatible options:
--for-extensions,--for-libs,--without-suggestions,--ignore-cache-sources,--prefer-pre-built(#980)
-
[X] BaseCommand
- [X] New verbosity (#980)
- [X] Git version display (#980)
-
[ ] BuildLibsCommand
- [X] Base function of building libs (#980)
- [ ] clean action
- [X] Remove
--alloption forbuild:libs(#980)
-
[ ] BuildPHPCommand -> BuildTargetCommand with
phppackage- [ ] Options
- [X]
--with-libs: Keep for compatibility, add--with-packagesoption (#980) - [x]
--build-shared - [X]
--build-all: Special parsing in v3 (#980) - [X]
--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 (#980) - [ ] Implementation status
- [x]
no-strip - [ ]
disable-opcache-jit - [ ]
with-config-file-path - [x]
with-config-file-scan-dir - [x]
with-hardcoded-ini - [ ]
with-micro-fake-cli - [ ]
with-addeed-patch - [ ]
without-micro-ext-test - [ ]
with-upx-pack - [ ]
with-micro-logo - [ ]
enable-micro-win32 - [ ]
with-frankenphp-app - [ ]
build-shared - [ ]
with-packages(with-libs) - [ ]
build-all - [X]
build-{sapi}exceptbuild-frankenphp(#980) - [ ]
build-frankenphp - [ ]
with-suggests(with-suggested-libs,with-suggested-exts) - [X]
no-download(#980) - [X] Download options in build command (#980)
- [ ]
with-clean
- [x]
- [X]
- [X] Build information printing: refactored to attribute
#[StaticPHP\Attribute\Package\Info](#980) - [ ] Bind build extra info to ExceptionHandler
- [X] Validate packages before building and after extracting (#980)
- [X] Patch static-php-cli version to PHP has been moved to
phppackagebuildstage before (#980) - [ ] Display build PHP result in terminal
- [ ] Export licenses and build extensions and lib info after building
- [ ] Options
-
[ ] CraftCommand
-
[ ] DeleteDownloadCommand
-
[X] DoctorCommand (#980) (Just command, not Doctor items)
-
[ ] DumpExtensionsCommand
-
[ ] DumpLicenseCommand
-
[X] ExtractCommand (Just command, not Extractor)
- [X] Extractor calling
- [X] Options
- [X] New
for-extensions(#980) - [X] New
for-libs(#980) - [X] New
for-packages(#980) - [X] New
without-suggestsforfor-*options (#980)
- [X] New
-
[ ] InstallPkgCommand ->InstallPackageCommand
- [X] PackageInstaller calling
- [ ] Options
- [ ]
skip-extract
- [ ]
-
[ ] MicroCombineCommand
-
[X] SPCConfigCommand
- [X] SPCConfigUtil calling
- [X] Options
-
[X] SwitchPhpVersionCommand
-
[ ] Dev commands
- [ ] AllExtCommand
- [ ] EnvCommand
- [ ] ExtVerCommand
- [ ] GenerateExtDepDocsCommand
- [ ] GenerateExtDocCommand
- [ ] GenerateLibDepDocsCommand
- [ ] LibVerCommand
- [ ] PackLibCommand
- [ ] PhpVerCommand
- [ ] SortConfigCommand
Doctor module
- [X] Core framework refactored (#980)
- [X] Doctor main class
- [X] DoctorLoader for loading check items
- [X] CheckResult for storing check results
- [X] Attribute-based check system: #[CheckItem], #[OptionalCheck], #[FixItem]
- [ ] Doctor check items
- [X] OSCheck (migrated from v2's OSCheckList)
- [X] Re2cVersionCheck
- [X] PkgConfigCheck
- [X] MacOSToolCheck (migrated from v2's MacOSToolCheckList)
- [X] LinuxMuslCheck
- [x] LinuxToolCheck (v2 has LinuxToolCheckList)
- [ ] BSDToolCheck (v2 has BSDToolCheckList)
- [ ] WindowsToolCheck (v2 has WindowsToolCheckList)
- [x] ZigCheck (v2 has ZigCheck)
Legacy modules (v2 only - SPC namespace)
These modules exist in v2 but are refactored/merged into new v3 modules:
- [X] store/ - Deprecated and refactored
- [X] Downloader → StaticPHP\Artifact\ArtifactDownloader
- [X] LockFile → StaticPHP\Artifact\ArtifactCache
- [X] CurlHook → Merged into StaticPHP\Artifact\ArtifactDownloader
- [X] FileSystem → StaticPHP\Util\FileSystem
- [X] DirDiff → StaticPHP\Util\DirDiff
- [X] SourcePatcher → StaticPHP\Util\SourcePatcher (partial)
- [X] PackageManager, SourceManager → Removed (functionality in new Package/Artifact systems)
- [X] pkg/ → Migrated to src/Package/
- [X] source/ → Migrated to Artifact system
We should chat about what features we no longer want to support and what we want to rework.
@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:
-
bin/spc doctoron Windows, macOS, Linux (linux is not fully tested) -
bin/spc build:libs libediton *nix -
bin/spc build:php-cli readlineon *nix -
bin/spc build bcmath --build-cli --debug(--build-XXXand--debughas been marked as deprecated) -
bin/spc build:libs onigon Windows -
bin/spc download {some packages} -
bin/spc download --for-extensions={some extensions} -
bin/spc extract {some package} -
bin/spc install-pkg {some package} -
bin/spc spc-config {some extensions}(still using extension as argument)
The remaining commands and some of the option implementations may not have been tested.
Might have to add versioned packages to it first though
You mean the dependencies' version from artifacts?
Might have to add versioned packages to it first though
You mean the dependencies' version from artifacts?
No, I mean versioned .deb packages like php-zts8.3-... Nothing on the spc side.
bin/spc build bcmath --build-cli --debug (--build-XXX and --debug has been marked as deprecated)
Why is --build-cli deprecated? What would be the new way to build multiple SAPIs at once?
Why is --build-cli deprecated? What would be the new way to build multiple SAPIs at once?
I'm thinking of something like sapis arguments for build:php cli,fpm {extensions} command, not original build --build-XXX command. But it needs to separate build and build:php command, it will break compatibility.
I haven't decided any changes yet, but anyway we should current deprecate build command behavior. It should be building pacakge, not building php with extensions.