-
Notifications
You must be signed in to change notification settings - Fork 6
211 lines (193 loc) · 6.54 KB
/
debug-exec.yml
File metadata and controls
211 lines (193 loc) · 6.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
name: Debug exec() pipe corruption
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout php-async repo
uses: actions/checkout@v4
with:
path: async
- name: Clone php-src (true-async-stable)
run: |
git clone --depth=1 --branch=true-async-stable https://github.com/true-async/php-src php-src
- name: Get php-src commit hash
id: php-src-hash
run: |
echo "hash=$(git -C php-src rev-parse HEAD)" >> "$GITHUB_OUTPUT"
- name: Copy php-async extension into php-src
run: |
mkdir -p php-src/ext/async
cp -r async/* php-src/ext/async/
- name: Cache APT packages
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-packages-debug-exec-v2
restore-keys: |
${{ runner.os }}-apt-packages-
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gcc g++ autoconf bison re2c \
libgmp-dev libicu-dev libtidy-dev libsasl2-dev \
libzip-dev libbz2-dev libsqlite3-dev libonig-dev libcurl4-openssl-dev \
libxml2-dev libxslt1-dev libpq-dev libreadline-dev libldap2-dev libsodium-dev \
libargon2-dev firebird-dev valgrind cmake
- name: Cache LibUV 1.45.0
id: cache-libuv
uses: actions/cache@v4
with:
path: |
/usr/local/lib/libuv*
/usr/local/include/uv*
/usr/local/lib/pkgconfig/libuv.pc
key: ${{ runner.os }}-libuv-1.45.0-release
- name: Install LibUV >= 1.45.0
run: |
if [ "${{ steps.cache-libuv.outputs.cache-hit }}" == "true" ]; then
sudo ldconfig
else
wget https://github.com/libuv/libuv/archive/v1.45.0.tar.gz
tar -xzf v1.45.0.tar.gz
cd libuv-1.45.0 && mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
sudo ldconfig
fi
- name: Cache compiled php-src
id: cache-php
uses: actions/cache@v4
with:
path: |
php-src/Makefile
php-src/main
php-src/Zend
php-src/sapi
php-src/ext
php-src/TSRM
php-src/config.h
php-src/config.nice
php-src/config.status
php-src/configure
php-src/buildconf
php-src/libs
php-src/libtool
php-src/build
php-src/scripts
php-src/include
php-src/run-tests.php
key: ${{ runner.os }}-php-build-asan-stable-${{ steps.php-src-hash.outputs.hash }}
- name: Configure PHP (cache miss)
if: steps.cache-php.outputs.cache-hit != 'true'
working-directory: php-src
run: |
./buildconf -f
./configure \
--enable-zts \
--enable-fpm \
--with-pdo-mysql=mysqlnd \
--with-mysqli=mysqlnd \
--with-pgsql \
--with-pdo-pgsql \
--with-pdo-sqlite \
--enable-intl \
--without-pear \
--with-zip \
--with-zlib \
--enable-soap \
--enable-xmlreader \
--with-xsl \
--with-tidy \
--enable-sysvsem \
--enable-sysvshm \
--enable-shmop \
--enable-pcntl \
--with-readline \
--enable-mbstring \
--with-curl \
--with-gettext \
--enable-sockets \
--with-bz2 \
--with-openssl \
--with-gmp \
--enable-bcmath \
--enable-calendar \
--enable-ftp \
--enable-sysvmsg \
--with-ffi \
--enable-zend-test \
--enable-dl-test=shared \
--with-ldap \
--with-ldap-sasl \
--with-password-argon2 \
--with-mhash \
--with-sodium \
--enable-dba \
--with-cdb \
--enable-flatfile \
--enable-inifile \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--with-pdo-firebird \
--enable-address-sanitizer \
--enable-async
- name: Full build (cache miss)
if: steps.cache-php.outputs.cache-hit != 'true'
working-directory: php-src
run: |
make -j"$(nproc)"
- name: Rebuild async extension (cache hit)
if: steps.cache-php.outputs.cache-hit == 'true'
working-directory: php-src
run: |
find ext/async -name '*.lo' -o -name '*.o' -o -name '*.dep' | xargs rm -f 2>/dev/null || true
make -j"$(nproc)"
- name: Install PHP
working-directory: php-src
run: |
sudo make install
sudo mkdir -p /etc/php.d
sudo chmod 777 /etc/php.d
{
echo "opcache.enable_cli=1"
echo "opcache.protect_memory=1"
} > /etc/php.d/opcache.ini
- name: Run failing phpt tests (matching build.yml flags)
working-directory: php-src/ext/async
run: |
/usr/local/bin/php -v
/usr/local/bin/php ../../run-tests.php \
-d opcache.enable_cli=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit=tracing \
-d zend_test.observer.enabled=1 \
-d zend_test.observer.show_output=0 \
-P -q -x -j4 \
--no-progress \
--offline \
--show-diff \
--set-timeout 120 \
--repeat 2 \
tests/exec/017-exec_unicode_binary.phpt \
tests/exec/018-exec_long_lines.phpt \
tests/exec/022-exec_chdir_cwd.phpt 2>&1
- name: Run debug script (no repeat, single process)
working-directory: php-src/ext/async
run: |
echo "=== Plain run ==="
/usr/local/bin/php tests/debug_exec.php 2>&1
- name: Run debug script (opcache + jit + observer)
working-directory: php-src/ext/async
run: |
echo "=== With opcache + jit + observer ==="
/usr/local/bin/php \
-d opcache.enable_cli=1 \
-d opcache.jit_buffer_size=64M \
-d opcache.jit=tracing \
-d zend_test.observer.enabled=1 \
-d zend_test.observer.show_output=0 \
tests/debug_exec.php 2>&1