-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
182 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,4 @@ | |
} | ||
}, | ||
"dockerComposeFile": "./../compose.yaml", | ||
"service": "dev" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
{ | ||
"name": "pskel (for Local)", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"maelvalais.autoconf", | ||
"ms-azuretools.vscode-docker", | ||
"editorconfig.editorconfig" | ||
] | ||
} | ||
}, | ||
"dockerComposeFile": "./../../compose.yaml", | ||
"service": "dev", | ||
"mounts": [ | ||
{ | ||
"type": "bind", | ||
"source": "./", | ||
"target": "/workspace/pskel" | ||
} | ||
], | ||
"workspaceFolder": "/workspace/pskel" | ||
"name": "pskel (for Local)", | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"maelvalais.autoconf", | ||
"ms-azuretools.vscode-docker", | ||
"editorconfig.editorconfig" | ||
] | ||
} | ||
}, | ||
"dockerComposeFile": "./../../compose.yaml", | ||
"service": "shell", | ||
"mounts": [ | ||
{ | ||
"type": "bind", | ||
"source": "./", | ||
"target": "/workspace/pskel" | ||
} | ||
], | ||
"workspaceFolder": "/workspace/pskel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,129 +1,38 @@ | ||
ARG PLATFORM=linux/arm64/v8 | ||
ARG IMAGE=php | ||
ARG TAG=8.3-cli | ||
ARG TAG=8.3-cli-bookworm | ||
|
||
FROM ${IMAGE}:${TAG} | ||
FROM --platform=${PLATFORM} ${IMAGE}:${TAG} | ||
|
||
ARG PSKEL_SKIP_DEBUG="" | ||
ARG PSKEL_EXTRA_CONFIGURE_OPTIONS="" | ||
ARG PSKEL_SKIP_BUILD="" | ||
|
||
ENV USE_ZEND_ALLOC=0 | ||
ENV ZEND_DONT_UNLOAD_MODULES=1 | ||
ENV PSKEL_SKIP_DEBUG=${PSKEL_SKIP_DEBUG} | ||
ENV PSKEL_EXTRA_CONFIGURE_OPTIONS=${PSKEL_EXTRA_CONFIGURE_OPTIONS} | ||
COPY ./pskel.sh /usr/local/bin/pskel | ||
|
||
RUN if test -f "/etc/debian_version"; then \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND="noninteractive" apt-get install -y \ | ||
"build-essential" "bison" "valgrind" "llvm" "clang" "zlib1g-dev" "libsqlite3-dev" "git" && \ | ||
if test "${PSKEL_SKIP_DEBUG}" = ""; then \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CFLAGS="-fpic -fpie -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-pie" ./configure --disable-all \ | ||
--includedir="/usr/local/include/gcc-valgrind-php" --program-prefix="gcc-valgrind-" \ | ||
--disable-cgi --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug --without-pcre-jit "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
--with-valgrind \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete && \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CC=clang CXX=clang++ CFLAGS="-fsanitize=memory -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=memory" ./configure \ | ||
--includedir="/usr/local/include/clang-msan-php" --program-prefix="clang-msan-" \ | ||
--disable-cgi --disable-all --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug --without-pcre-jit "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
--enable-memory-sanitizer \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete && \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CC=clang CXX=clang++ CFLAGS="-fsanitize=address -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=address" ./configure \ | ||
--includedir="/usr/local/include/clang-asan-php" --program-prefix="clang-asan-" \ | ||
--disable-cgi --disable-all --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug --without-pcre-jit "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
--enable-address-sanitizer \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete && \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CC=clang CXX=clang++ CFLAGS="-fsanitize=undefined -fno-sanitize-recover -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined" ./configure \ | ||
--includedir="/usr/local/include/clang-ubsan-php" --program-prefix="clang-ubsan-" \ | ||
--disable-cgi --disable-all --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug --without-pcre-jit "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
--enable-undefined-sanitizer \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete && \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CFLAGS="-fpic -fpie -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-pie" ./configure --disable-all \ | ||
--includedir="/usr/local/include/debug-php" --program-prefix="debug-" \ | ||
--disable-cgi --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete; \ | ||
fi; \ | ||
elif test -f "/etc/alpine-release"; then \ | ||
apk add --no-cache ${PHPIZE_DEPS} "bison" "valgrind" "valgrind-dev" "zlib-dev" "sqlite-dev" "git" && \ | ||
if test "${PSKEL_SKIP_DEBUG}" = ""; then \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CFLAGS="-fpic -fpie -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-pie" ./configure --disable-all \ | ||
--includedir="/usr/local/include/gcc-valgrind-php" --program-prefix="gcc-valgrind-" \ | ||
--disable-cgi --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug --without-pcre-jit "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
--with-valgrind \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete && \ | ||
docker-php-source extract && \ | ||
cd "/usr/src/php" && \ | ||
CFLAGS="-fpic -fpie -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-pie" ./configure --disable-all \ | ||
--includedir="/usr/local/include/debug-php" --program-prefix="debug-" \ | ||
--disable-cgi --disable-fpm --enable-cli \ | ||
--enable-mysqlnd --enable-pdo --with-pdo-mysql --with-pdo-sqlite \ | ||
--enable-debug "$(php -r "echo PHP_ZTS === 1 ? '--enable-zts' : '';")" \ | ||
${PSKEL_EXTRA_CONFIGURE_OPTIONS} \ | ||
--enable-option-checking=fatal && \ | ||
make -j$(nproc) && \ | ||
make install && \ | ||
cd - && \ | ||
docker-php-source delete; \ | ||
fi; \ | ||
fi && \ | ||
docker-php-source extract && \ | ||
ln -s "/usr/src/php/build/gen_stub.php" "/usr/local/bin/gen_stub.php" | ||
|
||
WORKDIR "/usr/src/php" | ||
|
||
COPY ./pskel_test.sh /usr/bin/pskel_test | ||
COPY ./pskel_init_extension.sh /usr/bin/pskel_init_extension | ||
RUN export CFLAGS="-fPIE -DZEND_TRACK_ARENA_ALLOC" \ | ||
&& export CPPFLAGS="${CFLAGS}" \ | ||
&& export BASE_OPTS="--enable-option-checking=fatal --enable-debug --disable-phpdbg --disable-cgi --disable-fpm --enable-cli --without-pcre-jit --disable-opcache-jit" \ | ||
&& if test "x${PSKEL_SKIP_BUILD}" = "x"; then \ | ||
if test -f "/etc/debian_version"; then \ | ||
apt-get update \ | ||
&& DEBIAN_FRONTEND="noninteractive" apt-get install -y "bison" "re2c" "zlib1g-dev" "libsqlite3-dev" "libxml2-dev" \ | ||
"autoconf" "pkg-config" "make" "gcc" "valgrind" "llvm" "clang" \ | ||
&& CC="$(which "clang")" CXX="$(which "clang++")" CONFIGURE_OPTS="${BASE_OPTS} --enable-memory-sanitizer" pskel build "clang-msan" \ | ||
&& CC="$(which "clang")" CXX="$(which "clang++")" CONFIGURE_OPTS="${BASE_OPTS} --enable-address-sanitizer" pskel build "clang-asan" \ | ||
&& CC="$(which "clang")" CXX="$(which "clang++")" CONFIGURE_OPTS="${BASE_OPTS} --enable-undefined-sanitizer" pskel build "clang-ubsan"; \ | ||
else \ | ||
apk add --no-cache "bison" "zlib-dev" "sqlite-dev" "libxml2-dev" \ | ||
"autoconf" "pkgconfig" "make" "gcc" "valgrind" "valgrind-dev" \ | ||
"musl-dev"; \ | ||
fi \ | ||
&& CC="$(which "gcc")" CXX="$(which "g+++")" CONFIGURE_OPTS="${BASE_OPTS}" pskel build "debug" \ | ||
&& CC="$(which "gcc")" CXX="$(which "g+++")" CONFIGURE_OPTS="${BASE_OPTS} --with-valgrind" pskel build "gcc-valgrind"; \ | ||
fi \ | ||
&& if test -f "/etc/debian_version"; then \ | ||
apt-get update && apt-get install -y "git"; \ | ||
else \ | ||
apk add --no-cache "git"; \ | ||
fi | ||
|
||
COPY ./ext /ext | ||
|
||
ENTRYPOINT [ "/usr/local/bin/pskel" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pskel_uninitialized | ||
pskel_uninitialized |
Oops, something went wrong.