Skip to content

Allow installing a specific blackfire version#1289

Open
Teko012 wants to merge 1 commit into
mlocati:masterfrom
Teko012:feat/blackfire-versioned-install
Open

Allow installing a specific blackfire version#1289
Teko012 wants to merge 1 commit into
mlocati:masterfrom
Teko012:feat/blackfire-versioned-install

Conversation

@Teko012
Copy link
Copy Markdown
Contributor

@Teko012 Teko012 commented May 23, 2026

Currently, install-php-extensions blackfire always fetches the latest Blackfire PHP probe from the public API endpoint:

https://blackfire.io/api/v1/releases/probe/php/<distro>/<arch>/<phpver>

There is no way to pin the installed probe to a specific Blackfire version, which means rebuilding the same Dockerfile at different points in time can yield different probe versions — making builds non-reproducible and breaking environments that need to match a specific Blackfire agent version.

This PR adds support for selecting a specific Blackfire probe version using the standard install-php-extensions <ext>-<version> syntax that the script already supports for other extensions, e.g.:

install-php-extensions blackfire-1.95.0

Implementation

When a version is supplied, the URL passed to curl is switched from the "latest probe" API endpoint to the official versioned tarball hosted on Blackfire's package CDN:

https://packages.blackfire.io/binaries/blackfire-php/<version>/blackfire-php-<distro>_<arch>-php-<phpver>.tar.gz

Concretely, in the blackfire) branch of installRemoteModule():

  • A new installRemoteModule_url variable is set conditionally:
    • If installRemoteModule_version is empty → the existing blackfire.io/api/v1/releases/probe/php/... URL (unchanged behavior).
    • Otherwise → the versioned packages.blackfire.io/binaries/blackfire-php/<version>/... URL.
  • The existing curl ... | tar xz invocation now consumes "$installRemoteModule_url" instead of the hardcoded API URL.

The existing $installRemoteModule_distro (alpine/linux), $installRemoteModule_tmp1 (amd64/arm64/i386) and $installRemoteModule_tmp2 (PHP major+minor, optionally -zts) variables are reused for both URL shapes, so architecture, distro and ZTS detection logic is shared between the unversioned and versioned code paths.

Backwards compatibility

Behavior of install-php-extensions blackfire (no version) is unchanged — the same API endpoint is hit and the same probe (latest) is installed. Only the new blackfire-<version> form exercises the new code path.

@Teko012
Copy link
Copy Markdown
Contributor Author

Teko012 commented May 23, 2026

The pipeline failure seems to be unrelated

@Teko012
Copy link
Copy Markdown
Contributor Author

Teko012 commented May 25, 2026

@mlocati What do you think about this?

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