Build fails on Git Actions due to the Windows SDK

These errors don’t occur on my pc, but only on git actions.

log

workflow


name: OpenAL Soft Build Test

on: [push, pull_request]

jobs:
  build:
    name: ${{ matrix.config.name }} | ${{ matrix.config.build_type }}
    runs-on: ${{ matrix.config.os }}
    strategy:
      fail-fast: false
      matrix:
        config:
          -
            name: "Visual Studio 15 2017 Win64"
            os: windows-2016
            qtarch: "win64_msvc2017_64"
            qtdir: "Qt5Widgets_DIR:PATH=./Qt/5.14.2/msvc2017_64/lib/cmake/Qt5Widgets"
            qtdll: "./Qt/5.14.2/msvc2017_64"
            build_type: "Release"
          -
            name: "Visual Studio 15 2017"
            os: windows-2016
            qtarch: "win32_msvc2017"
            qtdir: "Qt5Widgets_DIR:PATH=./Qt/5.14.2/msvc2017/lib/cmake/Qt5Widgets"
            qtdll: "./Qt/5.14.2/msvc2017"
            build_type: "Release"

    steps:
    - name: Checkout source code
      uses: actions/checkout@v2
      with:
        ref: master

    - name: Install Qt
      uses: jurplel/install-qt-action@v2
      with:
        version: '5.14.2'
        host: 'windows'
        target: 'desktop'
        arch: '${{ matrix.config.qtarch }}'
        dir: '${{ github.workspace }}/'

    - name: Configure
      shell: bash
      run: |
        cmake -B ./build -G "${{ matrix.config.name }}" -DALSOFT_BUILD_ROUTER=ON -DALSOFT_REQUIRE_WINMM=ON -DALSOFT_REQUIRE_DSOUND=ON -DALSOFT_REQUIRE_WASAPI=ON -DALSOFT_EMBED_HRTF_DATA=YES -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config.build_type }} -DFORCE_STATIC_VCRT:BOOL=ON -D"${{ matrix.config.qtdir }}"
    - name: Build
      shell: bash
      run: |
        cmake --build ./build --config ${{ matrix.config.build_type }} --clean-first
    - name: Packing artifact
      shell: bash
      run: |
        mkdir ./Build/Release/platforms
        cp ${{ matrix.config.qtdll }}/bin/Qt5Core.dll ./Build/Release/
        cp ${{ matrix.config.qtdll }}/bin/Qt5Gui.dll ./Build/Release/
        cp ${{ matrix.config.qtdll }}/bin/Qt5Widgets.dll ./Build/Release/
        cp ${{ matrix.config.qtdll }}/plugins/platforms/qwindows.dll ./Build/Release/platforms/
        cd ./Build/Release
        7z a -r -ssw -mx5 -t7z ${{ matrix.config.name }}_${{ matrix.config.build_type }}.7z
        cd ../../
    - name: Upload artifact
      uses: actions/upload-artifact@v2
      with:
        name: Artifact
        path: ./build/Release/${{ matrix.config.name }}.7z

Hi @PenguinDOOM,

Glad to see you in Github Community Forum!

Since the error doesn’t occur on you PC, could you please try to make it as a self-hosted runner of your repository, and use it for the workflow? You can export the file details for comparison, eg: …\Build_Win64\soft_oal.vcxproj, for the debug.
Besides, i googled and find the related link, please check if it helps.

Thanks

I compared the output and there was no difference.
I tried to compile it directly with cl and it compiled without any problem. The msvc on github actions may be doing something extra.

Hi @PenguinDOOM,

I checked your repository, and find you have changed the script, and the error occurs for the win_32 Configuration step now.

I fixed the hardcode folder "D:\a\openal-soft\openal-soft\Build_Win64" to ‘“D:\a\openal-soft\openal-soft${{ matrix.config.build_dir }}”’, the error is gone now.

The whole command as below:

    - name: Configure
      shell: cmd
      run: |
        cmake -B .\${{ matrix.config.build_dir }} -G "${{ matrix.config.name }}" -DALSOFT_BUILD_ROUTER=ON -DALSOFT_REQUIRE_WINMM=ON -DALSOFT_REQUIRE_DSOUND=ON -DALSOFT_REQUIRE_WASAPI=ON -DALSOFT_EMBED_HRTF_DATA=YES -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config.build_type }} -DFORCE_STATIC_VCRT:BOOL=ON
        cd .\al
        "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx86\x86\cl.exe" -I "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\include" -I "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\atlmfc\include" -I "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\VS\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt" -I "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\VS\UnitTest\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\shared" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\winrt" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\cppwinrt" -I "D:\a\openal-soft\openal-soft\include" -I "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um" -I "D:\a\openal-soft\openal-soft\${{ matrix.config.build_dir }}" -I "D:\a\openal-soft\openal-soft" -I "D:\a\openal-soft\openal-soft\alc" -I "D:\a\openal-soft\openal-soft\common" /permissive- /GS /TP /W4 /wd"4065" /wd"4268" /wd"4324" /wd"5030" /Zc:wchar_t /Gm- /O2 /Ob2 /Zc:inline /fp:precise /D "WIN32" /D "_WINDOWS" /D "NDEBUG" /D "AL_BUILD_LIBRARY" /D "AL_ALEXT_PROTOTYPES" /D "_WIN32" /D "_CRT_SECURE_NO_WARNINGS" /D "NOMINMAX" /D "CMAKE_INTDIR=\"Release\"" /D "soft_oal_EXPORTS" /D "_WINDLL" /D "_MBCS" /errorReport:prompt /WX- /Zc:forScope /GR /Gd /MT /std:c++14 /EHsc /nologo /diagnostics:classic /w14640 /c error.cpp      

Please let me know if it works for you.

Thanks

Hi @PenguinDOOM,

Just want to confirm whether it’s resolved with my answer? Let me know if you have any questions.

If it’s resolved, you can mark the answer to archive the ticket.

Thanks

The part you pointed out was an error that occurred to test the build and didn’t get to the root of the problem. I don’t know what to do anymore.

Hi @PenguinDOOM,

Thanks for your reply!

Since the workflow is passed now, i’m a little confused what is the problem. Could you please describe more about the issue? which command doesn’t work and what is the error?

If it works fine on local machine but failed in github action, is there any environment setting different between local and hosted runner?

Thanks