Skip to content

Publish self-contained turbo binaries as the PIE release assets - #6707

Merged
ondrejmirtes merged 1 commit into
2.3.xfrom
turbo-pie-self-contained
Oct 8, 2026
Merged

ondrejmirtes merged 1 commit into
2.3.xfrom
turbo-pie-self-contained

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Since the shared core (#6703), phpstan/phpstan ships thin per-version extensions that load phpstan_turbo_core from their own directory. The turbo-release job in phpstan/phpstan's release.yml zips those same files as the PIE release assets. But PIE installs a pre-packaged binary by copying one file:

  • on Unix, UnixBuild::prePackagedBinary + UnixInstall copy only phpstan_turbo.so into the extension directory;
  • on Windows, WindowsInstall copies the DLL named like the asset into the extension directory, and puts any other DLL next to php.exe instead.

So from the next 2.3.x release on, pie install phpstan/turbo would install an extension whose core is missing. PIE needs self-contained binaries.

Building them. turbo-compile, turbo-compile-musl-arm64 and turbo-compile-windows gain a variant matrix dimension. split builds what the dist ships, as now. pie builds the same version self-contained, the way every leg did before the split: a plain make pgo, or configure --enable-phpstan-turbo on Windows. Its artifact is phpstan_turbo_pie-<target>-php<minor>[-zts], which none of the dist-side jobs pick up (they all match phpstan_turbo-*). The pie legs only run for release tags, and on pull requests labelled turbo-pie like this one, so pushes and other PRs cost nothing extra. Tag runs take as long as they did before the split.

Publishing them. The new turbo-pie-release job packages the artifacts by PIE's asset naming, using .github/scripts/turbo-pie-assets.sh. The names were checked against PIE's PrePackagedBinaryAssetName and WindowsExtensionAssetName. On tags the job publishes the phpstan/turbo-ext release, with the same draft/upload/publish logic the dist job used. On labelled PRs it only uploads the zips as the turbo-pie-assets artifact.

Also fixed: PHP 8.6 on Windows. The dist job named every non-8.3 Windows asset vs17, but 8.6 is built against the vs18 dev pack, and PIE on the official 8.6 builds asks for …-8.6-{nts,ts}-vs18-x86_64.zip. This affects 2.2.17 and 2.3.0 too. The Windows pie legs now record the compiler they built with, and the asset is named after it.

Packaging fake artifacts for every leg gives the 2.3.0 asset set exactly, plus the 12 Linux ZTS assets from #6706 and with vs18 for 8.6. Every malformed input fails (missing file, unknown target or compiler, no artifacts).

Needs a dist change before the next 2.3.x tag: the turbo-release job must be removed from phpstan/phpstan's 2.3.x release.yml. Releases in the org are immutable, and that job runs as soon as the dist tag lands, so it would publish the thin binaries before this one finishes. PR to follow in phpstan/phpstan. On 2.2.x the dist keeps packaging, since its binaries are still self-contained. Only its 8.6 Windows vs17 names need the same correction there.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LSeeJXEA18Ma6X4qyx1xMx

PIE installs a pre-packaged binary by copying the one extension file
into the extension directory (phpstan_turbo.so on Unix; on Windows the
DLL named like the asset, other DLLs go next to php.exe), so the thin
per-version extensions phpstan/phpstan ships since the shared core,
which load phpstan_turbo_core from their own directory, cannot be PIE
assets: `pie install phpstan/turbo` would install an extension that
fails to load.

- the turbo-compile, turbo-compile-musl-arm64 and turbo-compile-windows
  jobs gain a `pie` variant, built only for release tags (and on pull
  requests labelled turbo-pie): the same version self-contained, with
  a plain `make pgo` (configure --enable-phpstan-turbo on Windows),
  uploaded as phpstan_turbo_pie-<target>-php<minor>[-zts]
- the new turbo-pie-release job packages them by PIE's asset naming
  (.github/scripts/turbo-pie-assets.sh) and publishes the
  phpstan/turbo-ext release of the tag, which the dist release.yml did
  from the thin binaries until now
- the Windows assets carry the Visual Studio generation the leg built
  against, so PHP 8.6 is published as vs18 (it was named vs17, which PIE
  on the official vs18 builds of 8.6 never matched)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LSeeJXEA18Ma6X4qyx1xMx
@ondrejmirtes ondrejmirtes added the turbo-pie Build and package the self-contained turbo PIE release assets in phar.yml label Oct 8, 2026

# see the same steps in turbo-compile-core: the training run of
# `make pgo` runs bin/phpstan on the checkout
- uses: "ramsey/composer-install@65e4f84970763564f46a70b8a54b90d033b3bdda" # v4.0.0
@ondrejmirtes

Copy link
Copy Markdown
Member Author

Dist counterpart, to merge together with this one before the next 2.3.x tag: phpstan/phpstan#15436 (removes the dist's turbo-release job). The 2.2.x vs18 naming fix is phpstan/phpstan#15437.

Verified from this PR's labelled run: all 44 pie legs and the packaging job are green; the asset names equal the locally tested set (2.3.0's plus the Linux ZTS ones, 8.6 Windows as vs18). The glibc ZTS 8.5, glibc NTS 8.3 and musl NTS 8.4 arm64 binaries load alone from an empty directory in the official php images, report 28c29b8, activate, and pass smoke.php.

@ondrejmirtes
ondrejmirtes merged commit 7f35354 into 2.3.x Oct 8, 2026
838 of 949 checks passed
@ondrejmirtes
ondrejmirtes deleted the turbo-pie-self-contained branch October 8, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

turbo-pie Build and package the self-contained turbo PIE release assets in phar.yml

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants