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

MacOS M1 runner, failure with libsodium linking #781

Closed beberlei closed 10 months ago

beberlei commented 10 months ago

Describe the bug

Starting tonight, when running setup-php on a Mac M1 runner we see these failures:

dyld[51869]: Library not loaded: @loader_path/../../../../opt/libsodium/lib/libsodium.26.dylib
  Referenced from: <7D7BC2FB-F026-3183-878E-312AA1F1E913> /opt/homebrew/Cellar/php-debug/8.2.12_1/bin/php
  Reason: tried: '/opt/homebrew/Cellar/php-debug/8.2.12_1/bin/../../../../opt/libsodium/lib/libsodium.26.dylib' (no such file), '/usr/local/lib/libsodium.26.dylib' (no such file), '/usr/lib/libsodium.26.dylib' (no such file, not in dyld cache)
/Users/runner/work/_temp/dd4cbeed-8d1b-4589-9b06-aac1c6b3580f.sh: line 1: 51869 Abort trap: 6           php .github/utils/link-pcre2-header-mac.php

Version

Runners

Operating systems

PHP versions 8.2

To Reproduce

  test-macos-m1:
    if: "!contains(github.event.head_commit.message, '[skip]')"
    runs-on: macos-13-xlarge

    strategy:
      fail-fast: false
      matrix:
        phpVersion:
          - "8.2"

    steps:
    - uses: actions/checkout@v3

    - name: "Install Dependencies"
      run: brew install pcre2 libsodium

    - name: "Install PHP"
      uses: "shivammathur/setup-php@v2"
      with:
        php-version: "${{ matrix.phpVersion }}"
        extensions: "tokenizer, posix, ctype, dom, soap, intl, :sodium"
        coverage: none # disables xdebug
      env:
        debug: true

    - name: "run anything php"
      run: php -r "echo 'Hello World';"

Expected behavior

No warnings during Setup PHP stage, no failure when running "php" with a segfault mentioning libsodium linking going wrong.

Screenshots/Logs

Bildschirmfoto 2023-11-07 um 11 49 31

shivammathur commented 10 months ago

@beberlei Please restart your workflow, setup-php should update libsodium now.

beberlei commented 10 months ago

@shivammathur thank you, it works again.