Skip to content

Commit d932c89

Browse files
committed
ci: add PHP 8.3 NTS+ASAN build
The goal is to run the sanitizer on certain profiling tests. As the profiler only supports NTS builds at this time, it needs an NTS+ASAN configuration.
1 parent 96ce878 commit d932c89

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

dockerfiles/ci/buster/php-8.3/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,29 @@ COPY build-extensions.sh /home/circleci
6262
RUN /home/circleci/build-extensions.sh
6363
RUN cp /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/debug-zts-asan/bin/php
6464

65+
FROM build as php-nts-asan
66+
ARG TARGETPLATFORM
67+
RUN /home/circleci/build-php.sh $TARGETPLATFORM $PHP_INSTALL_DIR nts-asan $PHP_VERSION \
68+
&& mv /tmp/build-php/sapi/cli/php /tmp/build-php/sapi/cli/php-asan
69+
# For reasons the asan build just ... crashes in qemu (or executed via
70+
# bytecode interpreter). The binary itself however perfectly works on the
71+
# target platform. Put a working php binary there to continue installation
72+
# and be happy, then copy back later.
73+
COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug/bin/php /tmp/build-php/sapi/cli/php
74+
RUN set -eux; \
75+
ln -s $PHP_INSTALL_DIR/nts-asan $PHP_INSTALL_DIR/debug; \
76+
cd /tmp/build-php; \
77+
touch sapi/cli/php; \
78+
make install; \
79+
switch-php nts-asan;
80+
COPY build-extensions.sh /home/circleci
81+
RUN /home/circleci/build-extensions.sh
82+
RUN mv /tmp/build-php/sapi/cli/php-asan $PHP_INSTALL_DIR/nts-asan/bin/php
83+
6584
FROM base as final
6685
COPY --chown=circleci:circleci --from=src $PHP_SRC_DIR $PHP_SRC_DIR
6786
COPY --chown=circleci:circleci --from=php-debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan $PHP_INSTALL_DIR/debug-zts-asan
87+
COPY --chown=circleci:circleci --from=php-nts-asan $PHP_INSTALL_DIR/nts-asan $PHP_INSTALL_DIR/nts-asan
6888
COPY --chown=circleci:circleci --from=php-debug $PHP_INSTALL_DIR/debug $PHP_INSTALL_DIR/debug
6989
COPY --chown=circleci:circleci --from=php-nts $PHP_INSTALL_DIR/nts $PHP_INSTALL_DIR/nts
7090
COPY --chown=circleci:circleci --from=php-zts $PHP_INSTALL_DIR/zts $PHP_INSTALL_DIR/zts

0 commit comments

Comments
 (0)