Skip to content

Shared extension vs Windows #887

@jrfnl

Description

@jrfnl

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions