-
Notifications
You must be signed in to change notification settings - Fork 49
Description
Discussed in #295
Originally posted by godruoyi March 18, 2025
Description
Thank you for creating such a nice tool that allows us to avoid using PECL any more.
I would like to ask if there are any plans to support the direct installation of extension files like .dylib, .dll, and .so, without the need for building them when we run pie install . It would be simpler since we can build the extension in another language and publish the artifacts to GitHub, so that we can install them directly without having to build them again. I would be interested in supporting this feature if it is feasible.
The plan
The proposal is that extensions can provide a matrix pre-built binaries, attached to immutable GH releases, that cover the "80% use case" - i.e. most common combinations. If the combination that is trying to be installed is not available pre-built, then the fallback mechanism of downloading the source & compiling it the traditional way is employed (although the maintainer can disable that behaviour, e.g. if the source code is not open source).
My own notes (subject to change! - do NOT quote me on any of this)
- Ext can specify they provide prebuilt binaries with
DownloadUrlMethod::PrePackagedBinaryDownload - Ext MUST provide a format to build the expected names
- If we find the asset:
- Download it
- Use gh attestations to verify the downloaded asset
- note: depends on implementing Support release attestations ThePHPF/attestation#15
- Install it (skip build)
- What to do with metadata? We can generate some (i.e. install metadata), but not the build metadata. Check for reliance on the build metadata
- If we do NOT find the asset:
- Fall back to compiling from source (should this be configurable? e.g.
DownloadUrlMethod::PrePackagedBinaryDownloadWithoutSourceFallback) - Could probably help to create a GH action that builds an ext and attaches prebuilt binaries, to help adoption
Approximate matrix of important fields to differentiate builds
- OS (Windows/Linux/OSX)
- Architecture (arm64/aarch64, x86_64, x86)
- libc flavour (gnu, musl)
- PHP version OR PHP API version?
- Debug (debug/not)
- ZTS (-zts, -nts/omit)
Questions:
- how do we detect gnu vs musl libc?
- why is DD using PHP API version instead of PHP version?