Skip to content

Commit 45e7dea

Browse files
committed
Limit WASM matrix to ext-php-rs PHP support
1 parent 44db261 commit 45e7dea

3 files changed

Lines changed: 6 additions & 32 deletions

File tree

.github/workflows/wasm-spike.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
php: ['8.5', '8.4', '8.3', '8.2', '8.1', '8.0', '7.4']
29+
php: ['8.5', '8.4', '8.3', '8.2', '8.1', '8.0']
3030
async-mode: ['jspi']
3131

3232
steps:
@@ -55,7 +55,6 @@ jobs:
5555
/packages/php-wasm/fs-journal/
5656
/packages/php-wasm/logger/
5757
/packages/php-wasm/node/
58-
/packages/php-wasm/node-builds/7-4/
5958
/packages/php-wasm/node-builds/8-0/
6059
/packages/php-wasm/node-builds/8-1/
6160
/packages/php-wasm/node-builds/8-2/

packages/php-ext-wp-mysql-parser/wasm-spike/RESULT.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
## Current status
44

55
The spike now builds and loads `wp_mysql_parser` in Playground across every
6-
PHP version currently supported by Playground's `@php-wasm/compile-extension`
7-
helper: 7.4 and 8.0 through 8.5, all JSPI. CI verifies each generated side
8-
module by loading its manifest through Playground's compile-extension test
9-
harness and running a native lexer smoke test.
6+
PHP version supported by the current `ext-php-rs` binding layer: 8.0 through
7+
8.5, all JSPI. CI verifies each generated side module by loading its manifest
8+
through Playground's compile-extension test harness and running a native lexer
9+
smoke test. PHP 7.4 is outside this Rust path because `ext-php-rs` 0.15
10+
depends on PHP 8 Zend APIs and does not compile against PHP 7.4 headers.
1011

1112
The build uses the upstream Playground compile-extension tooling for the
1213
phpize side-module build, static archive force-linking, wasm-opt pass, and

packages/php-ext-wp-mysql-parser/wasm-spike/build-in-docker-rust.sh

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ if [ "$ASYNC_MODE" != "jspi" ]; then
3030
fi
3131

3232
case "$PHP_VERSION" in
33-
7.4) PHP_API_VERSION=20190902 ;;
3433
8.0) PHP_API_VERSION=20200930 ;;
3534
8.1) PHP_API_VERSION=20210902 ;;
3635
8.2) PHP_API_VERSION=20220829 ;;
@@ -142,31 +141,6 @@ docker run --rm -i \
142141
REG=$(find /root/cargo/registry/src -maxdepth 1 -type d -name "index.crates.io-*" | head -1)
143142
chmod -R u+w "$REG"
144143
145-
if [ "${PHP_VERSION:-}" = "7.4" ]; then
146-
# ext-php-rs 0.15's runtime APIs still cover the pieces this extension
147-
# uses, but its build-time version table starts at PHP 8.0. Add the
148-
# PHP 7.4 Zend API so bindgen can run against Playground's 7.4 headers.
149-
perl -0pi -e 's|pub enum ApiVersion \{\n|pub enum ApiVersion {\n /// PHP 7.4\n Php74 = 2019_09_02,\n|' \
150-
"$REG/ext-php-rs-build-0.1.1/src/lib.rs"
151-
sed -i 's/ApiVersion::Php80,/ApiVersion::Php74,/' \
152-
"$REG/ext-php-rs-0.15.12/build.rs"
153-
sed -i '/vec!\[/a \ ApiVersion::Php74,' \
154-
"$REG/ext-php-rs-build-0.1.1/src/lib.rs"
155-
perl -0pi -e 's/(pub fn cfg_name\(self\).*?match self \{\n)/$1 ApiVersion::Php74 => "php74",\n/s' \
156-
"$REG/ext-php-rs-build-0.1.1/src/lib.rs"
157-
perl -0pi -e 's/(pub fn define_name\(self\).*?match self \{\n)/$1 ApiVersion::Php74 => "EXT_PHP_RS_PHP_74",\n/s' \
158-
"$REG/ext-php-rs-build-0.1.1/src/lib.rs"
159-
sed -i '/match version {/a \ x if ((ApiVersion::Php74 as u32)..(ApiVersion::Php80 as u32)).contains(&x) => Ok(ApiVersion::Php74),' \
160-
"$REG/ext-php-rs-build-0.1.1/src/lib.rs"
161-
sed -i 's/cfg(php80, php81/cfg(php74, php80, php81/' \
162-
"$REG/ext-php-rs-build-0.1.1/src/lib.rs"
163-
sed -i '1i #include <stdbool.h>' \
164-
"$REG/ext-php-rs-0.15.12/src/wrapper.h"
165-
grep -q 'Php74 = 2019_09_02' "$REG/ext-php-rs-build-0.1.1/src/lib.rs"
166-
grep -q 'ApiVersion::Php74,' "$REG/ext-php-rs-0.15.12/build.rs"
167-
grep -q '#include <stdbool.h>' "$REG/ext-php-rs-0.15.12/src/wrapper.h"
168-
fi
169-
170144
sed -i "s/12 \* std::mem::size_of::<usize>/24 * std::mem::size_of::<usize>/" \
171145
"$REG/ext-php-rs-0.15.12/src/internal/property.rs"
172146

0 commit comments

Comments
 (0)