Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for PHP 8.4 and update libraries #578

Merged
merged 13 commits into from
Dec 26, 2024
Merged

Conversation

mu1f407
Copy link
Contributor

@mu1f407 mu1f407 commented Dec 25, 2024

Hi, this PR adds a build for PHP 8.4 for all extensions that are currently built for 8.3.

The versions of the libraries are also updated to the latest ones. In some cases the update is over the major version.

We will see how the CI tests turn out. If there are any problems, I will take the specific extension out of PR and it will be handled separately later (by me or someone else).

@mnapoli
Copy link
Member

mnapoli commented Dec 26, 2024

Thanks! It seems like a few extensions failed, might as well remove them from the list for now?

It returns two paths separated by colon - /opt/bref/etc/php/conf.d:/var/task/php/conf.d
PHP 8.4 is not supported upstream and fails to compile on updated version
Fails and there is currently open PR for AVIF which makes some changes in build. Better to keep PHP 8.4 upgrade after this PR is merged.
Previously tar was packaged with path like ./tideways-5.6.6/, but now it is tideways-php-5.16.2/.
@mu1f407
Copy link
Contributor Author

mu1f407 commented Dec 26, 2024

Update summary:

PHP 8.4 not supported by upstream project yet:
elastic-apm
newrelic

Build fails, should be handled in separate PRs:
imagick
imap (moved to PECL in 8.4)
memcached
rdkafka
swoole

Successfully updated for PHP 8.4, but constrained by Amazon Linux 2 in some way:
amqp (old cmake for rabbitmq-c >=0.14; stick to 0.13)
oci8 (old glibc for Oracle Instant Client >=23; stick to 21.x)

Successfully updated for PHP 8.4:
blackfire
bsdiff
calendar
datadog (library major version update 0.96.0 -> 1.5.1)
decimal
ds
excimer
gmp
gnupg
grpc (not sure if it should take more than 10 minutes to compile for each PHP version)
h3
igbinary
ldap
mailparse
maxminddb
msgpack
odbc-snowflake (library major version update 2.25.0 -> 3.5.0)
opentelemetry
pcov
redis
redis-igbinary
relay
scoutapm
snmp
ssh2
symfony-runtime
tideways
tidy
uuid
xdebug
xlswriter
xmlrpc
yaml

@mu1f407 mu1f407 marked this pull request as ready for review December 26, 2024 14:00
Copy link
Member

@mnapoli mnapoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot! I added some questions inline to make sure I understand everything.

Some notes regarding the Datadog migration from 0.x to 1.x: https://github.com/DataDog/dd-trace-php/blob/1.0.0/UPGRADE-1.0.md (for those stumbling on this PR in the future).

@@ -19,7 +21,7 @@ RUN cmake --build . --target install
WORKDIR ${AMQP_BUILD_DIR}
RUN git clone https://github.com/php-amqp/php-amqp
WORKDIR ${AMQP_BUILD_DIR}/php-amqp
RUN git reset --hard 618e06ad2ef867598831cdd3faadba0dd65be917
RUN git checkout v2.1.2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit referenced php-amqp/php-amqp@618e06a, a fix for PHP 8.1. I assume this was needed back then when this commit was not tagged yet. Tag v2.1.2 is from Jan 22, 2024 and this fix is already contained in it. So this is basically an update of php-amqp source to latest release.


WORKDIR ${DDTRACE_BUILD_DIR}

RUN php datadog-setup.php --php-bin=all --enable-profiling

RUN cp "$(php-config --extension-dir)/ddtrace.so" /tmp/ddtrace.so && \
cp "$(php-config --extension-dir)/datadog-profiling.so" /tmp/datadog-profiling.so && \
cp "$(php-config --ini-dir)/98-ddtrace.ini" /tmp/ext.ini
cp "$(php-config --ini-dir | cut -d: -f1)/98-ddtrace.ini" /tmp/ext.ini
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The php-config --ini-dir returns /opt/bref/etc/php/conf.d:/var/task/php/conf.d. This cp command assumes that there is only single path in the output, otherwise the source file is not found. Probably, there was some change in build-php image recently, which changed the behavior and now contains two paths separated by colon. If you have better idea for fix, I would be happy to test and implement it.

curl -o oci-sdk.zip https://download.oracle.com/otn_software/linux/instantclient/2110000/instantclient-sdk-linux.x64-21.10.0.0.0dbru.zip && \
unzip oci-sdk.zip -d src
curl -o oci-basic.zip https://download.oracle.com/otn_software/linux/instantclient/2116000/instantclient-basiclite-linux.x64-21.16.0.0.0dbru.zip && \
unzip oci-basic.zip -d src -x META-INF/* && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -x META-INF/* excludes this directory from unzip extraction. Seems like it was not there previously and added at some time. These are some metadata like checksums of files, not needed for compilation. The issue is that both oci-basic.zip and oci-sdk.zip are extracted to single output directory src. Because there are equally named files in this directory, the unzip of the latter file causes interactive propmt: replace src/META-INF/MANIFEST.MF? [y]es, [n]o, [A]ll, [N]one, [r]ename: NULL (EOF or read error, treating as "[N]one" ...) and the unzip fails with error.

@mnapoli
Copy link
Member

mnapoli commented Dec 26, 2024

Awesome, thanks for the quick responses!

@mnapoli mnapoli merged commit cea23ab into brefphp:master Dec 26, 2024
37 checks passed
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.

2 participants