From 810aa3d4917f59a153d40c545c0b2802a86c4ea3 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 05:09:37 +0000 Subject: [PATCH 01/12] Add macos-14 to the push workflow --- .github/workflows/push.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 215fdbf73fb7d..a3acfefc23593 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -148,7 +148,11 @@ jobs: if: ${{ !matrix.asan }} uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: - runs-on: macos-13 + strategy: + matrix: + os: [13, 14] + name: MACOS_DEBUG_NTS_${{ matrix.os }} + runs-on: macos-${{ matrix.os }} steps: - name: git checkout uses: actions/checkout@v4 From 876a1f4760e64c9449de3dca7e5f0c074344d2b8 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 05:50:27 +0000 Subject: [PATCH 02/12] Remove hardcoded brew path in configure-macos action --- .github/actions/configure-macos/action.yml | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/actions/configure-macos/action.yml b/.github/actions/configure-macos/action.yml index 9a0e9eed4f6a4..cda8e7fbac8f4 100644 --- a/.github/actions/configure-macos/action.yml +++ b/.github/actions/configure-macos/action.yml @@ -9,15 +9,16 @@ runs: - shell: bash run: | set -x - export PATH="/usr/local/opt/bison/bin:$PATH" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/openssl@1.1/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/curl/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/krb5/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libffi/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxml2/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/libxslt/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/zlib/lib/pkgconfig" - export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/local/opt/icu4c/lib/pkgconfig" + BREW_OPT="$(brew --prefix)"/opt + export PATH="$BREW_OPT/bison/bin:$PATH" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/openssl@1.1/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/curl/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/krb5/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libffi/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxml2/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/libxslt/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/zlib/lib/pkgconfig" + export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$BREW_OPT/icu4c/lib/pkgconfig" ./buildconf --force ./configure \ --enable-option-checking=fatal \ @@ -25,8 +26,8 @@ runs: --enable-fpm \ --with-pdo-mysql=mysqlnd \ --with-mysqli=mysqlnd \ - --with-pgsql=/usr/local/opt/libpq \ - --with-pdo-pgsql=/usr/local/opt/libpq \ + --with-pgsql="$BREW_OPT"/libpq \ + --with-pdo-pgsql="$BREW_OPT"/libpq \ --with-pdo-sqlite \ --without-pear \ --enable-gd \ @@ -39,21 +40,21 @@ runs: --enable-soap \ --enable-xmlreader \ --with-xsl \ - --with-tidy=/usr/local/opt/tidy-html5 \ + --with-tidy="$BREW_OPT"/tidy-html5 \ --with-libxml \ --enable-sysvsem \ --enable-sysvshm \ --enable-shmop \ --enable-pcntl \ - --with-readline=/usr/local/opt/readline \ + --with-readline="$BREW_OPT"/readline \ --enable-mbstring \ --with-curl \ - --with-gettext=/usr/local/opt/gettext \ + --with-gettext="$BREW_OPT"/gettext \ --enable-sockets \ - --with-bz2=/usr/local/opt/bzip2 \ + --with-bz2="$BREW_OPT"/bzip2 \ --with-openssl \ - --with-gmp=/usr/local/opt/gmp \ - --with-iconv=/usr/local/opt/libiconv \ + --with-gmp="$BREW_OPT"/gmp \ + --with-iconv="$BREW_OPT"/libiconv \ --enable-bcmath \ --enable-calendar \ --enable-ftp \ From 19300de2abbead0c2b58ef26e04415aed73f09db Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 05:56:24 +0000 Subject: [PATCH 03/12] Include architecture in macos job name --- .github/workflows/push.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a3acfefc23593..0d350c7f11a3e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -150,8 +150,12 @@ jobs: MACOS_DEBUG_NTS: strategy: matrix: - os: [13, 14] - name: MACOS_DEBUG_NTS_${{ matrix.os }} + include: + - os: 13 + arch: X32 + - os: 14 + arch: ARM64 + name: MACOS_${{ matrix.arch }}_DEBUG_NTS runs-on: macos-${{ matrix.os }} steps: - name: git checkout From 8a0ba58aac47d3637a6163efb10632a85d9de27b Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 06:01:25 +0000 Subject: [PATCH 04/12] Add os to ccache-action in macos job --- .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 0d350c7f11a3e..72fa3709e0d3f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -165,7 +165,7 @@ jobs: - name: ccache uses: hendrikmuhs/ccache-action@v1.2 with: - key: "${{github.job}}-${{hashFiles('main/php_version.h')}}" + key: "${{github.job}}-${{matrix.os}}-${{hashFiles('main/php_version.h')}}" append-timestamp: false - name: ./configure uses: ./.github/actions/configure-macos From 92a0adc6f1c2dbf542474a871624e0b9c36873c8 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 06:18:08 +0000 Subject: [PATCH 05/12] Add libsodium in brew action Since we build with the configuration option --with-sodium, adding libsodium to make sure it is installed --- .github/actions/brew/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/actions/brew/action.yml b/.github/actions/brew/action.yml index 51d37aa56d470..567929d0306dc 100644 --- a/.github/actions/brew/action.yml +++ b/.github/actions/brew/action.yml @@ -31,6 +31,7 @@ runs: tidy-html5 \ libxml2 \ libjpeg \ + libsodium \ libxslt \ postgresql brew link icu4c gettext --force From eb1726db63d1188734e82fce4a4f4e21612d55ad Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 06:23:57 +0000 Subject: [PATCH 06/12] Add fail-fast to macos matrix --- .github/workflows/push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 72fa3709e0d3f..b211025538a36 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -149,6 +149,7 @@ jobs: uses: ./.github/actions/verify-generated-files MACOS_DEBUG_NTS: strategy: + fail-fast: false matrix: include: - os: 13 From c1c82671b08506dd8769ba94f1c82bf8b5a980d2 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 07:32:12 +0000 Subject: [PATCH 07/12] Add macos-14 to the nightly workflow --- .github/nightly_matrix.php | 29 +++++++++++++++++++++++++++++ .github/workflows/nightly.yml | 9 ++++----- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 6d186db1edc2e..ef5733817e537 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -91,6 +91,33 @@ function get_windows_matrix_include(array $branches) { return $jobs; } +function get_macos_matrix_include(array $branches) { + $jobs = []; + foreach ($branches as $branch) { + foreach([true, false] as $debug) { + foreach([true, false] as $zts) { + $jobs[] = [ + 'branch' => $branch, + 'debug' => $debug, + 'zts' => $zts, + 'os' => $branch === 'master' ? '13' : '12', + 'arch' => 'X32', + ]; + if($branch['name'] === 'master') { + $jobs[] = [ + 'branch' => $branch, + 'debug' => $debug, + 'zts' => $zts, + 'os' => '14', + 'arch' => 'ARM64', + ]; + } + } + } + } + return $jobs; +} + function get_current_version(): array { $file = dirname(__DIR__) . '/main/php_version.h'; $content = file_get_contents($file); @@ -114,9 +141,11 @@ function get_current_version(): array { : [['name' => strtoupper($branch), 'ref' => $branch, 'version' => get_current_version()]]; $matrix_include = get_matrix_include($branches); $windows_matrix_include = get_windows_matrix_include($branches); +$macos_matrix_include = get_macos_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"); fclose($f); diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d00ca74e184fb..fe4db36e59381 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,6 +14,7 @@ jobs: branches: ${{ steps.set-matrix.outputs.branches }} 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 }} steps: - uses: actions/checkout@v4 with: @@ -230,11 +231,9 @@ jobs: strategy: fail-fast: false matrix: - branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} - debug: [true, false] - zts: [true, false] - name: "${{ matrix.branch.name }}_MACOS_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" - runs-on: macos-${{ matrix.branch.version.minor >= 4 && '13' || '12' }} + include: ${{ fromJson(needs.GENERATE_MATRIX.outputs.macos-matrix-include) }} + name: "${{ matrix.branch.name }}_MACOS_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: macos-${{ matrix.os }} steps: - name: git checkout uses: actions/checkout@v4 From 8d144608c9c300bd231e7bc22450a2e1be6db723 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 10:23:41 +0000 Subject: [PATCH 08/12] Fix adding bison to PATH in workflows --- .github/actions/verify-generated-files/action.yml | 2 +- .github/workflows/nightly.yml | 2 +- .github/workflows/push.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/verify-generated-files/action.yml b/.github/actions/verify-generated-files/action.yml index 139dd84662411..d4ca6301144c0 100644 --- a/.github/actions/verify-generated-files/action.yml +++ b/.github/actions/verify-generated-files/action.yml @@ -5,7 +5,7 @@ runs: - shell: bash run: | set -x - [[ "$OSTYPE" == "darwin"* ]] && export PATH="/usr/local/opt/bison/bin:$PATH" + [[ "$OSTYPE" == "darwin"* ]] && export PATH="$(brew --prefix)/opt/bison/bin:$PATH" scripts/dev/credits scripts/dev/genfiles Zend/zend_vm_gen.php diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index fe4db36e59381..a6e7772fbb398 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -249,7 +249,7 @@ jobs: --${{ matrix.zts && 'enable' || 'disable' }}-zts - name: make run: |- - export PATH="/usr/local/opt/bison/bin:$PATH" + export PATH="$(brew --prefix)/opt/bison/bin:$PATH" make -j$(sysctl -n hw.logicalcpu) >/dev/null - name: make install run: sudo make install diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index b211025538a36..a5a97ae2eda55 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -174,7 +174,7 @@ jobs: configurationParameters: --enable-debug --disable-zts - name: make run: |- - export PATH="/usr/local/opt/bison/bin:$PATH" + export PATH="$(brew --prefix)/opt/bison/bin:$PATH" make -j$(sysctl -n hw.logicalcpu) >/dev/null - name: make install run: sudo make install From 54319279bb1a7fdc7799a59aebc132680dc397b9 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 11:20:35 +0000 Subject: [PATCH 09/12] Fix architecture --- .github/nightly_matrix.php | 2 +- .github/workflows/push.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index ef5733817e537..a4760fe54ac3e 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -101,7 +101,7 @@ function get_macos_matrix_include(array $branches) { 'debug' => $debug, 'zts' => $zts, 'os' => $branch === 'master' ? '13' : '12', - 'arch' => 'X32', + 'arch' => 'X64', ]; if($branch['name'] === 'master') { $jobs[] = [ diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index a5a97ae2eda55..c599ee62e3f98 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -153,7 +153,7 @@ jobs: matrix: include: - os: 13 - arch: X32 + arch: X64 - os: 14 arch: ARM64 name: MACOS_${{ matrix.arch }}_DEBUG_NTS From e693d30609a3f5a3787d4adaf0ec04895d23dd8d Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 11:25:20 +0000 Subject: [PATCH 10/12] Use version to compare in nightly_matrix.php --- .github/nightly_matrix.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index a4760fe54ac3e..84a150e952278 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -103,7 +103,7 @@ function get_macos_matrix_include(array $branches) { 'os' => $branch === 'master' ? '13' : '12', 'arch' => 'X64', ]; - if($branch['name'] === 'master') { + if($branch['version']['minor'] === 4) { $jobs[] = [ 'branch' => $branch, 'debug' => $debug, From a92770eb4f5e291f6e666d229ed1fe9d83adca26 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 1 Feb 2024 11:29:48 +0000 Subject: [PATCH 11/12] Make sure test-macos artifacts have unique name --- .github/workflows/nightly.yml | 8 ++++---- .github/workflows/push.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index a6e7772fbb398..e55f5d9bb16f0 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -256,11 +256,11 @@ jobs: - name: Test uses: ./.github/actions/test-macos with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} - name: Test Tracing JIT uses: ./.github/actions/test-macos with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so @@ -268,14 +268,14 @@ jobs: - name: Test OpCache uses: ./.github/actions/test-macos with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} OpCache runTestsParameters: >- -d zend_extension=opcache.so -d opcache.enable_cli=1 - name: Test Function JIT uses: ./.github/actions/test-macos with: - testArtifacts: ${{ matrix.branch.name }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT + testArtifacts: ${{ matrix.branch.name }}_${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Function JIT jitType: function runTestsParameters: >- -d zend_extension=opcache.so diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index c599ee62e3f98..ff162c7bcfb0e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -181,7 +181,7 @@ jobs: - name: Test Tracing JIT uses: ./.github/actions/test-macos with: - testArtifacts: ${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT + testArtifacts: ${{ matrix.arch }}_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }} Tracing JIT jitType: tracing runTestsParameters: >- -d zend_extension=opcache.so From 8d90d861cd4d40f542aa1d0e81455d2994878905 Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Fri, 2 Feb 2024 09:45:07 +0530 Subject: [PATCH 12/12] Update .github/nightly_matrix.php Co-authored-by: Ilija Tovilo --- .github/nightly_matrix.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/nightly_matrix.php b/.github/nightly_matrix.php index 84a150e952278..597528b940607 100644 --- a/.github/nightly_matrix.php +++ b/.github/nightly_matrix.php @@ -103,7 +103,7 @@ function get_macos_matrix_include(array $branches) { 'os' => $branch === 'master' ? '13' : '12', 'arch' => 'X64', ]; - if($branch['version']['minor'] === 4) { + if ($branch['version']['minor'] >= 4 || $branch['version']['major'] >= 9) { $jobs[] = [ 'branch' => $branch, 'debug' => $debug,