diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dafccc3..01951fb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ on: env: APP_NAME: 'manticore-executor' DOCKER_TAG: 'manticoresearch/manticore-executor' - PHP_VERSION: '8.4.18' + PHP_VERSION: '8.5.10' MAINTAINER: 'Manticore' DESC: 'Custom built PHP executor for Manticore.' EXTRA_NAME: 'manticore-extra' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3a3e514..a1d8e66 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ on: env: APP_NAME: 'manticore-executor' - PHP_VERSION: '8.4.18' + PHP_VERSION: '8.5.10' MAINTAINER: 'Manticore' DESC: 'Custom built PHP executor for Manticore.' @@ -52,7 +52,7 @@ jobs: run: ${{ matrix.script_name }} ${{ env.PHP_VERSION }} - name: Build binary using Docker if: ${{ matrix.use_docker == true }} - run: docker run -v ${PWD}:/src -w /src alpine:3.21 sh -c "apk add sudo bash; ${{ matrix.script_name }} ${{ env.PHP_VERSION }}" + run: docker run -v ${PWD}:/src -w /src alpine:3.23 sh -c "apk add sudo bash; ${{ matrix.script_name }} ${{ env.PHP_VERSION }}" - name: Create artifact run: | os="${{ runner.os }}" diff --git a/Dockerfile b/Dockerfile index 386c41d..7241ebb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,11 @@ -FROM alpine:3.21 +FROM alpine:3.23 ARG BUILD_DEV=0 # Install the manticore-executor binary COPY . /src RUN apk add bash && \ cd /src && \ - ./build-alpine 8.4.18 0 $BUILD_DEV && \ + ./build-alpine 8.5.10 0 $BUILD_DEV && \ mv build/dist/bin/php /usr/bin/manticore-executor && \ ln -s /usr/bin/manticore-executor /usr/bin/php && \ cd ../.. diff --git a/README.md b/README.md index 88f4e2a..322419a 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Manticore Executor is a custom built PHP binary which: By default, we disable all extensions and enable only those required to run our scripts. -We build executor from `PHP 8.4.18` with the following extensions enabled and compiled into the executable statically: +We build executor from `PHP 8.5.10` with the following extensions enabled and compiled into the executable statically: * pcntl * posix @@ -84,10 +84,10 @@ Several scripts used to build the final package: * `build-linux` * `build-osx` -The scripts accept a version of PHP as a parameter. The current version is `8.4.18`. To build the binary, you should run the following example: +The scripts accept a version of PHP as a parameter. The current version is `8.5.10`. To build the binary, you should run the following example: ```bash -./build-linux "8.4.18" +./build-linux "8.5.10" ``` -The command above will build the package on Linux with **PHP** `8.4.18`. Once it's done, you can find your binary in folder `dist/bin`. \ No newline at end of file +The command above will build the package on Linux with **PHP** `8.5.10`. Once it's done, you can find your binary in folder `dist/bin`. \ No newline at end of file diff --git a/build-alpine b/build-alpine index 321d0a2..1f10053 100755 --- a/build-alpine +++ b/build-alpine @@ -22,12 +22,12 @@ install_deps() { ln -s /usr/bin/objcopy "/usr/bin/${arch}-alpine-linux-musl-objcopy" export CROSS_COMPILE="/usr/bin/${arch}-alpine-linux-musl-" - apk add php84 php84-dev curl git autoconf bison re2c pkgconf zlib-dev zstd-static zstd-dev openssl-libs-static openssl-dev zlib-static zlib-dev gnu-libiconv-dev clang-dev llvm-dev + apk add php85 php85-dev curl git autoconf bison re2c pkgconf zlib-dev zstd-static zstd-dev openssl-libs-static openssl-dev zlib-static zlib-dev gnu-libiconv-dev clang-dev llvm-dev - # Create symlinks for php84 to be accessible as php - ln -sf /usr/bin/php84 /usr/bin/php - ln -sf /usr/bin/php-config84 /usr/bin/php-config - ln -sf /usr/bin/phpize84 /usr/bin/phpize + # Create symlinks for php85 to be accessible as php + ln -sf /usr/bin/php85 /usr/bin/php + ln -sf /usr/bin/php-config85 /usr/bin/php-config + ln -sf /usr/bin/phpize85 /usr/bin/phpize install_curl @@ -94,7 +94,7 @@ fix_static_linking make LDFLAGS=$MAKE_LDFLAGS -j8 make install-cli -# Remove php84 that was used for building before installing php -apk del php84 php84-dev +# Remove php85 that was used for building before installing php +apk del php85 php85-dev rm -f /usr/bin/php /usr/bin/php-config /usr/bin/phpize diff --git a/build-bash-base.sh b/build-bash-base.sh index ff24649..6b741cd 100644 --- a/build-bash-base.sh +++ b/build-bash-base.sh @@ -9,8 +9,8 @@ set -e PHP_VERSION="$1" ZSTD_REV="d6d26eb805058fc672686715a7b5e39d8f65dd36" -DS_REV="118c06b8863386ceada4238f3cec18ab84c9efb7" -SWOOLE_REV="d611ff3ca60e8c9425b2e2e3ba1a9004faab64f5" +DS_REV="132ca69b19c80fba8a447f87d656c27596f43cec" +SWOOLE_REV="8e8c49915ca5f9dcb9ee654f9e336a9c88dd375e" RDKAFKA_REV="53398031f1cd96e437e9705b67b4dc19d955acb6" JCHASH_REV="8ed50cc8c211effe1c214eae1e3240622e0f11b0" SIMDJSON_REV="9a2745669fea733a40f9443b1a793846d0759b89" diff --git a/build-linux b/build-linux index 7cb3adf..92171cc 100755 --- a/build-linux +++ b/build-linux @@ -20,7 +20,7 @@ install_deps() { sudo apt-get install -y software-properties-common sudo add-apt-repository ppa:ondrej/php -y sudo apt-get update -y - sudo apt-get install -y php8.4 php8.4-dev php8.4-cli build-essential clang libclang-dev pkg-config curl autoconf automake bison re2c libzstd-dev git libssl-dev zlib1g-dev libzip-dev libonig-dev cmake libcurl4-openssl-dev librdkafka-dev libiconv-hook-dev wget + sudo apt-get install -y php8.5 php8.5-dev php8.5-cli build-essential clang libclang-dev pkg-config curl autoconf automake bison re2c libzstd-dev git libssl-dev zlib1g-dev libzip-dev libonig-dev cmake libcurl4-openssl-dev librdkafka-dev libiconv-hook-dev wget # Install LLVM 17 directly from apt.llvm.org wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg echo "deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main" | sudo tee /etc/apt/sources.list.d/llvm.list > /dev/null @@ -75,6 +75,6 @@ ENABLE_STATIC=yes make -j8 make install-cli -# Remove php84 that was used for building before installing php -sudo apt-get remove -y php8.4-dev php8.4-cli php8.4 +# Remove php85 that was used for building before installing php +sudo apt-get remove -y php8.5-dev php8.5-cli php8.5 diff --git a/build-osx b/build-osx index 31bd7f7..c618f9f 100755 --- a/build-osx +++ b/build-osx @@ -11,11 +11,14 @@ set -e install_deps() { brew tap shivammathur/php - brew install shivammathur/php/php@8.4 bash curl autoconf automake bison re2c zstd git openssl zlib cmake libzip librdkafka libiconv llvm@17 - brew link --overwrite --force shivammathur/php/php@8.4 + # GitHub macOS runners ship php from homebrew/core; brew refuses to + # install a same-named formula from another tap, so drop the core one first + brew uninstall --force --ignore-dependencies php || true + brew install shivammathur/php/php bash curl autoconf automake bison re2c zstd git openssl zlib cmake libzip librdkafka libiconv llvm@17 + brew link --overwrite --force shivammathur/php/php # Add PHP to PATH - include both versioned path and brew bin directory - PHP_PREFIX="$(brew --prefix shivammathur/php/php@8.4)" + PHP_PREFIX="$(brew --prefix shivammathur/php/php)" BREW_PREFIX="$(brew --prefix)" export PATH="${PHP_PREFIX}/bin:${BREW_PREFIX}/bin:${PATH}" @@ -58,7 +61,7 @@ fi bison_ver=$(bison --version | head -n1 | cut -d' ' -f4) if [[ "$bison_ver" =~ ^2\.[0-9]+$ ]]; then if which brew; then - bison=$(brew info bison | grep files | cut -d' ' -f1) + bison="$(brew --prefix bison)" else bison=$(test -d /usr/local/opt && echo "$_" || which /usr) fi diff --git a/helper.sh b/helper.sh index 83ccc0a..361ae99 100644 --- a/helper.sh +++ b/helper.sh @@ -23,7 +23,9 @@ install_libzip() { test -d libzip-1.9.2 && rm -fr "$_" curl -sSL https://github.com/nih-at/libzip/releases/download/v1.9.2/libzip-1.9.2.tar.gz | tar -xzf - cd libzip-1.9.2 && mkdir -p build && cd build - cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_LZMA=OFF -DENABLE_BZIP2=OFF .. + # libzip 1.9.2 declares cmake_minimum_required 3.0.2; Alpine 3.23's CMake 4 + # refuses projects older than 3.5 unless this policy floor is passed + cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DBUILD_SHARED_LIBS=OFF -DENABLE_LZMA=OFF -DENABLE_BZIP2=OFF .. make -j4 && make install cd ../.. rm -fr libzip-1.9.2