From 9750f5b6a3ee287541d65cf630aee81755920434 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Thu, 4 Apr 2024 16:10:28 +0200 Subject: [PATCH 1/7] Alpine/Musl CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Michael Voříšek --- .github/actions/apk/action.yml | 61 +++++++++++++++++ .github/actions/configure-alpine/action.yml | 76 +++++++++++++++++++++ .github/actions/install-alpine/action.yml | 10 +++ .github/actions/test-alpine/action.yml | 28 ++++++++ .github/workflows/push.yml | 63 +++++++++++++++++ Zend/zend.c | 2 +- 6 files changed, 239 insertions(+), 1 deletion(-) create mode 100644 .github/actions/apk/action.yml create mode 100644 .github/actions/configure-alpine/action.yml create mode 100644 .github/actions/install-alpine/action.yml create mode 100644 .github/actions/test-alpine/action.yml diff --git a/.github/actions/apk/action.yml b/.github/actions/apk/action.yml new file mode 100644 index 0000000000000..49e336aa0fecb --- /dev/null +++ b/.github/actions/apk/action.yml @@ -0,0 +1,61 @@ +name: apk +runs: + using: composite + steps: + - shell: sh + run: | + set -x + + apk update -q + apk add \ + util-linux \ + bash \ + sudo \ + build-base \ + autoconf \ + unzip \ + tar \ + bison \ + re2c \ + pkgconf \ + mysql-client \ + aspell-dev \ + hunspell-dev \ + hunspell-en \ + bzip2-dev \ + curl-dev \ + freetype-dev \ + gettext-dev \ + gnu-libiconv-dev \ + gmp-dev \ + icu-dev \ + icu-data-full \ + jpeg-dev \ + libffi-dev \ + libpng-dev \ + libsodium-dev \ + libwebp-dev \ + libxml2-dev \ + libxpm-dev \ + libxslt-dev \ + libzip-dev \ + oniguruma-dev \ + openssl-dev \ + readline-dev \ + sqlite-dev \ + tidyhtml-dev \ + krb5-dev \ + gdbm-dev \ + lmdb-dev \ + argon2-dev \ + enchant2-dev \ + enchant2-hunspell \ + freetds-dev \ + imap-dev \ + net-snmp-dev \ + openldap-dev \ + unixodbc-dev \ + postgresql14-dev \ + tzdata \ + musl-locales \ + musl-locales-lang diff --git a/.github/actions/configure-alpine/action.yml b/.github/actions/configure-alpine/action.yml new file mode 100644 index 0000000000000..0ed18e89c3241 --- /dev/null +++ b/.github/actions/configure-alpine/action.yml @@ -0,0 +1,76 @@ +name: ./configure +inputs: + configurationParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + set -x + ./buildconf --force + ./configure \ + --enable-option-checking=fatal \ + --prefix=/usr \ + --enable-phpdbg \ + --enable-fpm \ + --with-pdo-mysql=mysqlnd \ + --with-mysqli=mysqlnd \ + ${{ inputs.skipSlow == 'false' && '--with-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-pgsql' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-sqlite' || '' }} \ + --enable-intl \ + --without-pear \ + --enable-gd \ + --with-jpeg \ + --with-webp \ + --with-freetype \ + --with-xpm \ + --enable-exif \ + --with-zip \ + --with-zlib \ + --enable-soap \ + --enable-xmlreader \ + --with-xsl \ + ${{ inputs.skipSlow == 'false' && '--with-tidy' || '' }} \ + --enable-sysvsem \ + --enable-sysvshm \ + --enable-shmop \ + --enable-pcntl \ + --with-readline \ + --enable-mbstring \ + --with-iconv=/usr \ + --with-curl \ + --with-gettext \ + --enable-sockets \ + --with-bz2 \ + --with-openssl \ + --with-gmp \ + --enable-bcmath \ + --enable-calendar \ + --enable-ftp \ + ${{ inputs.skipSlow == 'false' && '--with-enchant=/usr' || '' }} \ + --enable-sysvmsg \ + --with-ffi \ + --enable-zend-test \ + ${{ 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 \ + --enable-dba \ + --with-cdb \ + --enable-flatfile \ + --enable-inifile \ + --with-lmdb \ + --with-gdbm \ + ${{ inputs.skipSlow == 'false' && '--with-snmp' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-unixODBC' || '' }} \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-odbc=unixODBC,/usr' || '' }} \ + --with-config-file-path=/etc \ + --with-config-file-scan-dir=/etc/php.d \ + ${{ inputs.skipSlow == 'false' && '--with-pdo-dblib' || '' }} \ + --enable-werror \ + ${{ inputs.configurationParameters }} diff --git a/.github/actions/install-alpine/action.yml b/.github/actions/install-alpine/action.yml new file mode 100644 index 0000000000000..3bb26c8cf35d5 --- /dev/null +++ b/.github/actions/install-alpine/action.yml @@ -0,0 +1,10 @@ +name: Install +runs: + using: composite + steps: + - shell: bash + run: | + set -x + sudo make install + sudo mkdir -p /etc/php.d + sudo chmod 777 /etc/php.d diff --git a/.github/actions/test-alpine/action.yml b/.github/actions/test-alpine/action.yml new file mode 100644 index 0000000000000..67f955cf9ec18 --- /dev/null +++ b/.github/actions/test-alpine/action.yml @@ -0,0 +1,28 @@ +name: Test +inputs: + testArtifacts: + default: null + required: false + runTestsParameters: + default: '' + required: false + jitType: + default: 'disable' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + set -x + export SKIP_IO_CAPTURE_TESTS=1 + export STACK_LIMIT_DEFAULTS_CHECK=1 + sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ + -d opcache.jit=${{ inputs.jitType }} \ + -d opcache.jit_buffer_size=64M \ + -j$(($(nproc) - 1)) \ + -g FAIL,BORK,LEAK,XLEAK \ + --no-progress \ + --show-diff \ + --show-slow 1000 \ + --set-timeout 120 diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 086c5cc0347bd..09d2dad3e90bb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -191,6 +191,69 @@ jobs: runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 + ALPINE: + if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + strategy: + fail-fast: false + matrix: + include: + - debug: true + zts: true + asan: true + name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" + runs-on: ubuntu-22.04 + container: + image: 'alpine:3.20.1' + steps: + - name: git checkout + uses: actions/checkout@v4 + - name: apk + uses: ./.github/actions/apk + - name: LLVM 17 (ASAN-only) + if: ${{ matrix.asan }} + # libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17: + # https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20 + run: | + apk add clang17 compiler-rt + - name: System info + run: | + echo "::group::Show host CPU info" + lscpu + echo "::endgroup::" + echo "::group::Show installed package versions" + apk list + echo "::endgroup::" + - 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: "ALPINE_${{ 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-alpine + with: + # -Wno-error=stringop-overread: main/getopt.c: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622 + 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-17 CXX=clang++-17' || 'CFLAGS="-Wno-error=stringop-overread"' }} + skipSlow: ${{ matrix.asan }} + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install-alpine + - name: Test Tracing JIT + uses: ./.github/actions/test-alpine + with: + testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_Tracing JIT + jitType: tracing + runTestsParameters: >- + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + ${{ matrix.asan && '--asan -x' || '' }} MACOS_DEBUG_NTS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' strategy: diff --git a/Zend/zend.c b/Zend/zend.c index ef5ea8cebc78b..9f6e709efbecf 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1410,7 +1410,7 @@ ZEND_API ZEND_COLD void zend_error_zstr_at( zval retval; zval orig_user_error_handler; bool in_compilation; - zend_class_entry *saved_class_entry; + zend_class_entry *saved_class_entry = NULL; zend_stack loop_var_stack; zend_stack delayed_oplines_stack; int type = orig_type & E_ALL; From 6c89145b20bdebcab9982b4f5405eca5e92564f0 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 30 Jul 2024 12:29:57 +0200 Subject: [PATCH 2/7] Review --- .github/actions/configure-alpine/action.yml | 3 +++ .github/actions/test-alpine/action.yml | 3 --- .github/workflows/push.yml | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/configure-alpine/action.yml b/.github/actions/configure-alpine/action.yml index 0ed18e89c3241..fe02dacfcdaf6 100644 --- a/.github/actions/configure-alpine/action.yml +++ b/.github/actions/configure-alpine/action.yml @@ -3,6 +3,9 @@ inputs: configurationParameters: default: '' required: false + skipSlow: + default: false + required: false runs: using: composite steps: diff --git a/.github/actions/test-alpine/action.yml b/.github/actions/test-alpine/action.yml index 67f955cf9ec18..f5e4651dcd497 100644 --- a/.github/actions/test-alpine/action.yml +++ b/.github/actions/test-alpine/action.yml @@ -1,8 +1,5 @@ name: Test inputs: - testArtifacts: - default: null - required: false runTestsParameters: default: '' required: false diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 09d2dad3e90bb..b90a90b9b370c 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -248,7 +248,6 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-alpine with: - testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}_Tracing JIT jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so From ee6895c66721f222febf2310ce477bf2b547f461 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Tue, 13 Aug 2024 21:01:21 +0200 Subject: [PATCH 3/7] Nightly --- .github/actions/test-alpine/action.yml | 2 +- .github/nightly_matrix.php | 22 +++++++++ .github/workflows/nightly.yml | 56 +++++++++++++++++++++++ .github/workflows/push.yml | 62 -------------------------- 4 files changed, 79 insertions(+), 63 deletions(-) diff --git a/.github/actions/test-alpine/action.yml b/.github/actions/test-alpine/action.yml index f5e4651dcd497..e14e3176b8efd 100644 --- a/.github/actions/test-alpine/action.yml +++ b/.github/actions/test-alpine/action.yml @@ -17,7 +17,7 @@ runs: sapi/cli/php run-tests.php -P -q ${{ inputs.runTestsParameters }} \ -d opcache.jit=${{ inputs.jitType }} \ -d opcache.jit_buffer_size=64M \ - -j$(($(nproc) - 1)) \ + -j$(nproc) \ -g FAIL,BORK,LEAK,XLEAK \ --no-progress \ --show-diff \ diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index a5804eaa02456..f0603dd97d73e 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -121,6 +121,26 @@ function get_macos_matrix_include(array $branches) { return $jobs; } +function get_alpine_matrix_include(array $branches) { + $jobs = []; + foreach ($branches as $branch) { + if ([$branch['version']['major'], $branch['version']['minor']] < [8, 4]) { + continue; + } + $jobs[] = [ + 'name' => '_ASAN_UBSAN', + 'branch' => $branch, + 'debug' => true, + 'zts' => true, + 'asan' => true, + 'test_jit' => true, + '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", + 'run_tests_parameters' => '--asan -x', + ]; + } + return $jobs; +} + function get_current_version(): array { $file = dirname(__DIR__) . '/main/php_version.h'; $content = file_get_contents($file); @@ -145,10 +165,12 @@ function get_current_version(): array { $matrix_include = get_matrix_include($branches); $windows_matrix_include = get_windows_matrix_include($branches); $macos_matrix_include = get_macos_matrix_include($branches); +$alpine_matrix_include = get_alpine_matrix_include($branches); $f = fopen(getenv('GITHUB_OUTPUT'), 'a'); fwrite($f, 'branches=' . json_encode($branches, JSON_UNESCAPED_SLASHES) . "\n"); fwrite($f, 'matrix-include=' . json_encode($matrix_include, JSON_UNESCAPED_SLASHES) . "\n"); fwrite($f, 'windows-matrix-include=' . json_encode($windows_matrix_include, JSON_UNESCAPED_SLASHES) . "\n"); fwrite($f, 'macos-matrix-include=' . json_encode($macos_matrix_include, JSON_UNESCAPED_SLASHES) . "\n"); +fwrite($f, 'alpine-matrix-include=' . json_encode($alpine_matrix_include, JSON_UNESCAPED_SLASHES) . "\n"); fclose($f); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6899045c196d8..3c6e16c9171d7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -15,6 +15,7 @@ jobs: matrix-include: ${{ steps.set-matrix.outputs.matrix-include }} windows-matrix-include: ${{ steps.set-matrix.outputs.windows-matrix-include }} macos-matrix-include: ${{ steps.set-matrix.outputs.macos-matrix-include }} + alpine-matrix-include: ${{ steps.set-matrix.outputs.alpine-matrix-include }} steps: - uses: actions/checkout@v4 with: @@ -39,6 +40,61 @@ jobs: uses: ./.github/actions/notify-slack with: token: ${{ secrets.ACTION_MONITORING_SLACK }} + ALPINE: + needs: GENERATE_MATRIX + if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} + strategy: + fail-fast: false + matrix: + include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.alpine-matrix-include) }} + name: "${{ matrix.branch.name }}_ALPINE_X64${{ matrix.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: ubuntu-22.04 + container: + image: 'alpine:3.20.1' + steps: + - name: git checkout + uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch.ref }} + - name: apk + uses: ./.github/actions/apk + - name: LLVM 17 (ASAN-only) + if: ${{ matrix.asan }} + # libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17: + # https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20 + run: | + apk add clang17 compiler-rt + - name: System info + run: | + echo "::group::Show host CPU info" + lscpu + echo "::endgroup::" + echo "::group::Show installed package versions" + apk list + echo "::endgroup::" + - name: ./configure + uses: ./.github/actions/configure-alpine + with: + configurationParameters: >- + ${{ matrix.configuration_parameters }} + --${{ matrix.debug && 'enable' || 'disable' }}-debug + --${{ matrix.zts && 'enable' || 'disable' }}-zts + skipSlow: ${{ matrix.asan }} + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install-alpine + - name: Test Tracing JIT + if: matrix.test_jit + uses: ./.github/actions/test-alpine + with: + jitType: tracing + runTestsParameters: >- + ${{ matrix.run_tests_parameters }} + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + ${{ matrix.asan && '--asan -x' || '' }} + LINUX_X64: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b90a90b9b370c..086c5cc0347bd 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -191,68 +191,6 @@ jobs: runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 - ALPINE: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - strategy: - fail-fast: false - matrix: - include: - - debug: true - zts: true - asan: true - name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" - runs-on: ubuntu-22.04 - container: - image: 'alpine:3.20.1' - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: apk - uses: ./.github/actions/apk - - name: LLVM 17 (ASAN-only) - if: ${{ matrix.asan }} - # libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17: - # https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20 - run: | - apk add clang17 compiler-rt - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - apk list - echo "::endgroup::" - - 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: "ALPINE_${{ 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-alpine - with: - # -Wno-error=stringop-overread: main/getopt.c: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622 - 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-17 CXX=clang++-17' || 'CFLAGS="-Wno-error=stringop-overread"' }} - skipSlow: ${{ matrix.asan }} - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-alpine - - name: Test Tracing JIT - uses: ./.github/actions/test-alpine - with: - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - ${{ matrix.asan && '--asan -x' || '' }} MACOS_DEBUG_NTS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' strategy: From 182b5f2e48355865ebf955378a00dc139c426d8e Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 14 Aug 2024 16:15:34 +0200 Subject: [PATCH 4/7] Remove redundancy --- .github/workflows/nightly.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3c6e16c9171d7..6e7fc24d16a02 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -93,7 +93,6 @@ jobs: ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so -d opcache.enable_cli=1 - ${{ matrix.asan && '--asan -x' || '' }} LINUX_X64: needs: GENERATE_MATRIX From 7dc88daf0f57cc2582fc0c4cb8dbbea69de82407 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 14 Aug 2024 16:18:19 +0200 Subject: [PATCH 5/7] Add slack notif --- .github/workflows/nightly.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 6e7fc24d16a02..d4da1fdc84eb0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -93,6 +93,11 @@ jobs: ${{ matrix.run_tests_parameters }} -d zend_extension=opcache.so -d opcache.enable_cli=1 + - name: Notify Slack + if: failure() + uses: ./.github/actions/notify-slack + with: + token: ${{ secrets.ACTION_MONITORING_SLACK }} LINUX_X64: needs: GENERATE_MATRIX From f309b0550865696c553d66dccb948a5f760f7bfa Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 14 Aug 2024 19:01:04 +0200 Subject: [PATCH 6/7] Re-add push job --- .github/workflows/push.yml | 62 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 086c5cc0347bd..1b020c12cbdbb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -191,6 +191,68 @@ jobs: runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 + ALPINE: + if: github.repository == 'php/php-src' || github.event_name == 'pull_request' + strategy: + fail-fast: false + matrix: + include: + - debug: true + zts: true + asan: false + name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" + runs-on: ubuntu-22.04 + container: + image: 'alpine:3.20.1' + steps: + - name: git checkout + uses: actions/checkout@v4 + - name: apk + uses: ./.github/actions/apk + - name: LLVM 17 (ASAN-only) + if: ${{ matrix.asan }} + # libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17: + # https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20 + run: | + apk add clang17 compiler-rt + - name: System info + run: | + echo "::group::Show host CPU info" + lscpu + echo "::endgroup::" + echo "::group::Show installed package versions" + apk list + echo "::endgroup::" + - 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: "ALPINE_${{ 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-alpine + with: + # -Wno-error=stringop-overread: main/getopt.c: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622 + 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-17 CXX=clang++-17' || 'CFLAGS="-Wno-error=stringop-overread"' }} + skipSlow: ${{ matrix.asan }} + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install-alpine + - name: Test Tracing JIT + uses: ./.github/actions/test-alpine + with: + jitType: tracing + runTestsParameters: >- + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + ${{ matrix.asan && '--asan -x' || '' }} MACOS_DEBUG_NTS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' strategy: From b28ef386e9b14cb45047595da32a9a7f2cc62a81 Mon Sep 17 00:00:00 2001 From: Arnaud Le Blanc Date: Wed, 28 Aug 2024 16:48:19 +0200 Subject: [PATCH 7/7] Revert "Re-add push job" This reverts commit f309b0550865696c553d66dccb948a5f760f7bfa. --- .github/workflows/push.yml | 62 -------------------------------------- 1 file changed, 62 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 1b020c12cbdbb..086c5cc0347bd 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -191,68 +191,6 @@ jobs: runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 - ALPINE: - if: github.repository == 'php/php-src' || github.event_name == 'pull_request' - strategy: - fail-fast: false - matrix: - include: - - debug: true - zts: true - asan: false - name: "ALPINE_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}${{ matrix.asan && '_ASAN' || '' }}" - runs-on: ubuntu-22.04 - container: - image: 'alpine:3.20.1' - steps: - - name: git checkout - uses: actions/checkout@v4 - - name: apk - uses: ./.github/actions/apk - - name: LLVM 17 (ASAN-only) - if: ${{ matrix.asan }} - # libclang_rt.asan-x86_64.a is provided by compiler-rt, and only for clang17: - # https://pkgs.alpinelinux.org/contents?file=libclang_rt.asan-x86_64.a&path=&name=&branch=v3.20 - run: | - apk add clang17 compiler-rt - - name: System info - run: | - echo "::group::Show host CPU info" - lscpu - echo "::endgroup::" - echo "::group::Show installed package versions" - apk list - echo "::endgroup::" - - 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: "ALPINE_${{ 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-alpine - with: - # -Wno-error=stringop-overread: main/getopt.c: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114622 - 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-17 CXX=clang++-17' || 'CFLAGS="-Wno-error=stringop-overread"' }} - skipSlow: ${{ matrix.asan }} - - name: make - run: make -j$(/usr/bin/nproc) >/dev/null - - name: make install - uses: ./.github/actions/install-alpine - - name: Test Tracing JIT - uses: ./.github/actions/test-alpine - with: - jitType: tracing - runTestsParameters: >- - -d zend_extension=opcache.so - -d opcache.enable_cli=1 - ${{ matrix.asan && '--asan -x' || '' }} MACOS_DEBUG_NTS: if: github.repository == 'php/php-src' || github.event_name == 'pull_request' strategy: