Skip to content

Commit 2de98ab

Browse files
arnaud-lbmvorisek
andcommitted
Alpine/Musl CI
Co-authored-by: Michael Voříšek <[email protected]>
1 parent b537f01 commit 2de98ab

File tree

6 files changed

+239
-1
lines changed

6 files changed

+239
-1
lines changed

.github/actions/apk/action.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: apk
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: sh
6+
run: |
7+
set -x
8+
9+
apk update -q
10+
apk add \
11+
util-linux \
12+
bash \
13+
sudo \
14+
build-base \
15+
autoconf \
16+
unzip \
17+
tar \
18+
bison \
19+
re2c \
20+
pkgconf \
21+
mysql-client \
22+
aspell-dev \
23+
hunspell-dev \
24+
hunspell-en \
25+
bzip2-dev \
26+
curl-dev \
27+
freetype-dev \
28+
gettext-dev \
29+
gnu-libiconv-dev \
30+
gmp-dev \
31+
icu-dev \
32+
icu-data-full \
33+
jpeg-dev \
34+
libffi-dev \
35+
libpng-dev \
36+
libsodium-dev \
37+
libwebp-dev \
38+
libxml2-dev \
39+
libxpm-dev \
40+
libxslt-dev \
41+
libzip-dev \
42+
oniguruma-dev \
43+
openssl-dev \
44+
readline-dev \
45+
sqlite-dev \
46+
tidyhtml-dev \
47+
krb5-dev \
48+
gdbm-dev \
49+
lmdb-dev \
50+
argon2-dev \
51+
enchant2-dev \
52+
enchant2-hunspell \
53+
freetds-dev \
54+
imap-dev \
55+
net-snmp-dev \
56+
openldap-dev \
57+
unixodbc-dev \
58+
postgresql14-dev \
59+
tzdata \
60+
musl-locales \
61+
musl-locales-lang
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
name: ./configure
2+
inputs:
3+
configurationParameters:
4+
default: ''
5+
required: false
6+
runs:
7+
using: composite
8+
steps:
9+
- shell: bash
10+
run: |
11+
set -x
12+
./buildconf --force
13+
./configure \
14+
--enable-option-checking=fatal \
15+
--prefix=/usr \
16+
--enable-phpdbg \
17+
--enable-fpm \
18+
--with-pdo-mysql=mysqlnd \
19+
--with-mysqli=mysqlnd \
20+
${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \
21+
${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \
22+
${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \
23+
--enable-intl \
24+
--without-pear \
25+
--enable-gd \
26+
--with-jpeg \
27+
--with-webp \
28+
--with-freetype \
29+
--with-xpm \
30+
--enable-exif \
31+
--with-zip \
32+
--with-zlib \
33+
--enable-soap \
34+
--enable-xmlreader \
35+
--with-xsl \
36+
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
37+
--enable-sysvsem \
38+
--enable-sysvshm \
39+
--enable-shmop \
40+
--enable-pcntl \
41+
--with-readline \
42+
--enable-mbstring \
43+
--with-iconv=/usr \
44+
--with-curl \
45+
--with-gettext \
46+
--enable-sockets \
47+
--with-bz2 \
48+
--with-openssl \
49+
--with-gmp \
50+
--enable-bcmath \
51+
--enable-calendar \
52+
--enable-ftp \
53+
${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \
54+
--enable-sysvmsg \
55+
--with-ffi \
56+
--enable-zend-test \
57+
${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \
58+
${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \
59+
${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \
60+
--with-password-argon2 \
61+
--with-mhash \
62+
--with-sodium \
63+
--enable-dba \
64+
--with-cdb \
65+
--enable-flatfile \
66+
--enable-inifile \
67+
--with-lmdb \
68+
--with-gdbm \
69+
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
70+
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
71+
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
72+
--with-config-file-path=/etc \
73+
--with-config-file-scan-dir=/etc/php.d \
74+
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
75+
--enable-werror \
76+
${{ inputs.configurationParameters }}
+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: Install
2+
runs:
3+
using: composite
4+
steps:
5+
- shell: bash
6+
run: |
7+
set -x
8+
sudo make install
9+
sudo mkdir -p /etc/php.d
10+
sudo chmod 777 /etc/php.d
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Test
2+
inputs:
3+
testArtifacts:
4+
default: null
5+
required: false
6+
runTestsParameters:
7+
default: ''
8+
required: false
9+
jitType:
10+
default: 'disable'
11+
required: false
12+
runs:
13+
using: composite
14+
steps:
15+
- shell: bash
16+
run: |
17+
set -x
18+
export SKIP_IO_CAPTURE_TESTS=1
19+
export STACK_LIMIT_DEFAULTS_CHECK=1
20+
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
21+
-d opcache.jit=${{ inputs.jitType }} \
22+
-d opcache.jit_buffer_size=64M \
23+
-j$(($(nproc) - 1)) \
24+
-g FAIL,BORK,LEAK,XLEAK \
25+
--no-progress \
26+
--show-diff \
27+
--show-slow 1000 \
28+
--set-timeout 120

.github/workflows/push.yml

+63
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,69 @@ jobs:
191191
runTestsParameters: >-
192192
-d zend_extension=opcache.so
193193
-d opcache.enable_cli=1
194+
ALPINE:
195+
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
196+
strategy:
197+
fail-fast: false
198+
matrix:
199+
include:
200+
- debug: true
201+
zts: true
202+
asan: true
203+
name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
204+
runs-on: ubuntu-22.04
205+
container:
206+
image: 'alpine:3.20.1'
207+
steps:
208+
- name: git checkout
209+
uses: actions/checkout@v4
210+
- name: apk
211+
uses: ./.github/actions/apk
212+
- name: LLVM 17 (ASAN-only)
213+
if: ${{ matrix.asan }}
214+
# libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17:
215+
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20
216+
run: |
217+
apk add clang17 compiler-rt
218+
- name: System info
219+
run: |
220+
echo "::group::Show host CPU info"
221+
lscpu
222+
echo "::endgroup::"
223+
echo "::group::Show installed package versions"
224+
apk list
225+
echo "::endgroup::"
226+
- name: ccache
227+
uses: hendrikmuhs/[email protected]
228+
with:
229+
# This duplicates the "job.name" expression above because
230+
# GitHub has no way to query the job name (github.job is the
231+
# job id, not the job name)
232+
key: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}"
233+
append-timestamp: false
234+
save: ${{ github.event_name != 'pull_request' }}
235+
- name: ./configure
236+
uses: ./.github/actions/configure-alpine
237+
with:
238+
# -Wno-error=stringop-overread: main/getopt.c: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622
239+
configurationParameters: >-
240+
--${{ matrix.debug && 'enable' || 'disable' }}-debug
241+
--${{ matrix.zts && 'enable' || 'disable' }}-zts
242+
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang-17 CXX=clang++-17' || 'CFLAGS="-Wno-error=stringop-overread"' }}
243+
skipSlow: ${{ matrix.asan }}
244+
- name: make
245+
run: make -j$(/usr/bin/nproc) >/dev/null
246+
- name: make install
247+
uses: ./.github/actions/install-alpine
248+
- name: Test Tracing JIT
249+
uses: ./.github/actions/test-alpine
250+
with:
251+
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_Tracing JIT
252+
jitType: tracing
253+
runTestsParameters: >-
254+
-d zend_extension=opcache.so
255+
-d opcache.enable_cli=1
256+
${{ matrix.asan && '--asan -x' || '' }}
194257
MACOS_DEBUG_NTS:
195258
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'
196259
strategy:

Zend/zend.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1410,7 +1410,7 @@ ZEND_API ZEND_COLD void zend_error_zstr_at(
14101410
zval retval;
14111411
zval orig_user_error_handler;
14121412
bool in_compilation;
1413-
zend_class_entry *saved_class_entry;
1413+
zend_class_entry *saved_class_entry = NULL;
14141414
zend_stack loop_var_stack;
14151415
zend_stack delayed_oplines_stack;
14161416
int type = orig_type & E_ALL;

0 commit comments

Comments
 (0)