Skip to content

V3c/pgo split 1 - #1287

Merged
crazywhalecc merged 12 commits into
v3from
v3c/pgo-split-1
Nov 12, 2026
Merged

crazywhalecc merged 12 commits into
v3from
v3c/pgo-split-1

Conversation

@crazywhalecc

@crazywhalecc crazywhalecc commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

This PR mainly handles modifications in 4 pgo-v3 branches and can be merged independently into the v3 branch:

  • fix(php): add --with-sysconfdir build option — src/Package/Target/php.php, src/Package/Target/php/unix.php. Feeds --sysconfdir= to configure.
  • fix(frankenphp): go clean -cache before xcaddy — src/Package/Target/php/frankenphp.php. Avoids stale cgo include evaluation (FRANKENPHP_VERSION etc.) on rebuilds.
  • fix(zig-cc): honour BUILD_INCLUDE_PATH — src/globals/scripts/zig-cc.sh. Rewrite -isystem <buildroot>/include → -I using BUILD_INCLUDE_PATH; map -mtune=generic → baseline; drop GCC-only warnings. On v3 the rewrite compares against BUILD_ROOT_PATH, so it never fires (dead code).
  • fix(download): curl connect/speed timeouts — src/StaticPHP/Runtime/Shell/DefaultShell.php (2 call sites). Add --connect-timeout 15 --speed-limit 1 --speed-time 30; v3 only has --max-time 3600, so a dead mirror hangs the build.

Checklist before merging

  • If you modified *.php or *.yml, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:lint-config

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 #1138 (4f76942, 8f557aa).
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 #1138 (7d3e1f8).
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 #1138 (a88e426).
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 #1138 (8f557aa).
@crazywhalecc crazywhalecc added need-test This PR has not been tested yet, cannot merge now sapi/frankenphp labels Nov 9, 2026
On Windows the default pwsh shell does not stop a `run: |` block when a
native command exits non-zero. `spc doctor --auto-fix` exiting 69 (e.g.
its vswhere auto-fix download failed) was therefore swallowed and the
build kept running until it failed the environment check, hiding the real
cause.

Split doctor and build into separate steps so a doctor failure fails the
job immediately on every shell.
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

StaticPHP Test Bot

Detected: Extensions: none | Libraries: imagemagick | Targets: php
Active labels: sapi/frankenphp
Available labels: need-test (gate), test/linux test/windows test/macos (platform), test/tier2 (extra arch), test/php-83 test/php-84 (PHP version), sapi/frankenphp (extra FrankenPHP SAPI build)
Config: Linux x86_64 + Windows x86_64 + macOS arm64 | PHP 8.5 NTS + SAPI: frankenphp (Tier1 Linux/macOS/Windows)

@henderkes henderkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

other than that minor thing all good

* @throws ExecutionException When an extracted tree cannot be removed completely
*/
public static function removeExtensionSources(string $source_path): int
public static function removeExtensionSources(string $source_path, array $extra_source_dirs = []): int

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this logic will bite with opentelemetry's source root. It'll delete the parent directory and then the child which will crash.

@crazywhalecc
crazywhalecc merged commit 3ba9ffa into v3 Nov 12, 2026
14 checks passed
@crazywhalecc
crazywhalecc deleted the v3c/pgo-split-1 branch November 12, 2026 07:59
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 sapi/frankenphp

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants