diff --git a/.github/actions/apt-x32/action.yml b/.github/actions/apt-x32/action.yml new file mode 100644 index 00000000000..2cde60fce55 --- /dev/null +++ b/.github/actions/apt-x32/action.yml @@ -0,0 +1,52 @@ +name: apt +runs: + using: composite + steps: + - shell: bash + run: | + set -x + + export DEBIAN_FRONTEND=noninteractive + dpkg --add-architecture i386 + apt-get update -y | true + # TODO: Reenable postgresql + postgresql-contrib packages once they work again. + apt-get install -y \ + autoconf \ + bison \ + g++-multilib \ + gcc-multilib \ + language-pack-de \ + libaspell-dev:i386 \ + libbz2-dev:i386 \ + libc6:i386 \ + libcurl4-openssl-dev:i386 \ + libffi-dev:i386 \ + libfreetype6-dev:i386 \ + libgmp-dev:i386 \ + libgssapi-krb5-2:i386 \ + libicu-dev:i386 \ + libjpeg-dev:i386 \ + libkrb5-dev:i386 \ + libonig-dev:i386 \ + libpng-dev:i386 \ + libpq-dev:i386 \ + libpspell-dev:i386 \ + libreadline-dev:i386 \ + libsasl2-dev:i386 \ + libsodium-dev:i386 \ + libsqlite3-dev:i386 \ + libssl-dev:i386 \ + libtidy-dev:i386 \ + libwebp-dev:i386 \ + libxml2-dev:i386 \ + libxml2-dev:i386 \ + libxpm-dev:i386 \ + libxslt1-dev:i386 \ + libzip-dev:i386 \ + locales \ + make \ + pkg-config:i386 \ + re2c \ + unzip \ + wget \ + zlib1g-dev:i386 diff --git a/azure/i386/job.yml b/.github/actions/configure-x32/action.yml similarity index 54% rename from azure/i386/job.yml rename to .github/actions/configure-x32/action.yml index 6f945aef36c..cc8fe653840 100644 --- a/azure/i386/job.yml +++ b/.github/actions/configure-x32/action.yml @@ -1,22 +1,20 @@ -parameters: - configurationName: '' - configurationParameters: '' - timeoutInMinutes: 75 +name: ./configure +inputs: + configurationParameters: + default: '' + required: false +runs: + using: composite + steps: + - shell: bash + run: | + set -x -jobs: - - job: ${{ parameters.configurationName }} - timeoutInMinutes: ${{ parameters.timeoutInMinutes }} - pool: - vmImage: 'ubuntu-20.04' - steps: - - template: apt.yml - - script: | ./buildconf --force export CFLAGS="-m32 -msse2" export CXXFLAGS="-m32 -msse2" export LDFLAGS=-L/usr/lib/i386-linux-gnu - export PKG_CONFIG=/usr/bin/i686-linux-gnu-pkg-config - ./configure ${{ parameters.configurationParameters }} \ + ./configure ${{ inputs.configurationParameters }} \ --enable-option-checking=fatal \ --build=i686-pc-linux-gnu \ --prefix=/usr \ @@ -69,27 +67,3 @@ jobs: --enable-werror \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d - displayName: 'Configure Build' - - script: make -j$(/usr/bin/nproc) >/dev/null - displayName: 'Make Build' - - script: | - set -e - sudo make install - sudo mkdir /etc/php.d - sudo chmod 777 /etc/php.d - echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini - echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini - echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini - echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini - displayName: 'Install Build' - - script: | - set -e - sudo service mysql start - mysql -uroot -proot -e "CREATE DATABASE IF NOT EXISTS test" - #sudo -u postgres psql -c "ALTER USER postgres PASSWORD 'postgres';" - #sudo -u postgres psql -c "CREATE DATABASE test;" - displayName: 'Setup' - - template: ../tests.yml - parameters: - configurationName: ${{ parameters.configurationName }} - runTestsParameters: ${{ parameters.runTestsParameters }} diff --git a/.github/actions/install-linux-x32/action.yml b/.github/actions/install-linux-x32/action.yml new file mode 100644 index 00000000000..bf5f09cd779 --- /dev/null +++ b/.github/actions/install-linux-x32/action.yml @@ -0,0 +1,15 @@ +name: Install +runs: + using: composite + steps: + - shell: bash + run: | + set -x + make install + mkdir /etc/php.d + chmod 777 /etc/php.d + echo mysqli.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/mysqli.ini + echo pdo_mysql.default_socket=/var/run/mysqld/mysqld.sock > /etc/php.d/pdo_mysql.ini + echo opcache.enable_cli=1 >> /etc/php.d/opcache.ini + echo opcache.protect_memory=1 >> /etc/php.d/opcache.ini + echo opcache.preload_user=root >> /etc/php.d/opcache.ini diff --git a/.github/actions/test-linux/action.yml b/.github/actions/test-linux/action.yml index cc32e9e693c..2c1d53f4d6d 100644 --- a/.github/actions/test-linux/action.yml +++ b/.github/actions/test-linux/action.yml @@ -14,7 +14,9 @@ runs: set -x export MYSQL_TEST_USER=root export MYSQL_TEST_PASSWD=root - export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test" + if [[ -z "$PDO_MYSQL_TEST_DSN" ]]; then + export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test" + fi export PDO_MYSQL_TEST_USER=root export PDO_MYSQL_TEST_PASS=root export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0" diff --git a/azure/lsan-suppressions.txt b/.github/lsan-suppressions.txt similarity index 100% rename from azure/lsan-suppressions.txt rename to .github/lsan-suppressions.txt diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0edfbc37e1b..13437480ed4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -106,6 +106,77 @@ jobs: -d opcache.jit=1205 - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + LINUX_X32: + needs: GENERATE_MATRIX + if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJson(needs.GENERATE_MATRIX.outputs.branches) }} + debug: [true, false] + zts: [true, false] + name: "${{ matrix.branch.name }}_LINUX_X32_${{ matrix.debug && 'DEBUG' || 'RELEASE' }}_${{ matrix.zts && 'ZTS' || 'NTS' }}" + runs-on: ubuntu-latest + container: + image: ubuntu:20.04 + env: + MYSQL_TEST_HOST: mysql + PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test + PDO_MYSQL_TEST_HOST: mysql + services: + mysql: + image: mysql:8 + ports: + - 3306:3306 + env: + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: root + steps: + - name: git checkout + uses: actions/checkout@v3 + with: + ref: ${{ matrix.branch.ref }} + - name: apt + uses: ./.github/actions/apt-x32 + - name: ./configure + uses: ./.github/actions/configure-x32 + with: + configurationParameters: >- + --${{ matrix.debug && 'enable' || 'disable' }}-debug + --${{ matrix.zts && 'enable' || 'disable' }}-zts + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install-linux-x32 + - name: Test + uses: ./.github/actions/test-linux + with: + runTestsParameters: >- + ${{ matrix.run_tests_parameters }} + - name: Test Tracing JIT + uses: ./.github/actions/test-linux + with: + runTestsParameters: >- + ${{ matrix.run_tests_parameters }} + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + -d opcache.jit_buffer_size=16M + - name: Test OpCache + uses: ./.github/actions/test-linux + with: + runTestsParameters: >- + ${{ matrix.run_tests_parameters }} + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + - name: Test Function JIT + uses: ./.github/actions/test-linux + with: + runTestsParameters: >- + ${{ matrix.run_tests_parameters }} + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + -d opcache.jit_buffer_size=16M + -d opcache.jit=1205 MACOS: needs: GENERATE_MATRIX if: ${{ needs.GENERATE_MATRIX.outputs.branches != '[]' }} diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 2f23c1c4ec5..10319fe4358 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -65,6 +65,47 @@ jobs: -d opcache.jit_buffer_size=16M - name: Verify generated files are up to date uses: ./.github/actions/verify-generated-files + LINUX_X32: + name: LINUX_X32_DEBUG_ZTS + runs-on: ubuntu-latest + container: + image: ubuntu:20.04 + env: + MYSQL_TEST_HOST: mysql + PDO_MYSQL_TEST_DSN: mysql:host=mysql;dbname=test + PDO_MYSQL_TEST_HOST: mysql + services: + mysql: + image: mysql:8 + ports: + - 3306:3306 + env: + MYSQL_DATABASE: test + MYSQL_ROOT_PASSWORD: root + steps: + - name: git checkout + uses: actions/checkout@v3 + - name: apt + uses: ./.github/actions/apt-x32 + - name: ./configure + uses: ./.github/actions/configure-x32 + with: + configurationParameters: >- + --enable-debug + --enable-zts + - name: make + run: make -j$(/usr/bin/nproc) >/dev/null + - name: make install + uses: ./.github/actions/install-linux-x32 + - name: Test + uses: ./.github/actions/test-linux + - name: Test Tracing JIT + uses: ./.github/actions/test-linux + with: + runTestsParameters: >- + -d zend_extension=opcache.so + -d opcache.enable_cli=1 + -d opcache.jit_buffer_size=16M MACOS_DEBUG_NTS: runs-on: macos-11 steps: diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ac4dbdbe6e2..00000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,48 +0,0 @@ -trigger: - batch: true - branches: - include: - - PHP-7.4 - - PHP-8.0 - - PHP-8.1 - - PHP-8.2 - - master - paths: - exclude: - - docs/* - - NEWS - - UPGRADING - - UPGRADING.INTERNALS - - README.md - - CONTRIBUTING.md - - CODING_STANDARDS.md - -schedules: - - cron: "0 1 * * *" - displayName: Nightly build - branches: - include: - - PHP-7.4 - - PHP-8.0 - - PHP-8.1 - - PHP-8.2 - - master - -jobs: - - template: azure/i386/job.yml - parameters: - configurationName: I386_DEBUG_ZTS - configurationParameters: '--enable-debug --enable-zts' - - ${{ if eq(variables['Build.Reason'], 'Schedule') }}: - - template: azure/i386/job.yml - parameters: - configurationName: I386_DEBUG_NTS - configurationParameters: '--enable-debug --disable-zts' - - template: azure/i386/job.yml - parameters: - configurationName: I386_RELEASE_NTS - configurationParameters: '--disable-debug --disable-zts' - - template: azure/i386/job.yml - parameters: - configurationName: I386_RELEASE_ZTS - configurationParameters: '--disable-debug --enable-zts' diff --git a/azure/i386/apt.yml b/azure/i386/apt.yml deleted file mode 100644 index e9aa3868120..00000000000 --- a/azure/i386/apt.yml +++ /dev/null @@ -1,46 +0,0 @@ -parameters: - packages: '' - -steps: - - script: | - sudo dpkg --add-architecture i386 - sudo apt-get update -y | true - sudo apt-get install -y gcc-multilib - sudo apt-get install -y g++-multilib - sudo apt-get purge -y libxml2 - # TODO: Reenable postgresql + postgresql-contrib packages once they work again. - sudo apt-get purge -y libpq5 - sudo apt-get install -y libc6:i386 - sudo apt-get install -y bison \ - re2c \ - locales \ - language-pack-de \ - libssl-dev:i386 \ - zlib1g-dev:i386 \ - libxml2-dev:i386 \ - libgmp-dev:i386 \ - libicu-dev:i386 \ - libtidy-dev:i386 \ - libaspell-dev:i386 \ - libpspell-dev:i386 \ - libsasl2-dev:i386 \ - libxpm-dev:i386 \ - libjpeg-dev:i386 \ - libpng-dev:i386 \ - libzip-dev:i386 \ - libbz2-dev:i386 \ - libsqlite3-dev:i386 \ - libwebp-dev:i386 \ - libonig-dev:i386 \ - libkrb5-dev:i386 \ - libgssapi-krb5-2:i386 \ - libcurl4-openssl-dev:i386 \ - libxml2-dev:i386 \ - libxslt1-dev:i386 \ - libpq-dev:i386 \ - libreadline-dev:i386 \ - libffi-dev:i386 \ - libfreetype6-dev:i386 \ - libsodium-dev:i386 \ - ${{ parameters.packages }} - displayName: 'APT' diff --git a/azure/test.yml b/azure/test.yml deleted file mode 100644 index 7f72d4624ae..00000000000 --- a/azure/test.yml +++ /dev/null @@ -1,37 +0,0 @@ -parameters: - runTestsName: '' - runTestsParameters: '' - -steps: - - script: | - export MYSQL_TEST_USER=root - export MYSQL_TEST_PASSWD=root - export PDO_MYSQL_TEST_DSN="mysql:host=localhost;dbname=test" - export PDO_MYSQL_TEST_USER=root - export PDO_MYSQL_TEST_PASS=root - export PDO_DBLIB_TEST_DSN="dblib:host=127.0.0.1;dbname=master;version=7.0" - export PDO_DBLIB_TEST_USER="pdo_test" - export PDO_DBLIB_TEST_PASS="password" - export TEST_PHP_JUNIT=junit.xml - export REPORT_EXIT_STATUS=no - export SKIP_IO_CAPTURE_TESTS=1 - rm -rf junit.xml | true - sapi/cli/php run-tests.php -P -q \ - -j$(/usr/bin/nproc) \ - -g FAIL,BORK,LEAK,XLEAK \ - --no-progress \ - --offline \ - --show-diff \ - --show-slow 1000 \ - --set-timeout 120 \ - ${{ parameters.runTestsParameters }} - displayName: 'Test ${{ parameters.configurationName }} ${{ parameters.runTestsName }}' - condition: or(succeeded(), failed()) - - task: PublishTestResults@2 - inputs: - testResultsFormat: 'JUnit' - testResultsFiles: junit.xml - testRunTitle: '${{ parameters.configurationName }} ${{ parameters.runTestsName }}' - failTaskOnFailedTests: true - displayName: 'Export ${{ parameters.configurationName }} ${{ parameters.runTestsName }} Results' - condition: or(succeeded(), failed()) diff --git a/azure/tests.yml b/azure/tests.yml deleted file mode 100644 index 7cbd1e56360..00000000000 --- a/azure/tests.yml +++ /dev/null @@ -1,35 +0,0 @@ -parameters: - configurationName: '' - runTestsParameters: '' - -steps: - - template: test.yml - parameters: - configurationName: ${{ parameters.configurationName }} - runTestsParameters: ${{ parameters.runTestsParameters }} - - ${{ if eq(variables['Build.Reason'], 'Schedule') }}: - - template: test.yml - parameters: - configurationName: ${{ parameters.configurationName }} - runTestsName: 'OpCache' - runTestsParameters: >- - ${{ parameters.runTestsParameters }} - -d zend_extension=opcache.so - - ${{ if eq(variables['Build.Reason'], 'Schedule') }}: - - template: test.yml - parameters: - configurationName: ${{ parameters.configurationName }} - runTestsName: 'Function JIT' - runTestsParameters: >- - ${{ parameters.runTestsParameters }} - -d zend_extension=opcache.so - -d opcache.jit_buffer_size=16M - -d opcache.jit=1205 - - template: test.yml - parameters: - configurationName: ${{ parameters.configurationName }} - runTestsName: 'Tracing JIT' - runTestsParameters: >- - ${{ parameters.runTestsParameters }} - -d zend_extension=opcache.so - -d opcache.jit_buffer_size=16M diff --git a/ext/ffi/tests/300.phpt b/ext/ffi/tests/300.phpt index 57a5485f9a5..b91c3e837cf 100644 --- a/ext/ffi/tests/300.phpt +++ b/ext/ffi/tests/300.phpt @@ -3,10 +3,12 @@ FFI 300: FFI preloading --EXTENSIONS-- ffi opcache +posix --SKIPIF-- --INI-- ffi.enable=1 diff --git a/ext/ffi/tests/bug78761.phpt b/ext/ffi/tests/bug78761.phpt index 5454ef1207b..566c7c36f3a 100644 --- a/ext/ffi/tests/bug78761.phpt +++ b/ext/ffi/tests/bug78761.phpt @@ -2,10 +2,12 @@ Bug #78761 (Zend memory heap corruption with preload and casting) --EXTENSIONS-- ffi +posix --SKIPIF-- --INI-- opcache.enable_cli=1 diff --git a/ext/pcntl/tests/pcntl_unshare_04.phpt b/ext/pcntl/tests/pcntl_unshare_04.phpt index 9a1c6d11000..6461013177e 100644 --- a/ext/pcntl/tests/pcntl_unshare_04.phpt +++ b/ext/pcntl/tests/pcntl_unshare_04.phpt @@ -6,6 +6,11 @@ posix --SKIPIF-- --FILE-- --FILE--