Skip to content

Commit ffa95af

Browse files
committed
Backport ASAN push job to 8.1
1 parent b263f35 commit ffa95af

File tree

2 files changed

+49
-24
lines changed

2 files changed

+49
-24
lines changed

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

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ inputs:
33
configurationParameters:
44
default: ''
55
required: false
6+
skipSlow:
7+
default: false
8+
required: false
9+
asan:
10+
default: false
11+
required: false
612
runs:
713
using: composite
814
steps:
@@ -17,9 +23,9 @@ runs:
1723
--enable-fpm \
1824
--with-pdo-mysql=mysqlnd \
1925
--with-mysqli=mysqlnd \
20-
--with-pgsql \
21-
--with-pdo-pgsql \
22-
--with-pdo-sqlite \
26+
${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \
27+
${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \
28+
${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \
2329
--enable-intl \
2430
--without-pear \
2531
--enable-gd \
@@ -34,7 +40,7 @@ runs:
3440
--enable-soap \
3541
--enable-xmlreader \
3642
--with-xsl \
37-
--with-tidy \
43+
${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \
3844
--enable-sysvsem \
3945
--enable-sysvshm \
4046
--enable-shmop \
@@ -51,14 +57,14 @@ runs:
5157
--enable-calendar \
5258
--enable-ftp \
5359
--with-pspell=/usr \
54-
--with-enchant=/usr \
60+
${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \
5561
--with-kerberos \
5662
--enable-sysvmsg \
5763
--with-ffi \
5864
--enable-zend-test \
59-
--enable-dl-test=shared \
60-
--with-ldap \
61-
--with-ldap-sasl \
65+
${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \
66+
${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \
67+
${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \
6268
--with-password-argon2 \
6369
--with-mhash \
6470
--with-sodium \
@@ -69,16 +75,16 @@ runs:
6975
--with-tcadb \
7076
--with-lmdb \
7177
--with-qdbm \
72-
--with-snmp \
73-
--with-unixODBC \
74-
--with-imap \
75-
--with-imap-ssl \
76-
--with-pdo-odbc=unixODBC,/usr \
78+
${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \
79+
${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \
80+
${{ inputs.skipSlow == 'false' && '--with-imap' || '' }} \
81+
${{ inputs.skipSlow == 'false' && '--with-imap-ssl' || '' }} \
82+
${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \
7783
$([ -d "/opt/oracle/instantclient" ] && echo '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient') \
7884
$([ -d "/opt/oracle/instantclient" ] && echo '--with-oci8=shared,instantclient,/opt/oracle/instantclient') \
7985
--with-config-file-path=/etc \
8086
--with-config-file-scan-dir=/etc/php.d \
81-
--with-pdo-firebird \
82-
--with-pdo-dblib \
87+
${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \
88+
${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \
8389
--enable-werror \
8490
${{ inputs.configurationParameters }}

.github/workflows/push.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,53 +63,72 @@ jobs:
6363
fail-fast: false
6464
matrix:
6565
include:
66-
- debug: true
67-
zts: false
6866
- debug: false
67+
zts: false
68+
asan: false
69+
- debug: true
6970
zts: true
70-
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}"
71-
runs-on: ubuntu-20.04
71+
asan: true
72+
name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}"
73+
runs-on: ubuntu-${{ !matrix.asan && '22' || '24' }}.04
7274
steps:
7375
- name: git checkout
7476
uses: actions/checkout@v4
77+
- name: apt
78+
uses: ./.github/actions/apt-x64
79+
- name: System info
80+
run: |
81+
echo "::group::Show host CPU info"
82+
lscpu
83+
echo "::endgroup::"
84+
echo "::group::Show installed package versions"
85+
dpkg -l
86+
echo "::endgroup::"
7587
- name: Create MSSQL container
88+
if: ${{ !matrix.asan }}
7689
uses: ./.github/actions/setup-mssql
7790
- name: Create Oracle container
91+
if: ${{ !matrix.asan }}
7892
uses: ./.github/actions/setup-oracle
7993
- name: Setup Caddy server
8094
uses: ./.github/actions/setup-caddy
81-
- name: apt
82-
uses: ./.github/actions/apt-x64
8395
- name: ccache
8496
uses: hendrikmuhs/[email protected]
8597
with:
8698
# This duplicates the "job.name" expression above because
8799
# GitHub has no way to query the job name (github.job is the
88100
# job id, not the job name)
89-
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}"
101+
key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}"
90102
append-timestamp: false
103+
save: ${{ github.event_name != 'pull_request' }}
91104
- name: ./configure
92105
uses: ./.github/actions/configure-x64
93106
with:
94107
configurationParameters: >-
95108
--${{ matrix.debug && 'enable' || 'disable' }}-debug
96109
--${{ matrix.zts && 'enable' || 'disable' }}-zts
110+
${{ matrix.asan && 'CFLAGS="-fsanitize=undefined,address -fno-sanitize=function -DZEND_TRACK_ARENA_ALLOC" LDFLAGS="-fsanitize=undefined,address -fno-sanitize=function" CC=clang CXX=clang++ --disable-opcache-jit' || '' }}
111+
skipSlow: ${{ matrix.asan }}
97112
- name: make
98113
run: make -j$(/usr/bin/nproc) >/dev/null
99114
- name: make install
100115
uses: ./.github/actions/install-linux
101116
- name: Setup
117+
if: ${{ !matrix.asan }}
102118
uses: ./.github/actions/setup-x64
103119
- name: Test
120+
if: matrix.asan == false
104121
uses: ./.github/actions/test-linux
105-
- name: Test Tracing JIT
122+
- name: Test ${{ matrix.asan && 'OpCache' || 'Tracing JIT' }}
106123
uses: ./.github/actions/test-linux
107124
with:
108-
jitType: tracing
125+
jitType: ${{ matrix.asan && 'disable' || 'tracing' }}
109126
runTestsParameters: >-
110127
-d zend_extension=opcache.so
111128
-d opcache.enable_cli=1
129+
${{ matrix.asan && '--asan -x' || '' }}
112130
- name: Verify generated files are up to date
131+
if: ${{ !matrix.asan }}
113132
uses: ./.github/actions/verify-generated-files
114133
MACOS_DEBUG_NTS:
115134
if: github.repository == 'php/php-src' || github.event_name == 'pull_request'

0 commit comments

Comments
 (0)