cmb69/setup-php-sdk

Output seems to be missing/wrong in PHP 7.1

Closed this issue · 2 comments

Running on PHP 7.1 results in the subsequent ilammy/msvc-dev-cmd being unhappy, I'm guessing it's the toolset output is not acceptable perhaps?

Example build: https://github.com/scoutapp/scout-apm-php-ext/runs/6881900710?check_suite_focus=true

Run ilammy/msvc-dev-cmd@v1
Found with vswhere: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat
Error: Could not setup Developer Command Prompt: invalid parameters
[ERROR:vcvars140.bat] VC++ 14.0 Toolset Installation was not found. Init did not complete successfully.
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat]    1 : basic debug logging
[ERROR:VsDevCmd.bat]    2 : detailed debug logging
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1

Example usage:

jobs:
  windows-test:
    name: "Build and test on Windows"
    defaults:
      run:
        shell: cmd
    strategy:
      fail-fast: false
      matrix:
        version: [ "8.1", "8.0", "7.4", "7.3", "7.2", "7.1" ]
        arch: [ x64, x86 ]
        ts: [ ts, nts ]
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - name: Setup PHP SDK
        id: setup-php
        uses: cmb69/setup-php-sdk@v0.5
        with:
          version: ${{matrix.version}}
          arch: ${{matrix.arch}}
          ts: ${{matrix.ts}}
      - name: Enable Developer Command Prompt
        uses: ilammy/msvc-dev-cmd@v1
        with:
          arch: ${{matrix.arch}}
          toolset: ${{steps.setup-php.outputs.toolset}}
cmb69 commented

The problem is that the 14.0 (aka v140) toolset is not available on the hosted windows-2022 images (windows-latest is currently an alias of windows-2022). I don't think there's anything I can do, except to document the issue. If you need builds for PHP < 7.2, use the windows-2019 images (runs-on: windows-2019); that should work for all other PHP versions, too, and don't have any drawbacks for now. Visual Studio 2022 will likely only be required for PHP 8.3, and I assume that windows-2019 will be supported for several years.

The problem is that the 14.0 (aka v140) toolset is not available on the hosted windows-2022 images (windows-latest is currently an alias of windows-2022). I don't think there's anything I can do, except to document the issue. If you need builds for PHP < 7.2, use the windows-2019 images (runs-on: windows-2019); that should work for all other PHP versions, too, and don't have any drawbacks for now. Visual Studio 2022 will likely only be required for PHP 8.3, and I assume that windows-2019 will be supported for several years.

Yeah I think docs update is all that's needed there - see #11 for a proposal - thank you!