diff --git a/examples/php/echo/apache.Dockerfile b/examples/php/echo/apache.Dockerfile index a9c20d9439e..3a670f1c699 100644 --- a/examples/php/echo/apache.Dockerfile +++ b/examples/php/echo/apache.Dockerfile @@ -18,7 +18,7 @@ FROM composer:1.8.6 as composer FROM grpc-php/base as grpc-base -FROM php:7.4-apache-buster +FROM php:8.1-apache-buster RUN apt-get -qq update && apt-get -qq install -y git diff --git a/examples/php/echo/base.Dockerfile b/examples/php/echo/base.Dockerfile index 33c0422897b..c1709c2de6d 100644 --- a/examples/php/echo/base.Dockerfile +++ b/examples/php/echo/base.Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM php:7.4-buster +FROM php:8.1-buster RUN apt-get -qq update && apt-get -qq install -y \ autoconf automake cmake curl git libtool \ diff --git a/examples/php/echo/cli.Dockerfile b/examples/php/echo/cli.Dockerfile index 7b067744471..80eb168083c 100644 --- a/examples/php/echo/cli.Dockerfile +++ b/examples/php/echo/cli.Dockerfile @@ -18,7 +18,7 @@ FROM composer:1.8.6 as composer FROM grpc-php/base as grpc-base -FROM php:7.4-buster +FROM php:8.1-buster RUN apt-get -qq update && apt-get -qq install -y git diff --git a/examples/php/echo/fpm.Dockerfile b/examples/php/echo/fpm.Dockerfile index be2aad50346..7ace7bb39b8 100644 --- a/examples/php/echo/fpm.Dockerfile +++ b/examples/php/echo/fpm.Dockerfile @@ -18,7 +18,7 @@ FROM composer:1.8.6 as composer FROM grpc-php/base as grpc-base -FROM php:7.4-fpm-buster +FROM php:8.1-fpm-buster RUN apt-get -qq update && apt-get -qq install -y git diff --git a/src/php/bin/build_all_docker_images.sh b/src/php/bin/build_all_docker_images.sh index 0289f98edc9..3ce94f22be7 100755 --- a/src/php/bin/build_all_docker_images.sh +++ b/src/php/bin/build_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-zts - fork-support i386 php8 php8.2 ) + fork-support i386 php8.2 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/bin/run_all_docker_images.sh b/src/php/bin/run_all_docker_images.sh index 65cfa628d91..88842b484ab 100755 --- a/src/php/bin/run_all_docker_images.sh +++ b/src/php/bin/run_all_docker_images.sh @@ -17,7 +17,7 @@ set -e cd $(dirname $0)/../../.. ALL_IMAGES=( grpc-ext grpc-src alpine centos7 php-src php-zts - fork-support i386 php8 php8.2 ) + fork-support i386 php8.2 ) if [[ "$1" == "--cmds" ]]; then for arg in "${ALL_IMAGES[@]}" diff --git a/src/php/docker/alpine/Dockerfile b/src/php/docker/alpine/Dockerfile index 0d22f83023a..ba90d586179 100644 --- a/src/php/docker/alpine/Dockerfile +++ b/src/php/docker/alpine/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM php:7.4-alpine3.15 +FROM php:8.1-alpine3.15 RUN apk add autoconf g++ make zlib-dev git bash wget linux-headers @@ -21,8 +21,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/centos7/Dockerfile b/src/php/docker/centos7/Dockerfile index ae82aa7a335..d1610f87d6e 100644 --- a/src/php/docker/centos7/Dockerfile +++ b/src/php/docker/centos7/Dockerfile @@ -21,13 +21,12 @@ RUN yum update -y && \ SHELL [ "/usr/bin/scl", "enable", "devtoolset-7"] RUN yum install epel-release -y && \ - rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm && \ - rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && \ - yum --enablerepo=remi-php74 install php -y && \ - yum-config-manager --enable remi-php74 > /dev/null && \ + yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y && \ + yum --enablerepo=remi-php81 install php -y && \ + yum-config-manager --enable remi-php81 > /dev/null && \ yum install -y make wget which \ - gmp-devel libmpc-devel mpfr-devel yum-utils \ - php-devel php-fpm php-pear && \ + gmp-devel libmpc-devel mpfr-devel yum-utils \ + php-mbstring php-devel php-fpm php-pear && \ yum clean all -y ARG MAKEFLAGS=-j8 @@ -35,8 +34,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/grpc-ext/Dockerfile b/src/php/docker/grpc-ext/Dockerfile index 9d8aac7be6a..8f4367f6a63 100644 --- a/src/php/docker/grpc-ext/Dockerfile +++ b/src/php/docker/grpc-ext/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM php:7.4-buster +FROM php:8.1-buster RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \ autoconf automake git libtool pkg-config \ @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/grpc-src/Dockerfile b/src/php/docker/grpc-src/Dockerfile index a099b73a38d..b27b10d644a 100644 --- a/src/php/docker/grpc-src/Dockerfile +++ b/src/php/docker/grpc-src/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM php:7.4-buster +FROM php:8.1-buster RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \ autoconf automake git libtool pkg-config \ @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/i386/Dockerfile b/src/php/docker/i386/Dockerfile index ab8da51af98..345a89a8d29 100644 --- a/src/php/docker/i386/Dockerfile +++ b/src/php/docker/i386/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM i386/php:7.4 +FROM i386/php:8.1 RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \ autoconf automake git libtool pkg-config \ @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php-src/Dockerfile b/src/php/docker/php-src/Dockerfile index a6f4fc9d5da..47f89535e4b 100644 --- a/src/php/docker/php-src/Dockerfile +++ b/src/php/docker/php-src/Dockerfile @@ -23,8 +23,8 @@ RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \ WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit @@ -34,7 +34,7 @@ ARG MAKEFLAGS=-j8 RUN git clone https://github.com/php/php-src . -RUN git checkout php-7.4.33 && \ +RUN git checkout php-8.1.27 && \ ./buildconf --force && \ ./configure --build=x86_64-linux-gnu --enable-option-checking=fatal \ --enable-debug --enable-pcntl \ diff --git a/src/php/docker/php-zts/Dockerfile b/src/php/docker/php-zts/Dockerfile index ab817e8de6c..c5da22f549c 100644 --- a/src/php/docker/php-zts/Dockerfile +++ b/src/php/docker/php-zts/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM php:7.4-zts-buster +FROM php:8.1-zts-buster RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \ autoconf automake git libtool pkg-config \ @@ -23,8 +23,8 @@ ARG MAKEFLAGS=-j8 WORKDIR /tmp -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && \ - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && \ +RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ + mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ chmod +x /usr/local/bin/phpunit diff --git a/src/php/docker/php8/Dockerfile b/src/php/docker/php8/Dockerfile deleted file mode 100644 index 2094c5062c6..00000000000 --- a/src/php/docker/php8/Dockerfile +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright 2020 gRPC authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -FROM php:8.1-buster - -RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y \ - autoconf automake git libtool pkg-config \ - valgrind wget zlib1g-dev - -ARG MAKEFLAGS=-j8 - - -WORKDIR /tmp - -RUN wget https://phar.phpunit.de/phpunit-9.5.9.phar && \ - mv phpunit-9.5.9.phar /usr/local/bin/phpunit && \ - chmod +x /usr/local/bin/phpunit - - -WORKDIR /github/grpc - -COPY . . - -RUN pear package && \ - find . -name grpc-*.tgz | xargs -I{} pecl install {} - - -CMD ["/github/grpc/src/php/bin/run_tests.sh", "--skip-persistent-channel-tests", \ - "--ignore-valgrind-undef-errors"] - diff --git a/templates/src/php/docker/alpine/Dockerfile.template b/templates/src/php/docker/alpine/Dockerfile.template index b761a633712..58aafb8c560 100644 --- a/templates/src/php/docker/alpine/Dockerfile.template +++ b/templates/src/php/docker/alpine/Dockerfile.template @@ -23,7 +23,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> <%include file="../pecl_ext_build_src.include" /> diff --git a/templates/src/php/docker/centos7/Dockerfile.template b/templates/src/php/docker/centos7/Dockerfile.template index b5b28645f60..9c6637f4fcf 100644 --- a/templates/src/php/docker/centos7/Dockerfile.template +++ b/templates/src/php/docker/centos7/Dockerfile.template @@ -23,13 +23,12 @@ SHELL [ "/usr/bin/scl", "enable", "devtoolset-7"] RUN yum install epel-release -y && ${'\\'} - rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm && ${'\\'} - rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-7.rpm && ${'\\'} - yum --enablerepo=remi-php74 install php -y && ${'\\'} - yum-config-manager --enable remi-php74 > /dev/null && ${'\\'} + yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y && ${'\\'} + yum --enablerepo=remi-php81 install php -y && ${'\\'} + yum-config-manager --enable remi-php81 > /dev/null && ${'\\'} yum install -y make wget which ${'\\'} - gmp-devel libmpc-devel mpfr-devel yum-utils ${'\\'} - php-devel php-fpm php-pear && ${'\\'} + gmp-devel libmpc-devel mpfr-devel yum-utils ${'\\'} + php-mbstring php-devel php-fpm php-pear && ${'\\'} yum clean all -y ARG MAKEFLAGS=-j8 @@ -37,7 +36,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> <%include file="../pecl_ext_build_src.include" /> diff --git a/templates/src/php/docker/download_phpunit.include b/templates/src/php/docker/download_phpunit.include deleted file mode 100644 index 11da1d8d0df..00000000000 --- a/templates/src/php/docker/download_phpunit.include +++ /dev/null @@ -1,3 +0,0 @@ -RUN wget https://phar.phpunit.de/phpunit-8.5.13.phar && ${'\\'} - mv phpunit-8.5.13.phar /usr/local/bin/phpunit && ${'\\'} - chmod +x /usr/local/bin/phpunit diff --git a/templates/src/php/docker/grpc-ext/Dockerfile.template b/templates/src/php/docker/grpc-ext/Dockerfile.template index 8b4b9e000f9..516b818e876 100644 --- a/templates/src/php/docker/grpc-ext/Dockerfile.template +++ b/templates/src/php/docker/grpc-ext/Dockerfile.template @@ -25,7 +25,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> <%include file="../pecl_ext_build_src.include" /> diff --git a/templates/src/php/docker/grpc-src/Dockerfile.template b/templates/src/php/docker/grpc-src/Dockerfile.template index 40a2ab1da1e..888f99d35d2 100644 --- a/templates/src/php/docker/grpc-src/Dockerfile.template +++ b/templates/src/php/docker/grpc-src/Dockerfile.template @@ -25,7 +25,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> WORKDIR /github/grpc diff --git a/templates/src/php/docker/i386/Dockerfile.template b/templates/src/php/docker/i386/Dockerfile.template index 0c498fe6db3..ae3724d4b32 100644 --- a/templates/src/php/docker/i386/Dockerfile.template +++ b/templates/src/php/docker/i386/Dockerfile.template @@ -25,7 +25,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> <%include file="../pecl_ext_build_src.include" /> diff --git a/templates/src/php/docker/php-src/Dockerfile.template b/templates/src/php/docker/php-src/Dockerfile.template index 87c7d1e9426..f90e57ee7c2 100644 --- a/templates/src/php/docker/php-src/Dockerfile.template +++ b/templates/src/php/docker/php-src/Dockerfile.template @@ -25,7 +25,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> WORKDIR /github/php-src @@ -33,7 +33,7 @@ RUN git clone https://github.com/php/php-src . - RUN git checkout php-7.4.33 && ${'\\'} + RUN git checkout php-8.1.27 && ${'\\'} ./buildconf --force && ${'\\'} ./configure --build=x86_64-linux-gnu --enable-option-checking=fatal ${'\\'} --enable-debug --enable-pcntl ${'\\'} diff --git a/templates/src/php/docker/php-zts/Dockerfile.template b/templates/src/php/docker/php-zts/Dockerfile.template index cddcaaddb10..630f9225bbb 100644 --- a/templates/src/php/docker/php-zts/Dockerfile.template +++ b/templates/src/php/docker/php-zts/Dockerfile.template @@ -25,7 +25,7 @@ WORKDIR /tmp - <%include file="../download_phpunit.include" /> + <%include file="../download_phpunit9.include" /> <%include file="../pecl_ext_build_src.include" /> diff --git a/templates/src/php/docker/php8/Dockerfile.template b/templates/src/php/docker/php8/Dockerfile.template deleted file mode 100644 index 558d15d947a..00000000000 --- a/templates/src/php/docker/php8/Dockerfile.template +++ /dev/null @@ -1,32 +0,0 @@ -%YAML 1.2 ---- | - # Copyright 2020 gRPC authors. - # - # Licensed under the Apache License, Version 2.0 (the "License"); - # you may not use this file except in compliance with the License. - # You may obtain a copy of the License at - # - # http://www.apache.org/licenses/LICENSE-2.0 - # - # Unless required by applicable law or agreed to in writing, software - # distributed under the License is distributed on an "AS IS" BASIS, - # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - # See the License for the specific language governing permissions and - # limitations under the License. - - FROM php:8.1-buster - - RUN apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq install -y ${'\\'} - autoconf automake git libtool pkg-config ${'\\'} - valgrind wget zlib1g-dev - - ARG MAKEFLAGS=-j8 - - - WORKDIR /tmp - - <%include file="../download_phpunit9.include" /> - - <%include file="../pecl_ext_build_src.include" /> - - <%include file="../dockerfile_cmd.include" /> diff --git a/tools/buildgen/plugins/expand_version.py b/tools/buildgen/plugins/expand_version.py index ddf53eabdc2..6877d1d0ee6 100755 --- a/tools/buildgen/plugins/expand_version.py +++ b/tools/buildgen/plugins/expand_version.py @@ -106,7 +106,7 @@ class Version: return "%d.%d.%d" % (self.major, self.minor, self.patch) def php_current_version(self): - return "7.4" + return "8.1" def php_debian_version(self): return "buster" diff --git a/tools/internal_ci/helper_scripts/prepare_build_macos_rc b/tools/internal_ci/helper_scripts/prepare_build_macos_rc index a0d9c285242..b5768a0c317 100644 --- a/tools/internal_ci/helper_scripts/prepare_build_macos_rc +++ b/tools/internal_ci/helper_scripts/prepare_build_macos_rc @@ -196,19 +196,22 @@ fi if [ "${PREPARE_BUILD_INSTALL_DEPS_PHP}" == "true" ] then - # php7.4 should already be installed on kokoro monterey image, so this should be instantaneous. - time brew install php@7.4 || true - export LDFLAGS="-L/usr/local/opt/php@7.4/lib ${LDFLAGS}" - export CPPFLAGS="-I/usr/local/opt/php@7.4/include ${CPPFLAGS}" - export PATH="/usr/local/opt/php@7.4/bin:/usr/local/opt/php@7.4/sbin:${PATH}" + time brew install php@8.1 || true + export LDFLAGS="-L/usr/local/opt/php@8.1/lib ${LDFLAGS}" + export CPPFLAGS="-I/usr/local/opt/php@8.1/include ${CPPFLAGS}" + export PATH="/usr/local/opt/php@8.1/bin:/usr/local/opt/php@8.1/sbin:${PATH}" - # the exit code from "brew install php@7.4" is useless + # the exit code from "brew install php@8.1" is useless # so instead we check if PHP was indeed installed successfully. # Failing early is better than cryptic errors later in the build process. - /usr/local/opt/php@7.4/bin/php --version + /usr/local/opt/php@8.1/bin/php --version # Workaround for https://github.com/Homebrew/homebrew-core/issues/41081 mkdir -p /usr/local/lib/php/pecl + + # Download the right version of phpunit to match PHP version + sudo curl -sSL https://phar.phpunit.de/phpunit-9.5.9.phar -o /usr/local/bin/phpunit + sudo chmod +x /usr/local/bin/phpunit fi # TODO(jtattermusch): better debugging of clock skew, remove once not needed