Skip to content

Commit 5b482b7

Browse files
arnaud-lbmvorisek
andauthored
Alpine/Musl nightly job (#13925)
Co-authored-by: Michael Voříšek <[email protected]>
1 parent 4f6f4fb commit 5b482b7

File tree

7 files changed

+258
-1
lines changed

7 files changed

+258
-1
lines changed

.github/actions/apk/action.yml

Lines changed: 61 additions & 0 deletions
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
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: ./configure
2+
inputs:
3+
configurationParameters:
4+
default: ''
5+
required: false
6+
skipSlow:
7+
default: false
8+
required: false
9+
runs:
10+
using: composite
11+
steps:
12+
- shell: bash
13+
run: |
14+
set -x
15+
./buildconf --force
16+
./configure \
17+
--enable-option-checking=fatal \
18+
--prefix=/usr \
19+
--enable-phpdbg \
20+
--enable-fpm \
21+
--with-pdo-mysql=mysqlnd \
22+
--with-mysqli=mysqlnd \
23+
${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \
24+
${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \
25+
${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \
26+
--enable-intl \
27+
--without-pear \
28+
--enable-gd \
29+
--with-jpeg \
30+
--with-webp \
31+
--with-freetype \
32+
--with-xpm \
33+
--enable-exif \
34+
--with-zip \
35+
--with-zlib \
36+
--enable-soap \
37+
--enable-xmlreader \
38+
--with-xsl \
39+
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
40+
--enable-sysvsem \
41+
--enable-sysvshm \
42+
--enable-shmop \
43+
--enable-pcntl \
44+
--with-readline \
45+
--enable-mbstring \
46+
--with-iconv=/usr \
47+
--with-curl \
48+
--with-gettext \
49+
--enable-sockets \
50+
--with-bz2 \
51+
--with-openssl \
52+
--with-gmp \
53+
--enable-bcmath \
54+
--enable-calendar \
55+
--enable-ftp \
56+
${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \
57+
--enable-sysvmsg \
58+
--with-ffi \
59+
--enable-zend-test \
60+
${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \
61+
${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \
62+
${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \
63+
--with-password-argon2 \
64+
--with-mhash \
65+
--with-sodium \
66+
--enable-dba \
67+
--with-cdb \
68+
--enable-flatfile \
69+
--enable-inifile \
70+
--with-lmdb \
71+
--with-gdbm \
72+
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
73+
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
74+
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
75+
--with-config-file-path=/etc \
76+
--with-config-file-scan-dir=/etc/php.d \
77+
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
78+
--enable-werror \
79+
${{ inputs.configurationParameters }}
Lines changed: 10 additions & 0 deletions
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
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Test
2+
inputs:
3+
runTestsParameters:
4+
default: ''
5+
required: false
6+
jitType:
7+
default: 'disable'
8+
required: false
9+
runs:
10+
using: composite
11+
steps:
12+
- shell: bash
13+
run: |
14+
set -x
15+
export SKIP_IO_CAPTURE_TESTS=1
16+
export STACK_LIMIT_DEFAULTS_CHECK=1
17+
sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \
18+
-d opcache.jit=${{ inputs.jitType }} \
19+
-d opcache.jit_buffer_size=64M \
20+
-j$(nproc) \
21+
-g FAIL,BORK,LEAK,XLEAK \
22+
--no-progress \
23+
--show-diff \
24+
--show-slow 1000 \
25+
--set-timeout 120

.github/nightly_matrix.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,26 @@ function get_macos_matrix_include(array $branches) {
121121
return $jobs;
122122
}
123123

124+
function get_alpine_matrix_include(array $branches) {
125+
$jobs = [];
126+
foreach ($branches as $branch) {
127+
if ([$branch['version']['major'], $branch['version']['minor']] < [8, 4]) {
128+
continue;
129+
}
130+
$jobs[] = [
131+
'name' => '_ASAN_UBSAN',
132+
'branch' => $branch,
133+
'debug' => true,
134+
'zts' => true,
135+
'asan' => true,
136+
'test_jit' => true,
137+
'configuration_parameters' => "CFLAGS='-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address -fno-sanitize=function' CC=clang-17 CXX=clang++-17",
138+
'run_tests_parameters' => '--asan -x',
139+
];
140+
}
141+
return $jobs;
142+
}
143+
124144
function get_current_version(): array {
125145
$file = dirname(__DIR__) . '/main/php_version.h';
126146
$content = file_get_contents($file);
@@ -145,10 +165,12 @@ function get_current_version(): array {
145165
$matrix_include = get_matrix_include($branches);
146166
$windows_matrix_include = get_windows_matrix_include($branches);
147167
$macos_matrix_include = get_macos_matrix_include($branches);
168+
$alpine_matrix_include = get_alpine_matrix_include($branches);
148169

149170
$f = fopen(getenv('GITHUB_OUTPUT'), 'a');
150171
fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n");
151172
fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
152173
fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
153174
fwrite($f, 'macos-matrix-include=' . json_encode($macos_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
175+
fwrite($f, 'alpine-matrix-include=' . json_encode($alpine_matrix_include, JSON_UNESCAPED_SLASHES) . "\n");
154176
fclose($f);

.github/workflows/nightly.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
matrix-include: ${{ steps.set-matrix.outputs.matrix-include }}
1616
windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }}
1717
macos-matrix-include: ${{ steps.set-matrix.outputs.macos-matrix-include }}
18+
alpine-matrix-include: ${{ steps.set-matrix.outputs.alpine-matrix-include }}
1819
steps:
1920
- uses: actions/checkout@v4
2021
with:
@@ -39,6 +40,65 @@ jobs:
3940
uses: ./.github/actions/notify-slack
4041
with:
4142
token: ${{ secrets.ACTION_MONITORING_SLACK }}
43+
ALPINE:
44+
needs: GENERATE_MATRIX
45+
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.alpine-matrix-include) }}
50+
name: "${{ matrix.branch.name }}_ALPINE_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
51+
runs-on: ubuntu-22.04
52+
container:
53+
image: 'alpine:3.20.1'
54+
steps:
55+
- name: git checkout
56+
uses: actions/checkout@v4
57+
with:
58+
ref: ${{ matrix.branch.ref }}
59+
- name: apk
60+
uses: ./.github/actions/apk
61+
- name: LLVM 17 (ASAN-only)
62+
if: ${{ matrix.asan }}
63+
# libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17:
64+
# https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20
65+
run: |
66+
apk add clang17 compiler-rt
67+
- name: System info
68+
run: |
69+
echo "::group::Show host CPU info"
70+
lscpu
71+
echo "::endgroup::"
72+
echo "::group::Show installed package versions"
73+
apk list
74+
echo "::endgroup::"
75+
- name: ./configure
76+
uses: ./.github/actions/configure-alpine
77+
with:
78+
configurationParameters: >-
79+
${{ matrix.configuration_parameters }}
80+
--${{ matrix.debug && 'enable' || 'disable' }}-debug
81+
--${{ matrix.zts && 'enable' || 'disable' }}-zts
82+
skipSlow: ${{ matrix.asan }}
83+
- name: make
84+
run: make -j$(/usr/bin/nproc) >/dev/null
85+
- name: make install
86+
uses: ./.github/actions/install-alpine
87+
- name: Test Tracing JIT
88+
if: matrix.test_jit
89+
uses: ./.github/actions/test-alpine
90+
with:
91+
jitType: tracing
92+
runTestsParameters: >-
93+
${{ matrix.run_tests_parameters }}
94+
-d zend_extension=opcache.so
95+
-d opcache.enable_cli=1
96+
- name: Notify Slack
97+
if: failure()
98+
uses: ./.github/actions/notify-slack
99+
with:
100+
token: ${{ secrets.ACTION_MONITORING_SLACK }}
101+
42102
LINUX_X64:
43103
needs: GENERATE_MATRIX
44104
if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }}

Zend/zend.c

Lines changed: 1 addition & 1 deletion
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)