From 1e20332ce9b36975964d990d22788db0558dc891 Mon Sep 17 00:00:00 2001 From: asrar Date: Mon, 23 Nov 2026 23:14:56 +0100 Subject: [PATCH 1/2] feat(static): include FFI in glibc builds --- .github/workflows/static.yaml | 2 ++ build-static.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index 293640fbce..e324674340 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -400,6 +400,8 @@ jobs: "${BINARY}" list-modules | grep http.handlers.mercure "${BINARY}" list-modules | grep http.handlers.vulcain "${BINARY}" php-cli -r "echo 'Sanity check passed';" + "${BINARY}" php-cli -i | grep 'Zend Signal Handling => disabled' + "${BINARY}" php-cli -d ffi.enable=1 -r 'exit(FFI::cdef("int abs(int);", "libc.so.6")->abs(-42) === 42 ? 0 : 1);' env: BINARY: ./gh-output/frankenphp-linux-${{ matrix.platform == 'linux/amd64' && 'x86_64' || 'aarch64' }}-gnu diff --git a/build-static.sh b/build-static.sh index 5aa4a04c8c..fd954877af 100755 --- a/build-static.sh +++ b/build-static.sh @@ -13,7 +13,7 @@ set -o pipefail # # Supported variables: # - PHP_VERSION: PHP version to build (default: the one pinned in craft.yml) -# - PHP_EXTENSIONS: comma-separated extensions (default: the list in craft.yml) +# - PHP_EXTENSIONS: comma-separated extensions (default: the list in craft.yml, plus ffi on glibc Linux builds) # - PHP_EXTENSION_LIBS: comma-separated extra libraries (default: the list in craft.yml) # - XCADDY_ARGS: extra Caddy modules to pass to xcaddy (default: the list in craft.yml) # - FRANKENPHP_VERSION: FrankenPHP version (default: current Git commit) @@ -168,7 +168,13 @@ while IFS= read -r line || [ -n "${line}" ]; do [ -n "${PHP_VERSION}" ] && line="php-version: \"${PHP_VERSION}\"" ;; "extensions:"*) - [ -n "${PHP_EXTENSIONS}" ] && line="extensions: \"${PHP_EXTENSIONS}\"" + if [ -n "${PHP_EXTENSIONS}" ]; then + line="extensions: \"${PHP_EXTENSIONS}\"" + elif [[ "${bin_os}" == linux && "${line}" != *[\",]ffi[\",]* ]]; then + case "${SPC_TARGET:-${LIBC}}" in + gnu | *-linux-gnu*) line="${line%\"},ffi\"" ;; + esac + fi ;; "packages:"*) packages="${PHP_EXTENSION_LIBS}" From 3db3c9699c0e50cc21d56a6b61fb77e109191f36 Mon Sep 17 00:00:00 2001 From: asrar Date: Wed, 25 Nov 2026 17:12:21 +0100 Subject: [PATCH 2/2] ci: drop Zend signals output check --- .github/workflows/static.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/static.yaml b/.github/workflows/static.yaml index e324674340..e7d87eec96 100644 --- a/.github/workflows/static.yaml +++ b/.github/workflows/static.yaml @@ -400,7 +400,6 @@ jobs: "${BINARY}" list-modules | grep http.handlers.mercure "${BINARY}" list-modules | grep http.handlers.vulcain "${BINARY}" php-cli -r "echo 'Sanity check passed';" - "${BINARY}" php-cli -i | grep 'Zend Signal Handling => disabled' "${BINARY}" php-cli -d ffi.enable=1 -r 'exit(FFI::cdef("int abs(int);", "libc.so.6")->abs(-42) === 42 ? 0 : 1);' env: BINARY: ./gh-output/frankenphp-linux-${{ matrix.platform == 'linux/amd64' && 'x86_64' || 'aarch64' }}-gnu