From ffa95af7a354e4cbcbcd3ba8439bc2bf347373e7 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 4 Dec 2024 16:42:26 +0100 Subject: [PATCH 1/3] Backport ASAN push job to 8.1 --- .github/actions/configure-x64/action.yml | 36 +++++++++++++---------- .github/workflows/push.yml | 37 ++++++++++++++++++------ 2 files changed, 49 insertions(+), 24 deletions(-) diff --git a/.github/actions/configure-x64/action.yml b/.github/actions/configure-x64/action.yml index 3c3264ae07f5e..3a22932ab0fae 100644 --- a/.github/actions/configure-x64/action.yml +++ b/.github/actions/configure-x64/action.yml @@ -3,6 +3,12 @@ inputs: configurationParameters: default: '' required: false + skipSlow: + default: false + required: false + asan: + default: false + required: false runs: using: composite steps: @@ -17,9 +23,9 @@ runs: --enable-fpm \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ - --with-pgsql \ - --with-pdo-pgsql \ - --with-pdo-sqlite \ + ${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \ --enable-intl \ --without-pear \ --enable-gd \ @@ -34,7 +40,7 @@ runs: --enable-soap \ --enable-xmlreader \ --with-xsl \ - --with-tidy \ + ${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \ --enable-sysvsem \ --enable-sysvshm \ --enable-shmop \ @@ -51,14 +57,14 @@ runs: --enable-calendar \ --enable-ftp \ --with-pspell=/usr \ - --with-enchant=/usr \ + ${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \ --with-kerberos \ --enable-sysvmsg \ --with-ffi \ --enable-zend-test \ - --enable-dl-test=shared \ - --with-ldap \ - --with-ldap-sasl \ + ${{ inputs.skipSlow == 'false' && '--enable-dl-test=shared' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-ldap' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-ldap-sasl' || '' }} \ --with-password-argon2 \ --with-mhash \ --with-sodium \ @@ -69,16 +75,16 @@ runs: --with-tcadb \ --with-lmdb \ --with-qdbm \ - --with-snmp \ - --with-unixODBC \ - --with-imap \ - --with-imap-ssl \ - --with-pdo-odbc=unixODBC,/usr \ + ${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-imap' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-imap-ssl' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \ $([ -d "/opt/oracle/instantclient" ] && echo '--with-pdo-oci=shared,instantclient,/opt/oracle/instantclient') \ $([ -d "/opt/oracle/instantclient" ] && echo '--with-oci8=shared,instantclient,/opt/oracle/instantclient') \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ - --with-pdo-firebird \ - --with-pdo-dblib \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-firebird' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \ --enable-werror \ ${{ inputs.configurationParameters }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 5264a3d290fac..1a1a93d0666fa 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -63,53 +63,72 @@ jobs: fail-fast: false matrix: include: - - debug: true - zts: false - debug: false + zts: false + asan: false + - debug: true zts: true - name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: ubuntu-20.04 + asan: true + name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" + runs-on: ubuntu-${{ !matrix.asan && '22' || '24' }}.04 steps: - name: git checkout uses: actions/checkout@v4 + - name: apt + uses: ./.github/actions/apt-x64 + - name: System info + run: | + echo "::group::Show host CPU info" + lscpu + echo "::endgroup::" + echo "::group::Show installed package versions" + dpkg -l + echo "::endgroup::" - name: Create MSSQL container + if: ${{ !matrix.asan }} uses: ./.github/actions/setup-mssql - name: Create Oracle container + if: ${{ !matrix.asan }} uses: ./.github/actions/setup-oracle - name: Setup Caddy server uses: ./.github/actions/setup-caddy - - name: apt - uses: ./.github/actions/apt-x64 - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: # This duplicates the "job.name" expression above because # GitHub has no way to query the job name (github.job is the # job id, not the job name) - key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}-${{hashFiles('main/php_version.h')}}" + key: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}-${{hashFiles('main/php_version.h')}}" append-timestamp: false + save: ${{ github.event_name != 'pull_request' }} - name: ./configure uses: ./.github/actions/configure-x64 with: configurationParameters: >- --${{ matrix.debug && 'enable' || 'disable' }}-debug --${{ matrix.zts && 'enable' || 'disable' }}-zts + ${{ 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' || '' }} + skipSlow: ${{ matrix.asan }} - name: make run: make -j$(/usr/bin/nproc) >/dev/null - name: make install uses: ./.github/actions/install-linux - name: Setup + if: ${{ !matrix.asan }} uses: ./.github/actions/setup-x64 - name: Test + if: matrix.asan == false uses: ./.github/actions/test-linux - - name: Test Tracing JIT + - name: Test ${{ matrix.asan && 'OpCache' || 'Tracing JIT' }} uses: ./.github/actions/test-linux with: - jitType: tracing + jitType: ${{ matrix.asan && 'disable' || 'tracing' }} runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 + ${{ matrix.asan && '--asan -x' || '' }} - name: Verify generated files are up to date + if: ${{ !matrix.asan }} uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' From 341c994adaac15779b4d75aaefcfbc2d8c29b6a4 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 4 Dec 2024 16:43:48 +0100 Subject: [PATCH 2/3] Testing --- .github/workflows/push.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 1a1a93d0666fa..04a5ff8529cce 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -63,9 +63,9 @@ jobs: fail-fast: false matrix: include: - - debug: false - zts: false - asan: false + # - debug: false + # zts: false + # asan: false - debug: true zts: true asan: true @@ -131,7 +131,7 @@ jobs: if: ${{ !matrix.asan }} uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: false runs-on: macos-13 steps: - name: git checkout @@ -164,7 +164,7 @@ jobs: - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files WINDOWS: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + if: false name: WINDOWS_X64_ZTS runs-on: windows-2019 env: @@ -190,6 +190,7 @@ jobs: - name: Test run: .github/scripts/windows/test.bat FREEBSD: + if: false name: FREEBSD runs-on: ubuntu-latest steps: From 45a3b1484d4d8ea235c74df6771f0db1f332aca9 Mon Sep 17 00:00:00 2001 From: Ilija Tovilo Date: Wed, 4 Dec 2024 16:46:54 +0100 Subject: [PATCH 3/3] Fix --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 04a5ff8529cce..25baebb2ac063 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -70,7 +70,7 @@ jobs: zts: true asan: true name: "LINUX_X64_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" - runs-on: ubuntu-${{ !matrix.asan && '22' || '24' }}.04 + runs-on: ubuntu-20.04 steps: - name: git checkout uses: actions/checkout@v4