Skip to content

Feat/pgo v3 - #1138

Draft
henderkes wants to merge 119 commits into
v3from
feat/pgo-v3
Draft

henderkes wants to merge 119 commits into
v3from
feat/pgo-v3

Conversation

@henderkes

Copy link
Copy Markdown
Collaborator

What does this PR do?

Checklist before merging

If your PR involves the changes mentioned below and completed the action, please tick the corresponding option.
If a modification is not involved, please skip it directly.

  • If you modified *.php or *.json, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:sort-config
  • If it's an extension or dependency update, please ensure the following:
    • Add your test combination to src/globals/test-extensions.php.
    • If adding new or fixing bugs, add commit message containing extension test or test extensions to trigger full test suite.

@henderkes
henderkes marked this pull request as ready for review May 11, 2026 14:49
@henderkes
henderkes requested a review from crazywhalecc May 11, 2026 14:49
@crazywhalecc crazywhalecc added the need-test This PR has not been tested yet, cannot merge now label May 12, 2026
@github-actions

github-actions Bot commented May 12, 2026 •

Copy link
Copy Markdown

StaticPHP Test Bot

Detected: Extensions: fastchart, fastjson | Libraries: bzip2, fastlz, icu, imagemagick, jbig, krb5, libaom, libffi, libheif, liblz4, libpng, ncurses, openssl, postgresql, qdbm, unixodbc, watcher | Targets: llvm-compiler-rt, llvm-tools, php
Active labels: none
Config: Linux x86_64 + Windows x86_64 + macOS arm64 | PHP 8.5 NTS

@henderkes

Copy link
Copy Markdown
Collaborator Author

(I tested with static-php/packages v3 branch, php 8.5 zig on rpm. Tests with Alpine and gcc are still to finish in a few hours when ci runs.)

@henderkes

Copy link
Copy Markdown
Collaborator Author

Wair, why is curl a target like php and not a package/library? We don't compile the exe right?

@crazywhalecc

Copy link
Copy Markdown
Owner

Wair, why is curl a target like php and not a package/library? We don't compile the exe right?

We could compile curl.exe, which shows that StaticPHP is not only suitable for building static PHP, but also for other projects. Just like we already support building pkg-config and re2c. Making them targets simply makes reasonable.

target is superset of library.

@henderkes

Copy link
Copy Markdown
Collaborator Author

Wair, why is curl a target like php and not a package/library? We don't compile the exe right?

We could compile curl.exe, which shows that StaticPHP is not only suitable for building static PHP, but also for other projects. Just like we already support building pkg-config and re2c. Making them targets simply makes reasonable.

target is superset of library.

Okay, added curl.exe on Windows too. Also figured out the root cause of the BUILD_CC patch minilua crash (zigs undefined behaviour sanitizer tripping up, if you run CC="clang -fsanitize=undefined" it will also fail) which coincidentally also fixed a possible edge case bug. BUILD_CC is also used for gen_ir so by using a different vm type it could have theoretically clashed.

@henderkes

Copy link
Copy Markdown
Collaborator Author

Oh, there's even an issue running the binaries despite no undefined sanitizer that I can't reproduce locally or in docker. Very weird.

Comment thread docs/deps-craft-yml.md
Comment on lines +29 to +31
# Do not abort when a shared extension fails to build or to load: skip it, drop its .so, and
# record it in buildroot/skipped-shared-extensions.json (default: false)
allow-shared-ext-failure: false

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this feature?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, only for me for 8.6.

wheakerd pushed a commit to wheakerd/static-php-cli that referenced this pull request Nov 12, 2026
The buildroot include rewrite compared a realpath'd -isystem argument
against BUILD_ROOT_PATH, i.e. the buildroot root instead of its include/
directory, so it never matched and every -isystem was passed through
unchanged.

Compare against BUILD_INCLUDE_PATH instead, map -mtune=generic to zig's
"baseline" spelling, and drop GCC-only warning flags (-Wlogical-op,
-Wduplicated-cond, -Warray-bounds=*, ...) that clang/zig does not know, so
they no longer produce -Wunknown-warning-option noise.

Port of crazywhalecc#1138 (4f76942, 8f557aa).
wheakerd pushed a commit to wheakerd/static-php-cli that referenced this pull request Nov 12, 2026
The only guard was --max-time 3600, so an unreachable host or a mirror that
stops sending data blocks the build for up to an hour. Abort when no
connection is established within 15s, and when throughput stays below
1 byte/s for 30s.

Applies to both executeCurl() and executeCurlDownload().

Port of crazywhalecc#1138 (7d3e1f8).
wheakerd pushed a commit to wheakerd/static-php-cli that referenced this pull request Nov 12, 2026
cgo caches the evaluated include list across builds (FRANKENPHP_VERSION
and friends are resolved from generated headers), so a rebuild could keep
reporting and compiling against the values from the previous build even
after the headers were regenerated. Clear the go build cache before
xcaddy runs.

Port of crazywhalecc#1138 (a88e426).
wheakerd pushed a commit to wheakerd/static-php-cli that referenced this pull request Nov 12, 2026
Expose --with-sysconfdir and forward it to PHP's configure as
--sysconfdir=..., so packagers can point PHP at a location such as
/etc/php-zts. The option is wired into the Unix configure path only;
Windows ignores it.

Document the option in the bilingual CLI reference and in the craft.yml
build-options example.

Port of crazywhalecc#1138 (8f557aa).

This branch has not been deployed

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

Labels

need-test This PR has not been tested yet, cannot merge now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants