Skip to content

Commit fc9266a

Browse files
committed
Move ASAN built to GitHub actions
Cirrus will no longer offer unlimited free builds starting next month. We don't have an alternative for FreeBSD and ARM, so move what we can for now. Closes GH-11898
1 parent db4dba6 commit fc9266a

21 files changed

+91
-206
lines changed

.cirrus.yml

-180
Original file line numberDiff line numberDiff line change
@@ -1,186 +1,6 @@
11
env:
22
CIRRUS_CLONE_DEPTH: 1
33

4-
asan_task:
5-
name: ASAN_DEBUG_NTS
6-
container:
7-
image: gcc:latest
8-
additional_containers:
9-
- name: mysql
10-
image: mysql:8
11-
port: 3306
12-
cpu: 1.0
13-
memory: 1G
14-
env:
15-
MYSQL_ROOT_PASSWORD: "root"
16-
MYSQL_DATABASE: "test"
17-
install_script:
18-
- apt-get update -y
19-
- >-
20-
apt-get install -y
21-
bison
22-
re2c
23-
locales
24-
locales-all
25-
`#ldap-utils`
26-
openssl
27-
`slapd`
28-
libgmp-dev
29-
libicu-dev
30-
`#libtidy-dev`
31-
`#libenchant-dev`
32-
libaspell-dev
33-
libpspell-dev
34-
libsasl2-dev
35-
libxpm-dev
36-
libzip-dev
37-
`#libsqlite3-dev`
38-
libwebp-dev
39-
libonig-dev
40-
libkrb5-dev
41-
libgssapi-krb5-2
42-
libcurl4-openssl-dev
43-
libxml2-dev
44-
libxslt1-dev
45-
libpq-dev
46-
libreadline-dev
47-
`#libldap2-dev`
48-
libsodium-dev
49-
libargon2-0-dev
50-
libmm-dev
51-
`#libsnmp-dev`
52-
`#postgresql`
53-
`#postgresql-contrib`
54-
`#snmpd`
55-
`#snmp-mibs-downloader`
56-
`#freetds-dev`
57-
`#unixodbc-dev`
58-
llvm
59-
clang
60-
libc-client-dev
61-
dovecot-core
62-
dovecot-pop3d
63-
dovecot-imapd
64-
`#sendmail`
65-
`#firebird-dev`
66-
liblmdb-dev
67-
libtokyocabinet-dev
68-
libdb-dev
69-
libqdbm-dev
70-
libjpeg-dev
71-
libpng-dev
72-
libfreetype6-dev
73-
build_script:
74-
- ./buildconf -f
75-
- >-
76-
./configure
77-
--enable-debug
78-
--enable-zts
79-
--enable-option-checking=fatal
80-
--prefix=/usr
81-
--enable-phpdbg
82-
--enable-fpm
83-
--enable-opcache
84-
--disable-opcache-jit
85-
--with-pdo-mysql=mysqlnd
86-
--with-mysqli=mysqlnd
87-
`#--with-pgsql`
88-
`#--with-pdo-pgsql`
89-
`#--with-pdo-sqlite`
90-
--enable-intl
91-
--without-pear
92-
--enable-gd
93-
--with-jpeg
94-
--with-webp
95-
--with-freetype
96-
--with-xpm
97-
--enable-exif
98-
--with-zip
99-
--with-zlib
100-
--with-zlib-dir=/usr
101-
--enable-soap
102-
--enable-xmlreader
103-
--with-xsl
104-
`#--with-tidy`
105-
--enable-sysvsem
106-
--enable-sysvshm
107-
--enable-shmop
108-
--enable-pcntl
109-
--with-readline
110-
--enable-mbstring
111-
--with-curl
112-
--with-gettext
113-
--enable-sockets
114-
--with-bz2
115-
--with-openssl
116-
--with-gmp
117-
--enable-bcmath
118-
--enable-calendar
119-
--enable-ftp
120-
--with-pspell=/usr
121-
`#--with-enchant=/usr`
122-
--with-kerberos
123-
--enable-sysvmsg
124-
--with-ffi
125-
--enable-zend-test
126-
`#--enable-dl-test=shared`
127-
`#--with-ldap`
128-
`#--with-ldap-sasl`
129-
--with-password-argon2
130-
--with-mhash
131-
--with-sodium
132-
--enable-dba
133-
--with-cdb
134-
--enable-flatfile
135-
--enable-inifile
136-
--with-tcadb
137-
--with-lmdb
138-
--with-qdbm
139-
`#--with-snmp`
140-
`#--with-unixODBC`
141-
`#--with-imap`
142-
--with-kerberos
143-
--with-imap-ssl
144-
`#--with-pdo-odbc=unixODBC,/usr`
145-
`#--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient`
146-
`#--with-oci8=shared,instantclient,/opt/oracle/instantclient`
147-
--with-config-file-path=/etc
148-
--with-config-file-scan-dir=/etc/php.d
149-
`#--with-pdo-firebird`
150-
`#--with-pdo-dblib`
151-
--enable-werror
152-
CFLAGS='-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC' LDFLAGS='-fsanitize=undefined,address'
153-
CC=clang
154-
CXX=clang++
155-
- make -j2
156-
- make install
157-
- mkdir -p /etc/php.d
158-
- echo opcache.enable_cli=1 > /etc/php.d/opcache.ini
159-
- echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini
160-
# Specify opcache.preload_user as we're running as root.
161-
- echo opcache.preload_user=root >> /etc/php.d/opcache.ini
162-
tests_script:
163-
- export SKIP_IO_CAPTURE_TESTS=1
164-
- export CI_NO_IPV6=1
165-
- export MYSQL_TEST_HOST=127.0.0.1
166-
- export MYSQL_TEST_USER=root
167-
- export MYSQL_TEST_PASSWD=root
168-
- export PDO_MYSQL_TEST_DSN="mysql:host=127.0.0.1;dbname=test"
169-
- export PDO_MYSQL_TEST_USER=root
170-
- export PDO_MYSQL_TEST_PASS=root
171-
- >-
172-
sapi/cli/php run-tests.php
173-
-P -q -x -j2
174-
-g FAIL,BORK,LEAK,XLEAK
175-
--no-progress
176-
--offline
177-
--show-diff
178-
--show-slow 1000
179-
--set-timeout 120
180-
-d zend_extension=opcache.so
181-
-d opcache.enable_cli=1
182-
--asan
183-
1844
freebsd_task:
1855
name: FREEBSD_DEBUG_NTS
1866
freebsd_instance:

.github/actions/apt-x64/action.yml

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ runs:
4646
freetds-dev \
4747
unixodbc-dev \
4848
llvm \
49+
clang \
4950
libc-client-dev \
5051
dovecot-core \
5152
dovecot-pop3d \

.github/actions/configure-x64/action.yml

+20-17
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ inputs:
33
configurationParameters:
44
default: ''
55
required: false
6+
skipSlow:
7+
default: false
8+
required: false
69
runs:
710
using: composite
811
steps:
@@ -17,9 +20,9 @@ runs:
1720
--enable-fpm \
1821
--with-pdo-mysql=mysqlnd \
1922
--with-mysqli=mysqlnd \
20-
--with-pgsql \
21-
--with-pdo-pgsql \
22-
--with-pdo-sqlite \
23+
${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \
24+
${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \
25+
${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \
2326
--enable-intl \
2427
--without-pear \
2528
--enable-gd \
@@ -34,7 +37,7 @@ runs:
3437
--enable-soap \
3538
--enable-xmlreader \
3639
--with-xsl \
37-
--with-tidy \
40+
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
3841
--enable-sysvsem \
3942
--enable-sysvshm \
4043
--enable-shmop \
@@ -51,14 +54,14 @@ runs:
5154
--enable-calendar \
5255
--enable-ftp \
5356
--with-pspell=/usr \
54-
--with-enchant=/usr \
57+
${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \
5558
--with-kerberos \
5659
--enable-sysvmsg \
5760
--with-ffi \
5861
--enable-zend-test \
59-
--enable-dl-test=shared \
60-
--with-ldap \
61-
--with-ldap-sasl \
62+
${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \
63+
${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \
64+
${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \
6265
--with-password-argon2 \
6366
--with-mhash \
6467
--with-sodium \
@@ -69,16 +72,16 @@ runs:
6972
--with-tcadb \
7073
--with-lmdb \
7174
--with-qdbm \
72-
--with-snmp \
73-
--with-unixODBC \
74-
--with-imap \
75-
--with-imap-ssl \
76-
--with-pdo-odbc=unixODBC,/usr \
77-
--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient \
78-
--with-oci8=shared,instantclient,/opt/oracle/instantclient \
75+
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
76+
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
77+
${{ inputs.skipSlow == 'false' && '--with-imap' || '' }} \
78+
${{ inputs.skipSlow == 'false' && '--with-imap-ssl' || '' }} \
79+
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
80+
${{ inputs.skipSlow == 'false' && '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient' || '' }} \
81+
${{ inputs.skipSlow == 'false' && '--with-oci8=shared,instantclient,/opt/oracle/instantclient' || '' }} \
7982
--with-config-file-path=/etc \
8083
--with-config-file-scan-dir=/etc/php.d \
81-
--with-pdo-firebird \
82-
--with-pdo-dblib \
84+
${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \
85+
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
8386
--enable-werror \
8487
${{ inputs.configurationParameters }}

.github/actions/install-linux/action.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
name: Install
2+
inputs:
3+
withOci:
4+
default: true
5+
required: false
26
runs:
37
using: composite
48
steps:
@@ -10,5 +14,5 @@ runs:
1014
sudo chmod 777 /etc/php.d
1115
echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini
1216
echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini
13-
echo extension=oci8.so > /etc/php.d/oci8.ini
14-
echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini
17+
${{ inputs.withOci == 'true' && 'echo extension=oci8.so > /etc/php.d/oci8.ini' || '' }}
18+
${{ inputs.withOci == 'true' && 'echo extension=pdo_oci.so > /etc/php.d/pdo_oci.ini' || '' }}

.github/workflows/push.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,13 @@ jobs:
4747
fail-fast: false
4848
matrix:
4949
include:
50-
- debug: true
51-
zts: false
5250
- debug: false
51+
zts: false
52+
asan: false
53+
- debug: true
5354
zts: true
54-
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
55+
asan: true
56+
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
5557
runs-on: ubuntu-22.04
5658
steps:
5759
- name: git checkout
@@ -70,32 +72,38 @@ jobs:
7072
# This duplicates the "job.name" expression above because
7173
# GitHub has no way to query the job name (github.job is the
7274
# job id, not the job name)
73-
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}"
75+
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}"
7476
append-timestamp: false
7577
- name: ./configure
7678
uses: ./.github/actions/configure-x64
7779
with:
7880
configurationParameters: >-
7981
--${{ matrix.debug && 'enable' || 'disable' }}-debug
8082
--${{ matrix.zts && 'enable' || 'disable' }}-zts
83+
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address" CC=clang CXX=clang++ --disable-opcache-jit' || '' }}
84+
skipSlow: ${{ matrix.asan }}
8185
- name: make
8286
run: make -j$(/usr/bin/nproc) >/dev/null
8387
- name: make install
8488
uses: ./.github/actions/install-linux
89+
with:
90+
withOci: ${{ !matrix.asan }}
8591
- name: Setup
8692
uses: ./.github/actions/setup-x64
8793
- name: Test
94+
if: matrix.asan == false
8895
uses: ./.github/actions/test-linux
8996
with:
9097
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}
91-
- name: Test Tracing JIT
98+
- name: Test ${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
9299
uses: ./.github/actions/test-linux
93100
with:
94-
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT
101+
testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
95102
runTestsParameters: >-
96103
-d zend_extension=opcache.so
97104
-d opcache.enable_cli=1
98-
-d opcache.jit_buffer_size=16M
105+
${{ !matrix.asan && '-d opcache.jit_buffer_size=16M' || '' }}
106+
${{ matrix.asan && '--asan -x' || '' }}
99107
- name: Verify generated files are up to date
100108
uses: ./.github/actions/verify-generated-files
101109
LINUX_X32:

Zend/tests/bug78010.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
--TEST--
22
Bug #78010: Segmentation fault during GC
3+
--SKIPIF--
4+
<?php
5+
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
6+
?>
37
--INI--
48
memory_limit=2G
59
--FILE--

ext/mysqli/tests/mysqli_fetch_all.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mysqli_fetch_all()
44
mysqli
55
--SKIPIF--
66
<?php
7+
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
78
require_once 'skipifconnectfailure.inc';
89
?>
910
--FILE--

ext/mysqli/tests/mysqli_fetch_array_many_rows.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mysqli_fetch_array()
44
mysqli
55
--SKIPIF--
66
<?php
7+
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
78
require_once 'skipifconnectfailure.inc';
89
?>
910
--FILE--

ext/mysqli/tests/mysqli_mysqlnd_read_timeout_long.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mysqlnd.net_read_timeout > default_socket_timeout
44
mysqli
55
--SKIPIF--
66
<?php
7+
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
78
require_once 'connect.inc';
89

910
if (!$link = @my_mysqli_connect($host, $user, $passwd, $db, $port, $socket)) {

ext/mysqli/tests/mysqli_stmt_bind_limits.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Bind limits
44
mysqli
55
--SKIPIF--
66
<?php
7+
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
78
require_once 'skipifconnectfailure.inc';
89
?>
910
--CONFLICTS--

ext/mysqli/tests/mysqli_stmt_send_long_data.phpt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mysqli_stmt_send_long_data()
44
mysqli
55
--SKIPIF--
66
<?php
7+
if (getenv("SKIP_SLOW_TESTS")) die('skip slow test');
78
require_once 'skipifconnectfailure.inc';
89
?>
910
--FILE--

0 commit comments

Comments
 (0)