Skip to content
Open
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
5 changes: 1 addition & 4 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release to Dev

on:
push:
Expand Down Expand Up @@ -35,9 +35,6 @@ jobs:
build-and-test:
uses: "./.github/workflows/wasix-pr.yaml"
needs: version-check
secrets:
SENDMAIL_DEFAULT_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }}
SENDMAIL_DEFAULT_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }}

release:
runs-on: ubuntu-latest
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ jobs:
build-and-test:
uses: "./.github/workflows/wasix-pr.yaml"
needs: version-check
secrets:
SENDMAIL_DEFAULT_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }}
SENDMAIL_DEFAULT_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }}

release:
runs-on: ubuntu-latest
Expand Down
187 changes: 25 additions & 162 deletions .github/workflows/wasix-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ name: WASIX build and test

on:
workflow_call:
secrets:
SENDMAIL_DEFAULT_USERNAME:
required: true
SENDMAIL_DEFAULT_PASSWORD:
required: true
pull_request:
branches:
- "*-wasix"

permissions:
contents: read

jobs:
build-and-test-32:
name: Build and Test - 32-bit
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
variant: ["32", "64"]
steps:
- name: Check out
uses: actions/checkout@v3
Expand All @@ -32,189 +33,51 @@ jobs:
- name: OS Setup (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install -y build-essential wabt re2c
sudo apt-get install -y build-essential wabt re2c curl xz-utils tar
npm i -g pnpm concurrently

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20

wget https://github.com/WebAssembly/binaryen/releases/download/version_123/binaryen-version_123-x86_64-linux.tar.gz
tar -xzf binaryen-version_123-x86_64-linux.tar.gz
sudo cp binaryen-version_123/bin/* /usr/bin/

sudo rm -f /usr/bin/clang
sudo rm -f /usr/bin/clang++
sudo ln -s /usr/bin/clang-20 /usr/bin/clang
sudo ln -s /usr/bin/clang++-20 /usr/bin/clang++
sudo ln -s /usr/bin/llvm-ar-20 /usr/bin/llvm-ar
sudo ln -s /usr/bin/llvm-nm-20 /usr/bin/llvm-nm
sudo ln -s /usr/bin/llvm-ranlib-20 /usr/bin/llvm-ranlib
sudo ln -s /usr/bin/llvm-objdump-20 /usr/bin/llvm-objdump

- name: Tool Versions
run: |
echo clang
clang -v
echo '####################'
echo llvm-ar
llvm-ar -V
echo '####################'
echo llvm-nm
llvm-nm -V
echo '####################'
echo llvm-ranlib
llvm-ranlib -V
echo '####################'
echo wasm-opt
wasm-opt --version
echo '####################'
echo wasm-strip
wasm-strip --version

- name: Download wasix-libc
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: wasix-org/wasix-libc
file: sysroot-eh.tar.gz
target: sysroot/wasix-libc.tar.gz

- name: Unpack wasix-libc
run: |
cd sysroot
tar xzf wasix-libc.tar.gz
sudo mkdir -p /usr/lib/llvm-20/lib/clang/20/lib/wasm32-unknown-wasi
sudo cp wasix-sysroot-eh/lib/wasm32-wasi/libclang_rt.builtins-wasm32.a \
/usr/lib/llvm-20/lib/clang/20/lib/wasm32-unknown-wasi/libclang_rt.builtins.a

- name: Build
env:
SENDMAIL_DEFAULT_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }}
SENDMAIL_DEFAULT_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }}
run: |
export SYSROOT=$(pwd)/sysroot/wasix-sysroot-eh/sysroot
export PHP_WASIX_DEPS=$(pwd)/php-wasix-deps
cd php
bash wasix-configure-eh-32.sh || { cat config.log; exit -1; }

- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v3.1

- name: Run WASIX tests
env:
MAIL_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }}
MAIL_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }}
MAIL_HOST: smtp.mailgun.org
MAIL_PORT: 587
run: |
cd php
bash wasix-test-start-containers.sh
conc --kill-others --success "command-1" \
"bash wasix-test-server.sh" \
"bash wasix-test-run.sh"
bash wasix-test-stop-containers.sh
echo All tests are passing! 🎉

- name: Archive build
uses: actions/upload-artifact@v4
with:
name: php-wasix-32
path: php/sapi/cli/php.wasm

build-and-test-64:
name: Build and Test - 64-bit
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
- name: Install wasixcc
uses: wasix-org/wasixcc@main
with:
submodules: "recursive"
path: php

- name: Check out php-wasix-deps
uses: actions/checkout@v3
with:
repository: wasix-org/php-wasix-deps
submodules: "recursive"
path: php-wasix-deps

- name: OS Setup (Ubuntu)
run: |
sudo apt-get update
sudo apt-get install -y build-essential wabt re2c
npm i -g pnpm concurrently

wget https://github.com/WebAssembly/binaryen/releases/download/version_123/binaryen-version_123-x86_64-linux.tar.gz
tar -xzf binaryen-version_123-x86_64-linux.tar.gz
sudo cp binaryen-version_123/bin/* /usr/bin/

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 20

sudo rm -f /usr/bin/clang
sudo rm -f /usr/bin/clang++
sudo ln -s /usr/bin/clang-20 /usr/bin/clang
sudo ln -s /usr/bin/clang++-20 /usr/bin/clang++
sudo ln -s /usr/bin/llvm-ar-20 /usr/bin/llvm-ar
sudo ln -s /usr/bin/llvm-nm-20 /usr/bin/llvm-nm
sudo ln -s /usr/bin/llvm-ranlib-20 /usr/bin/llvm-ranlib
sudo ln -s /usr/bin/llvm-objdump-20 /usr/bin/llvm-objdump
github_token: ${{ secrets.GITHUB_TOKEN }}
sysroot-tag: v2026-02-16.1
version: v0.4.1

- name: Tool Versions
run: |
echo clang
clang -v
echo wasixcc
wasixcc -v
echo '####################'
echo llvm-ar
llvm-ar -V
echo wasixar
wasixar -V
echo '####################'
echo llvm-nm
llvm-nm -V
echo wasixnm
wasixnm -V
echo '####################'
echo llvm-ranlib
llvm-ranlib -V
echo wasixranlib
wasixranlib -V
echo '####################'
echo wasm-opt
wasm-opt --version
echo '####################'
echo wasm-strip
wasm-strip --version

- name: Download wasix-libc
uses: dsaltares/fetch-gh-release-asset@1.1.2
with:
repo: wasix-org/wasix-libc
file: sysroot-eh.tar.gz
target: sysroot/wasix-libc.tar.gz

- name: Unpack wasix-libc
run: |
cd sysroot
tar xzf wasix-libc.tar.gz
sudo mkdir -p /usr/lib/llvm-20/lib/clang/20/lib/wasm32-unknown-wasi
sudo cp wasix-sysroot-eh/lib/wasm32-wasi/libclang_rt.builtins-wasm32.a \
/usr/lib/llvm-20/lib/clang/20/lib/wasm32-unknown-wasi/libclang_rt.builtins.a

- name: Build
env:
SENDMAIL_DEFAULT_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }}
SENDMAIL_DEFAULT_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }}
run: |
export SYSROOT=$(pwd)/sysroot/wasix-sysroot-eh/sysroot
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SYSROOT environment variable is being exported but appears to be unused. The wasixcc toolchain (installed via the wasix-org/wasixcc action) manages its own sysroot internally, and the wasix-configure-eh.sh script no longer references this variable. Consider removing this line to avoid confusion.

Suggested change
export SYSROOT=$(pwd)/sysroot/wasix-sysroot-eh/sysroot

Copilot uses AI. Check for mistakes.
export PHP_WASIX_DEPS=$(pwd)/php-wasix-deps
cd php
bash wasix-configure-eh-64.sh || { cat config.log; exit -1; }
bash wasix-configure-eh-${{ matrix.variant }}.sh || { cat config.log; exit -1; }

- name: Setup Wasmer
uses: wasmerio/setup-wasmer@v3.1

- name: Run WASIX tests
env:
MAIL_USERNAME: ${{ secrets.SENDMAIL_DEFAULT_USERNAME }}
MAIL_PASSWORD: ${{ secrets.SENDMAIL_DEFAULT_PASSWORD }}
MAIL_HOST: smtp.mailgun.org
MAIL_PORT: 587
run: |
cd php
bash wasix-test-start-containers.sh
Expand All @@ -227,5 +90,5 @@ jobs:
- name: Archive build
uses: actions/upload-artifact@v4
with:
name: php-wasix-64
path: php/sapi/cli/php.wasm
name: php-wasix-${{ matrix.variant }}
path: php/sapi/cli/php.wasm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ config.h.in
/scripts/php-config
/scripts/phpize
php
php-debug.wasm
php.wasm

# ------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ AC_DEFUN([PHP_REQUIRE_CXX],[
if test -z "$php_cxx_done"; then
AC_PROG_CXX
AC_PROG_CXXCPP
PHP_ADD_LIBRARY(stdc++)
PHP_ADD_LIBRARY(c++)
php_cxx_done=yes
fi
])
Expand Down
9 changes: 9 additions & 0 deletions ext/opcache/ZendAccelerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -4692,6 +4692,7 @@ static int accel_finish_startup(void)
return FAILURE;
}

#ifndef __wasi__
pid = fork();
if (pid == -1) {
zend_shared_alloc_unlock();
Expand Down Expand Up @@ -4731,6 +4732,14 @@ static int accel_finish_startup(void)
return FAILURE;
}
}
#else
// Note: in WASIX, there is only one uid; it has "root" access to everything within the
// sandbox, but not the base OS, so it's OK to run everything with that user. That is to
// say, we shouldn't need to fork a new process here.
// It is also a fact that forking doesn't work under WASIX+EH anyway.
zend_accel_error(ACCEL_LOG_FATAL, "Preloading cannot fork to spawn a new process in WASIX");
exit(1);
#endif
} else {
if (ZCG(accel_directives).preload_user
&& *ZCG(accel_directives).preload_user) {
Expand Down
9 changes: 0 additions & 9 deletions ext/standard/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -455,15 +455,6 @@ else
AC_MSG_RESULT(no)
fi

dnl
dnl Include libwasix_sendmail when building to WASIX
dnl
if test "$ac_cv_have_decl___wasi__" == "yes"; then
if test -n "$WASIX_SENDMAIL_LIBS"; then
PHP_EVAL_LIBLINE($WASIX_SENDMAIL_LIBS)
fi
fi

dnl
dnl Whether to enable 64-bit long ints when building to WASIX;
dnl wasm32 uses 32-bit pointers but supports 64-bit int operations.
Expand Down
Loading