From 8414ebed98f9388e9b4f4a46f5fcb7146828f605 Mon Sep 17 00:00:00 2001 From: Mickael Plassard Date: Fri, 23 Jan 2026 14:43:59 +0100 Subject: [PATCH 1/2] First test buildpack --- support/ext/blackfire | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/support/ext/blackfire b/support/ext/blackfire index 132c8f8d..7e0552df 100755 --- a/support/ext/blackfire +++ b/support/ext/blackfire @@ -51,9 +51,10 @@ find ${PREFIX} -type f \( -executable -o -name '*.a' \) -exec sh -c "file -i '{} # gets sourced on container boot cat > "${PREFIX}/bin/profile.blackfire.sh" <<'EOF' if [[ -n "$BLACKFIRE_SERVER_TOKEN" && -n "$BLACKFIRE_SERVER_ID" ]]; then - if [[ -f "/app/vendor/php/bin/blackfire-agent" ]]; then + if [[ -f "/app/vendor/php/bin/blackfire" ]]; then touch /app/vendor/php/var/blackfire/run/agent.sock - /app/vendor/php/bin/blackfire-agent -config=/app/vendor/php/etc/blackfire/agent.ini -socket="unix:///app/vendor/php/var/blackfire/run/agent.sock" & + export BLACKFIRE_SOCKET="unix:///app/vendor/php/var/blackfire/run/agent.sock" + /app/vendor/php/bin/blackfire agent:start & else echo >&2 "WARNING: Add-on 'blackfire' detected, but PHP extension not yet installed. Push an update to the application to finish installation of the add-on; an empty change ('git commit --allow-empty') is sufficient." fi @@ -68,3 +69,8 @@ blackfire.server_token = ${BLACKFIRE_SERVER_TOKEN} blackfire.server_id = ${BLACKFIRE_SERVER_ID} blackfire.agent_socket = "unix:///app/vendor/php/var/blackfire/run/agent.sock" EOF + + +## Line 54: changing to /app/vendor/php/bin/blackfire as we use blackfire agent:start below to start it and not blackfire-agent anymore +## Line 56: Export and set the env var to run outside of this shell (Not if it should not be run in the compile file) +## Line 57: Change to blackfire command as mentioned here: https://docs.blackfire.io/up-and-running/agent-upgrade \ No newline at end of file From e54983b41ba2efe7c5ab85930cc9c02538758e46 Mon Sep 17 00:00:00 2001 From: Mickael Plassard Date: Mon, 26 Jan 2026 16:07:18 +0100 Subject: [PATCH 2/2] fix(blackrock):Remove use of deprecated -config and -socket option --- support/ext/blackfire | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/support/ext/blackfire b/support/ext/blackfire index 7e0552df..f90e7ff5 100755 --- a/support/ext/blackfire +++ b/support/ext/blackfire @@ -49,12 +49,16 @@ echo -e "[blackfire]\nserver-id=f1abf3a8-3f85-4743-99b2-97f066c099b9\nserver-tok find ${PREFIX} -type f \( -executable -o -name '*.a' \) -exec sh -c "file -i '{}' | grep -Eq 'application/x-(archive|executable|sharedlib); charset=binary'" \; -print | xargs strip --strip-unneeded # gets sourced on container boot +blackfire_bin="/app/vendor/php/bin/blackfire" +blackfire_socket="/app/vendor/php/var/blackfire/run/agent.sock" cat > "${PREFIX}/bin/profile.blackfire.sh" <<'EOF' if [[ -n "$BLACKFIRE_SERVER_TOKEN" && -n "$BLACKFIRE_SERVER_ID" ]]; then - if [[ -f "/app/vendor/php/bin/blackfire" ]]; then - touch /app/vendor/php/var/blackfire/run/agent.sock - export BLACKFIRE_SOCKET="unix:///app/vendor/php/var/blackfire/run/agent.sock" - /app/vendor/php/bin/blackfire agent:start & + if [[ -f "${blackfire_bin}" ]]; then + touch "${blackfire_socket}" + export BLACKFIRE_CONFIG="/dev/null" + export BLACKFIRE_SOCKET="unix://${blackfire_socket}" + + "${blackfire_bin}" agent:start & else echo >&2 "WARNING: Add-on 'blackfire' detected, but PHP extension not yet installed. Push an update to the application to finish installation of the add-on; an empty change ('git commit --allow-empty') is sufficient." fi @@ -64,13 +68,4 @@ EOF mkdir --parents "${PREFIX}/etc/php/conf.d" cat > "${PREFIX}/etc/conf.d/blackfire.ini" <<'EOF' extension = blackfire.so - -blackfire.server_token = ${BLACKFIRE_SERVER_TOKEN} -blackfire.server_id = ${BLACKFIRE_SERVER_ID} -blackfire.agent_socket = "unix:///app/vendor/php/var/blackfire/run/agent.sock" -EOF - - -## Line 54: changing to /app/vendor/php/bin/blackfire as we use blackfire agent:start below to start it and not blackfire-agent anymore -## Line 56: Export and set the env var to run outside of this shell (Not if it should not be run in the compile file) -## Line 57: Change to blackfire command as mentioned here: https://docs.blackfire.io/up-and-running/agent-upgrade \ No newline at end of file +EOF \ No newline at end of file