Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shared extension vs Windows #887

Closed
jrfnl opened this issue Nov 30, 2024 · 6 comments
Closed

Shared extension vs Windows #887

jrfnl opened this issue Nov 30, 2024 · 6 comments

Comments

@jrfnl
Copy link
Contributor

jrfnl commented Nov 30, 2024

Hi @shivammathur, I'm currently working on some tests related to a CLI tool requirements check.

While doing so, I'm running into some issues related to "shared" vs non-shared extensions, in particular on Windows, and I'm struggling to find documentation on this. Maybe you could point me in the right direction ?

Here are some examples of things I'm running into:

Example 1

    strategy:
      fail-fast: false
      matrix:
        os: ['ubuntu-latest', 'windows-latest']

    runs-on: ${{ matrix.os }}

    steps:
      - name: Install PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 7.2
          ini-values: 'error_reporting=-1, display_errors=On'
          extensions: none, xmlwriter, SimpleXML
          coverage: none
        env:
          fail-fast: true
      - run: php requirementscheck.php

For this case, the intend of the test is to verify that the requirements check detects that the Tokenizer extension is missing.
On Ubuntu this works fine and the test correctly fails.
On Windows, the test passes, which leads me to believe that the Tokenizer extension was not disabled, so I presume this must be a "shared" extension which cannot be disabled ?

Example 2

    strategy:
      fail-fast: false
      matrix:
        os: ['ubuntu-latest', 'windows-latest']

    runs-on: ${{ matrix.os }}

    steps:
      - name: Install PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: 7.2
          ini-values: 'error_reporting=-1, display_errors=On'
          extensions: :xmlwriter
          coverage: none
        env:
          fail-fast: true
      - run: php requirementscheck.php

For this case, the intend of the test is to verify that the requirements check detects that the XMLWriter extension is missing.
On Ubuntu this works fine and the test correctly fails.
On Windows, the test fails too, but on the setup-php set with the following error:

==> Setup Extensions 
✗ :xmlwriter Could not disable xmlwriter on PHP 7.2.34 as it not a shared extension 
Add-Log: D:\a\_actions\shivammathur\setup-php\v2\src\scripts\extensions\add_extensions.ps1:237
Line |
 237 |        Add-Log $cross ":$extension" "Could not disable $extension on P …
     |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Could not disable xmlwriter on PHP 7.2.34 as it not a shared extension
Error: The process 'C:\Program Files\PowerShell\7\pwsh.exe' failed with exit code 1
@shivammathur
Copy link
Owner

@jrfnl

On Ubuntu xmlwriter, simplexml and tokenizer are all shared extensions. On Windows these are all compiled statically into the php binary so cannot be disabled.

@jrfnl
Copy link
Contributor Author

jrfnl commented Nov 30, 2024

@shivammathur Thanks for the fast reply! Is there a list somewhere of which extensions are shared / can be disabled vs those that are compiled into the php binary ?

@shivammathur
Copy link
Owner

I will try to add that to the wiki

@jrfnl
Copy link
Contributor Author

jrfnl commented Nov 30, 2024

That was the first place I looked, so that would be awesome! ⭐ ⭐ ⭐ ⭐ ⭐

@shivammathur
Copy link
Owner

Added in the lists in wiki

@jrfnl
Copy link
Contributor Author

jrfnl commented Dec 1, 2024

:hero:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants