Skip to content

Commit

Permalink
feat: add PHP 8.3 support (#797)
Browse files Browse the repository at this point in the history
Adds non-OAPI PHP 8.3 support to the agent.

---------

Co-authored-by: Michael Fulbright <[email protected]>
  • Loading branch information
bduranleau-nr and mfulb authored Dec 18, 2023
1 parent c8fe3a8 commit 2f6cb3f
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
matrix:
platform: [gnu, musl]
arch: [amd64]
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
include:
- codecov: 0
- platform: gnu
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
matrix:
platform: [gnu, musl]
arch: [amd64]
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
include:
- codecov: 0
- platform: gnu
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
matrix:
platform: [gnu, musl]
php: ['8.0', '8.1', '8.2']
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout Repo
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/make-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: true
matrix:
platform: [gnu, musl]
php: ['8.0', '8.1', '8.2']
php: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout integration tests
uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ jobs:
env:
IMAGE_NAME: newrelic/nr-php-agent-builder
IMAGE_TAG: make-php
IMAGE_VERSION: ${{vars.MAKE_PHP_VERSION}}
IMAGE_VERSION: v2
strategy:
matrix:
platform: [gnu, musl]
arch: [amd64, arm64]
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
exclude:
- arch: arm64
php: '7.0'
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
matrix:
platform: [gnu, musl]
arch: [amd64, arm64]
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
exclude:
- arch: arm64
php: '7.0'
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
LIBC: ${{matrix.platform}}
PLATFORM: linux/${{matrix.arch}}
AGENT_CODE: ${{github.workspace}}/php-agent
IMAGE_VERSION: ${{vars.MAKE_PHP_VERSION}}
IMAGE_VERSION: v2
working-directory: ./php-agent
run: |
make test-services-start
Expand Down
13 changes: 11 additions & 2 deletions agent/newrelic-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,10 @@ for pmv in "20151012" "20160303" "20170718" "20180731" "20190902"; do
done
fi
# Currently supported versions:
# (8.0, 8.1, 8.2)
# (8.0, 8.1, 8.2, 8.3)
# for x64 and aarch64
if [ ${arch} = x64 ] || [ ${arch} = aarch64 ]; then
for pmv in "20200930" "20210902" "20220829"; do
for pmv in "20200930" "20210902" "20220829" "20230831"; do
check_file "${ilibdir}/agent/${arch}/newrelic-${pmv}.so"
done
fi
Expand Down Expand Up @@ -543,6 +543,7 @@ add_to_path /usr/local/php-7.4/bin
add_to_path /usr/local/php-8.0/bin
add_to_path /usr/local/php-8.1/bin
add_to_path /usr/local/php-8.2/bin
add_to_path /usr/local/php-8.3/bin

add_to_path /opt/local/bin
add_to_path /usr/php/bin
Expand All @@ -555,6 +556,7 @@ add_to_path /usr/php-7.4/bin
add_to_path /usr/php-8.0/bin
add_to_path /usr/php-8.1/bin
add_to_path /usr/php-8.2/bin
add_to_path /usr/php-8.3/bin

add_to_path /usr/php/7.0/bin
add_to_path /usr/php/7.1/bin
Expand All @@ -564,6 +566,7 @@ add_to_path /usr/php/7.4/bin
add_to_path /usr/php/8.0/bin
add_to_path /usr/php/8.1/bin
add_to_path /usr/php/8.2/bin
add_to_path /usr/php/8.3/bin

add_to_path /opt/php/bin
add_to_path /opt/zend/bin
Expand All @@ -576,6 +579,7 @@ add_to_path /opt/php-7.4/bin
add_to_path /opt/php-8.0/bin
add_to_path /opt/php-8.1/bin
add_to_path /opt/php-8.2/bin
add_to_path /opt/php-8.3/bin

if [ -n "${NR_INSTALL_PATH}" ]; then
oIFS="${IFS}"
Expand Down Expand Up @@ -1060,6 +1064,10 @@ for this copy of PHP. We apologize for the inconvenience.
pi_php8="yes"
;;

8.3.*)
pi_php8="yes"
;;

*)
error "unsupported version '${pi_ver}' of PHP found at:
${pdir}
Expand Down Expand Up @@ -1239,6 +1247,7 @@ does not exist. This particular instance of PHP will be skipped.
8.0.*) pi_modver="20200930" ;;
8.1.*) pi_modver="20210902" ;;
8.2.*) pi_modver="20220829" ;;
8.3.*) pi_modver="20230831" ;;
esac
log "${pdir}: pi_modver=${pi_modver}"

Expand Down
1 change: 1 addition & 0 deletions agent/php_includes.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#define ZEND_8_0_X_API_NO 20200930
#define ZEND_8_1_X_API_NO 20210902
#define ZEND_8_2_X_API_NO 20220829
#define ZEND_8_3_X_API_NO 20230831

#if ZEND_MODULE_API_NO >= ZEND_5_6_X_API_NO
#include "Zend/zend_virtual_cwd.h"
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ _(most operating systems package these with `-dev` or `-devel` suffixes)_

### PHP

The PHP agent supports PHP versions `7.0`, `7.1`, `7.2`, `7.3`, `7.4`,`8.0`, `8.1`, and `8.2`.
The PHP agent supports PHP versions `7.0`, `7.1`, `7.2`, `7.3`, `7.4`,`8.0`, `8.1`, '8.2', and `8.3`.

## Build the PHP Agent

Expand Down
2 changes: 1 addition & 1 deletion files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

ARG PHP_VER

FROM php:${PHP_VER:-8.2}
FROM php:${PHP_VER:-8.3}

RUN docker-php-source extract

Expand Down
2 changes: 1 addition & 1 deletion make/php_versions.mk
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# SPDX-License-Identifier: Apache-2.0
#

PHP_VERSION_LIST=$${PHPS:-8.2 8.1 8.0 7.4 7.3 7.2 7.1 7.0}
PHP_VERSION_LIST=$${PHPS:-8.3 8.2 8.1 8.0 7.4 7.3 7.2 7.1 7.0}
1 change: 1 addition & 0 deletions make/release.mk
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ release-$1-zts: Makefile agent | releases/$$(RELEASE_OS)/agent/$$(RELEASE_ARCH)/

endef

$(eval $(call RELEASE_AGENT_TARGET,8.3,20230831))
$(eval $(call RELEASE_AGENT_TARGET,8.2,20220829))
$(eval $(call RELEASE_AGENT_TARGET,8.1,20210902))
$(eval $(call RELEASE_AGENT_TARGET,8.0,20200930))
Expand Down

0 comments on commit 2f6cb3f

Please sign in to comment.