Skip to content

Conversation

@crazywhalecc
Copy link
Owner

@crazywhalecc crazywhalecc commented Nov 30, 2025

Important notes

STATUS: dev -> alpha -> beta -> rc -> stable

Contribution notes:

  • Before we released the first alpha version, any changes should be merged into v3-dev, not v3.
  • After we released the first alpha version, any changes should be merged into v3 and we will deprecate v3-dev branch.
  • The structure of StaticPHP v3 may be changed before beta version.
  • Publishing new RFC is welcome.

RFCs

Progress of refactoring

bin/ refactoring

  • bin/spc for v3
  • bin/spc-alpine-docker
  • bin/spc-gnu-docker
  • bin/docker-entrypoint.sh
  • bin/setup-runtime

v3 new modules

  • Registry module loading for all configs and packages (StaticPHP v3 #980)
  • Vendor mode support
    • Separate a dedicated bootstrap file for initialization (StaticPHP v3 #980) (src/bootstrap.php)
    • Add init-registry command for vendor user

Commands refactoring

  • ConsoleApplication dynamic generating commands for target type packages (StaticPHP v3 #980)

  • Custom commands in external registry (StaticPHP v3 #980)

  • DownloadCommand

  • BaseCommand

  • BuildLibsCommand

  • BuildPHPCommand -> BuildTargetCommand with php package

    • Options
      • --with-libs: Keep for compatibility, add --with-packages option (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-app has been moved to php package definition (StaticPHP v3 #980)
      • Implementation status
        • no-strip
        • disable-opcache-jit
        • with-config-file-path
        • with-config-file-scan-dir
        • 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
        • build-{sapi} except build-frankenphp (StaticPHP v3 #980)
        • build-frankenphp
        • with-suggests (with-suggested-libs, with-suggested-exts)
        • no-download (StaticPHP v3 #980)
        • Download options in build command (StaticPHP v3 #980)
        • with-clean
    • Build information printing: refactored to attribute #[StaticPHP\Attribute\Package\Info] (StaticPHP v3 #980)
    • Bind build extra info to ExceptionHandler
    • Validate packages before building and after extracting (StaticPHP v3 #980)
    • Patch static-php-cli version to PHP has been moved to php package build stage before (StaticPHP v3 #980)
    • Display build PHP result in terminal
    • Export licenses and build extensions and lib info after building
  • CraftCommand

  • DeleteDownloadCommand

  • DoctorCommand (StaticPHP v3 #980) (Just command, not Doctor items)

  • DumpExtensionsCommand

  • DumpLicenseCommand

  • ExtractCommand (Just command, not Extractor)

  • InstallPkgCommand ->InstallPackageCommand

    • PackageInstaller calling
    • Options
      • skip-extract
  • MicroCombineCommand

  • SPCConfigCommand

    • SPCConfigUtil calling
    • Options
  • SwitchPhpVersionCommand

  • Dev commands

    • AllExtCommand
    • EnvCommand
    • ExtVerCommand
    • GenerateExtDepDocsCommand
    • GenerateExtDocCommand
    • GenerateLibDepDocsCommand
    • LibVerCommand
    • PackLibCommand
    • PhpVerCommand
    • SortConfigCommand

Doctor module

  • Core framework refactored (StaticPHP v3 #980)
    • Doctor main class
    • DoctorLoader for loading check items
    • CheckResult for storing check results
    • Attribute-based check system: #[CheckItem], #[OptionalCheck], #[FixItem]
  • Doctor check items
    • OSCheck (migrated from v2's OSCheckList)
    • Re2cVersionCheck
    • PkgConfigCheck
    • MacOSToolCheck (migrated from v2's MacOSToolCheckList)
    • LinuxMuslCheck
    • LinuxToolCheck (v2 has LinuxToolCheckList)
    • BSDToolCheck (v2 has BSDToolCheckList)
    • WindowsToolCheck (v2 has WindowsToolCheckList)
    • ZigCheck (v2 has ZigCheck)

Legacy modules (v2 only - SPC namespace)

These modules exist in v2 but are refactored/merged into new v3 modules:

  • store/ - Deprecated and refactored
    • Downloader → StaticPHP\Artifact\ArtifactDownloader
    • LockFile → StaticPHP\Artifact\ArtifactCache
    • CurlHook → Merged into StaticPHP\Artifact\ArtifactDownloader
    • FileSystem → StaticPHP\Util\FileSystem
    • DirDiff → StaticPHP\Util\DirDiff
    • SourcePatcher → StaticPHP\Util\SourcePatcher (partial)
    • PackageManager, SourceManager → Removed (functionality in new Package/Artifact systems)
    • pkg/ → Migrated to src/Package/
    • source/ → Migrated to Artifact system

@crazywhalecc crazywhalecc added the mixed PR This PR contains multiple updates label Nov 30, 2025
henderkes and others added 6 commits November 30, 2025 16:08
- Introduced DirDiff class for tracking directory file changes.
- Updated ConsoleApplication to use addCommand for build targets.
- Enhanced PackageBuilder with methods for deploying binaries and extracting debug info.
- Improved package installation logic to support shared extensions.
- Added readline extension with patching for static builds.
crazywhalecc and others added 25 commits December 10, 2025 13:18
Co-authored-by: Copilot <[email protected]>
@crazywhalecc
Copy link
Owner Author

crazywhalecc commented Dec 11, 2025

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.

@henderkes
Copy link
Collaborator

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.

@crazywhalecc
Copy link
Owner Author

crazywhalecc commented Dec 11, 2025

For a quick reference for command mode, in the current branch, the available commands:

  • bin/spc doctor on Windows, macOS, Linux (linux is not fully tested)
  • bin/spc build:libs libedit on *nix
  • bin/spc build:php-cli readline on *nix
  • bin/spc build bcmath --build-cli --debug (--build-XXX and --debug has been marked as deprecated)
  • bin/spc build:libs onig on 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.

@crazywhalecc
Copy link
Owner Author

Might have to add versioned packages to it first though

You mean the dependencies' version from artifacts?

@henderkes
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mixed PR This PR contains multiple updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants