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

PHP 8.4.2 and simdjson #69

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ARG BUILD_DEV=0
COPY . /src
RUN apk add bash && \
cd /src && \
./build-alpine 8.3.15 0 $BUILD_DEV && \
./build-alpine 8.4.2 0 $BUILD_DEV && \
mv build/dist/bin/php /usr/bin/manticore-executor && \
ln -s /usr/bin/manticore-executor /usr/bin/php && \
cd ../..
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile-dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apt-get update -y && \
COPY ./build-linux ./build-linux
COPY ./build-bash-base.sh ./build-bash-base.sh
COPY ./helper.sh ./helper.sh
RUN ./build-linux 8.3.15 0 0 && \
RUN ./build-linux 8.4.2 0 0 && \
cp build/dist/bin/php /usr/bin/manticore-executor && \
rm -fr build

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.15` with the following extensions enabled and compiled into the executable statically:
We build executor from `PHP 8.4.2` with the following extensions enabled and compiled into the executable statically:

* pcntl
* posix
Expand Down Expand Up @@ -82,10 +82,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.3.15`. 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.4.2`. To build the binary, you should run the following example:

```bash
./build-linux "8.3.15"
./build-linux "8.4.2"
```

The command above will build the package on Linux with **PHP** `8.3.15`. Once it's done, you can find your binary in folder `dist/bin`.
The command above will build the package on Linux with **PHP** `8.4.2`. Once it's done, you can find your binary in folder `dist/bin`.
1 change: 1 addition & 0 deletions build-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ENABLE_STATIC=yes
--enable-swoole \
--with-rdkafka \
--enable-jchash \
--enable-simdjson \
--with-openssl --with-zlib --with-zip \
--enable-filter \
--with-curl \
Expand Down
24 changes: 20 additions & 4 deletions build-bash-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ set -e

PHP_VERSION="$1"
ZSTD_REV="2dfcd6524ccdcef6dfdaa97d7f3716b866885093"
DS_REV="d42750d69beb684ec3ef7b3da48fba769ce57ffc"
SWOOLE_REV="2dcfef90b3dbcfc08783747ea9abf6ebaf7eedb8"
RDKAFKA_REV="bcd5004f461d1d3a5f879bb21280bdde6f6800c2"
DS_REV="da4d2f2a2c0f3732b34562636849c5e52e79e6c3"
SWOOLE_REV="3e1a1f89930ba0bbea1f5ee31bcd0ee701a87aab"
RDKAFKA_REV="53398031f1cd96e437e9705b67b4dc19d955acb6"
JCHASH_REV="8ed50cc8c211effe1c214eae1e3240622e0f11b0"
SIMDJSON_REV="9a2745669fea733a40f9443b1a793846d0759b89"
SKIP_SYSTEM_DEPS="$2"
BUILD_DEV="$3"
BUILD_STATIC=1 # Always build static but dev
Expand Down Expand Up @@ -65,6 +66,19 @@ git clone https://github.com/c9s/jchash.git
cd jchash && git checkout "$JCHASH_REV"
cd ..

git clone https://github.com/crazyxman/simdjson_php.git
mv simdjson_php simdjson
cd simdjson && git checkout "$SIMDJSON_REV"
# Clean up php version ncheck that fails when we build without phpize
if [ "$(uname)" == "Darwin" ]; then
# macOS (OSX)
sed -i '' '9,24d' config.m4
else
# Linux
sed -i '9,24d' config.m4
fi
cd ..

cd ..

BUILD_EXTRA=()
Expand All @@ -87,7 +101,9 @@ if [[ "$BUILD_DEV" == "1" ]]; then
"--enable-debug"
# "--enable-memprof"
# "--enable-memprof-debug"
"--enable-tideways-xhprof"
#
# It does not work with PHP 8.4.2
# "--enable-tideways-xhprof"
# "--enable-xdebug"
)
fi
Expand Down
1 change: 1 addition & 0 deletions build-linux
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ ENABLE_STATIC=yes
--enable-swoole \
--with-rdkafka \
--enable-jchash \
--enable-simdjson \
--with-openssl --with-zlib --with-zip \
--enable-filter \
--with-curl \
Expand Down
1 change: 1 addition & 0 deletions build-osx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ chmod +x configure
--enable-swoole \
--with-rdkafka \
--enable-jchash \
--enable-simdjson \
--with-openssl --with-zlib --with-zip \
--enable-filter \
--with-curl \
Expand Down
9 changes: 5 additions & 4 deletions helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ build_dev_conf() {
git checkout 68eb143bd5700a6fe041826118aeb9a13a3fcef3
cd ..

git clone https://github.com/tideways/php-xhprof-extension.git tideways_xhprof && cd "$_"
git checkout 6ee298f910a3661960f454bd6a787686657c7570
cd ..
# It does not work with PHP 8.4.2
# git clone https://github.com/tideways/php-xhprof-extension.git tideways_xhprof && cd "$_"
# git checkout 7877082945fcccced12676749676af1736a00f65
# cd ..

# Still not working due to zend
# git clone https://github.com/donhardman/xdebug.git xdebug && cd "$_"
Expand All @@ -83,4 +84,4 @@ fix_static_linking() {
sed -ie 's/PHP_INI_ENTRY("openssl.cafile", NULL, PHP_INI_PERDIR, NULL)/PHP_INI_ENTRY("openssl.cafile", "\/etc\/ssl\/cert.pem", PHP_INI_PERDIR, NULL)/g' ext/openssl/openssl.c
sed -ie 's/-export-dynamic//g' Makefile
sed -ie 's/-o $(SAPI_CLI_PATH)/-all-static -o $(SAPI_CLI_PATH)/g' Makefile
}
}
Loading