shivammathur / setup-php

GitHub action to set up PHP with extensions, php.ini configuration, coverage drivers, and various tools.
https://setup-php.com
MIT License
2.89k stars 337 forks source link

Segfault with current PHP 8.3-dev and composer 2.5.8 #761

Closed LordSimal closed 1 year ago

LordSimal commented 1 year ago

Describe the bug Currently we are getting the following error in github actions

==> Setup Tools
/home/runner/work/_actions/shivammathur/setup-php/v2/src/scripts/../scripts/tools/add_tools.sh: line 28:  3853 Segmentation fault      (core dumped) php -r "try {\$p=new Phar('$tool_path.phar', 0);exit(0);} catch(Exception \$e) {exit(1);}"
✓ composer Added composer 2.5.8

Version

Runners

Operating systems Ubuntu 22.04.3

PHP versions PHP 8.3-dev

To Reproduce https://github.com/cakephp/cakephp/blob/5.x/.github/workflows/ci.yml#L64

jobs:
  testsuite:
    runs-on: ubuntu-22.04
    strategy:
      fail-fast: false
      matrix:
        php-version: ['8.1', '8.2']
        db-type: [sqlite, pgsql]
        prefer-lowest: ['']
        include:
          - php-version: '8.3'
            db-type: 'mysql'

    steps:
    - name: Setup PHP
      uses: shivammathur/setup-php@v2
      with:
        php-version: ${{ matrix.php-version }}
        extensions: mbstring, intl-72.1, apcu, memcached, redis, pdo_${{ matrix.db-type }}
        ini-values: apc.enable_cli = 1, zend.assertions = 1
        coverage: pcov

Expected behavior The action installs composer normally

Screenshots/Logs https://github.com/cakephp/cakephp/actions/runs/5977180418/job/16251666310#step:8:55

Additional context I am aware that PHP 8.3 is not yet relased and this may very well be a PHP 8.3 problem but I wasn't able to reproduce this problem in a local docker environment with PHP 8.3-dev and current composer.

shivammathur commented 1 year ago

@LordSimal

Thanks for reporting this,

I think intl extension was causing that segmentation fault in your workflow. I have rebuilt it for PHP 8.3. Please restart your workflow, it should work correctly now.

LordSimal commented 1 year ago

Thanks for the quick response! Yes, it works again 👍🏻

LordSimal commented 1 year ago

Well... it seems intl keeps breaking, but you don't need to rebuild it again. Lets see how the state of intl is a month before PHP 8.3 releases. https://github.com/cakephp/cakephp/actions/runs/6028244364/job/16355134042?pr=17256#step:8:24