Skip to content

Download a prebuilt managed PHP before building one - #8

Merged
wheakerd merged 1 commit into
mainfrom
download-prebuilt-runtimes
Nov 13, 2026
Merged

wheakerd merged 1 commit into
mainfrom
download-prebuilt-runtimes

Conversation

@wheakerd

Copy link
Copy Markdown
Contributor

A managed PHP that is not in the SKERNEL home yet is looked up in the releases of super-kernel-tools/runtimes before it is built.

What changes for a developer

Before, the first run, build, or package on a machine compiled PHP with static-php-cli, which needs build tools and minutes:

$ skernel run swoole:start
static-php-cli 2.8.5: ...

Now it downloads the same build when one is published, and needs no build tools:

$ skernel run swoole:start
Downloading the prebuilt PHP 8.4.27 runtime for linux-x86_64.

A runtime that is not published is built as before, after one line that says so. A project turns the download off in skernel.json:

{
    "prebuilt": false
}

How it works

  • Src\Toolchain\PrebuiltRuntime fetches php-<version>-<platform>-<key>.tar.gz and its .sha256 file from the release php-<version>, the key being the name of the runtime's directory, so only the exact build SKERNEL would do matches.
  • The archive is installed only when it matches the published digest, its manifest names the requested PHP, platform, and extensions, both binaries match the digests in the manifest, and its PHP runs on the machine and reports extension versions the installation accepts. Anything else stops the command.
  • A digest file that is missing or cannot be reached counts as not published, and the runtime is built.
  • prebuilt is a setting of skernel.json, true by default, described in skernel.schema.json and both READMEs. With false the repository is never contacted. new has no project file yet, so the PHP of SKERNEL's own Composer may always be downloaded.

Validation

The test suite and the format check pass, and no test reaches the network. A real runtime was packed in the published format and installed from a local address.

🤖 Generated with Claude Code

A managed PHP that is not in the SKERNEL home yet is looked up in the releases of `super-kernel-tools/runtimes` by the runtime's own key: platform, PHP version, and the hash of its extensions, their selected versions, the toolchain, and the build options. The archive is installed only when it matches its published SHA-256 digest, its manifest names the requested PHP, platform, and extensions, both binaries match the digests in the manifest, and its PHP runs here and reports extension versions the installation accepts. A runtime that is not published is built with static-php-cli as before.

The new `prebuilt` setting of `skernel.json`, `true` by default, turns the lookup off: with `false` every runtime is built on the machine and the repository is never contacted. `new` has no project file yet, so the PHP of SKERNEL's own Composer may always be downloaded.

The test suite and the format check pass; no test reaches the network.

Co-Authored-By: Claude <noreply@anthropic.com>
@wheakerd
wheakerd merged commit 44a392a into main Nov 13, 2026
@wheakerd
wheakerd deleted the download-prebuilt-runtimes branch November 13, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant