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

[OpenAL-Soft]build failure for x64-windows-static-md on Github Actions #38003

Closed
MadDeCoDeR opened this issue Apr 6, 2024 · 5 comments
Closed
Assignees
Labels
category:question This issue is a question

Comments

@MadDeCoDeR
Copy link

Operating system

Github Windows VM (?)

Compiler

MSVC

Steps to reproduce the behavior

1. Crate a repository that has vcpkg as a submoddule and uses it within cmake
2. Add OpenAL-soft as a depedency
3. Set a github actions workflow script that configures the project through CMake with Windows and MSbuild 
4. Let it run
5. Workflow run fails

Sample workflow script:
`windows-build:
        runs-on: windows-latest
    
        steps:
        - uses: actions/checkout@v3
          with:
            submodules: recursive
    
        - name: setup-msbuild
          uses: microsoft/setup-msbuild@v2
          with:
            vs-version: '[17.0, 18.0)'
            msbuild-architecture: x64
    
        - name: Configure CMake
          working-directory: ${{github.workspace}}
          shell: powershell
          run: cmake -B ${{github.workspace}}/build --preset=windows-x64-2022
          
        - name: Build
          # Build your program with the given configuration
          run: cmake --build ${{github.workspace}}/build --config ${{inputs.build_type}}`

Failure logs

OpenAL32.lib(null.cpp.obj) : error LNK2019: unresolved external symbol _Thrd_sleep_for referenced in function "void __cdecl std::this_thread::sleep_for<__int64,struct std::ratio<1,1000> >(class std::chrono::duration<__int64,struct std::ratio<1,1000> > const &)" (??$sleep_for@_JU?$ratio@$00$0DOI@@std@@@this_thread@std@@YAXAEBV?$duration@_JU?$ratio@$00$0DOI@@std@@@chrono@1@@z)
OpenAL32.lib(wave.cpp.obj) : error LNK2001: unresolved external symbol _Thrd_sleep_for

Additional context

No response

@MadDeCoDeR MadDeCoDeR added the category:port-bug The issue is with a library, which is something the port should already support label Apr 6, 2024
@JonLiu1993
Copy link
Member

@MadDeCoDeR, Thanks for posting this issue, I installed OpenAL-Soft:x64-windows-static locally, then created a cmake project and used it without any problems. Can you provide more details on your usage steps?

CMakeLists:

cmake_minimum_required(VERSION 3.5)

project(test)

find_package(OpenAL CONFIG REQUIRED)

add_executable(test CMakeProject1.cpp)

target_link_libraries(test PRIVATE OpenAL::OpenAL)

Config:

1> CMake generation started for configuration: 'x64-Debug'.
1> Command line: "C:\WINDOWS\system32\cmd.exe" /c "%SYSTEMROOT%\System32\chcp.com 65001 >NUL && "C:\PROGRAM FILES\MICROSOFT VISUAL STUDIO\2022\COMMUNITY\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\CMAKE\CMake\bin\cmake.exe"  -G "Visual Studio 17 2022" -A x64  -DCMAKE_CONFIGURATION_TYPES:STRING="Debug" -DCMAKE_INSTALL_PREFIX:PATH="C:\Users\test\source\repos\CMakeProject1\out\install\x64-Debug" -DVCPKG_TARGET_TRIPLET:STRING="x64-windows-static"  -DCMAKE_TOOLCHAIN_FILE=F:/test/vcpkg/scripts/buildsystems/vcpkg.cmake "C:\Users\test\source\repos\CMakeProject1" 2>&1"
1> Working directory: C:\Users\test\source\repos\CMakeProject1\out\build\x64-Debug
1> [CMake] -- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.19045.
1> [CMake] -- The C compiler identification is MSVC 19.39.33522.0
1> [CMake] -- The CXX compiler identification is MSVC 19.39.33522.0
1> [CMake] -- Detecting C compiler ABI info
1> [CMake] -- Detecting C compiler ABI info - done
1> [CMake] -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting C compile features
1> [CMake] -- Detecting C compile features - done
1> [CMake] -- Detecting CXX compiler ABI info
1> [CMake] -- Detecting CXX compiler ABI info - done
1> [CMake] -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.39.33519/bin/Hostx64/x64/cl.exe - skipped
1> [CMake] -- Detecting CXX compile features
1> [CMake] -- Detecting CXX compile features - done
1> [CMake] CMake Deprecation Warning at F:/test/vcpkg/installed/x64-windows-static/share/openal-soft/OpenALConfig.cmake:1 (cmake_minimum_required):
1> [CMake]   Compatibility with CMake < 3.5 will be removed from a future version of
1> [CMake]   CMake.
1> [CMake] 
1> [CMake]   Update the VERSION argument <min> value or use a ...<max> suffix to tell
1> [CMake]   CMake that the project does not need compatibility with older versions.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   F:/test/vcpkg/scripts/buildsystems/vcpkg.cmake:859 (_find_package)
1> [CMake]   CMakeProject1/CMakeLists.txt:6 (find_package)
1> [CMake] 
1> [CMake] 
1> [CMake] -- Configuring done (7.7s)
1> [CMake] -- Generating done (0.0s)
1> [CMake] -- Build files have been written to: C:/Users/test/source/repos/CMakeProject1/out/build/x64-debug
1> Extracted CMake variables.
1> Extracted source files and headers.
1> Extracted code model.
1> Extracted toolchain configurations.
1> Extracted includes paths.
1> CMake generation finished.

@JonLiu1993 JonLiu1993 added requires:repro The issue is not currently repro-able and removed category:port-bug The issue is with a library, which is something the port should already support labels Apr 7, 2024
@MadDeCoDeR
Copy link
Author

Hi @JonLiu1993 if you read again the reproduction steps I already mention that the issue is present when the compilation runs through Github Actions. Locally it works perfectly fine.
P.S.: Also howw similar/different are the static and static-md triplets?

@JonLiu1993
Copy link
Member

Sorry we can't use Github Actions to test, we all write simple cmake project tests through VS

x64-windows:
VCPKG_LIBRARY_LINKAGE = dynamic
VCPKG_CRT_LINKAGE = dynamic

x64-windows-static:
VCPKG_LIBRARY_LINKAGE = static
VCPKG_CRT_LINKAGE = static

x64-windows-static-md:
VCPKG_LIBRARY_LINKAGE = static
VCPKG_CRT_LINKAGE = dynamic

VCPKG_LIBRARY_LINKAGE Determines if a library/port is build as a static or dynamic library
VCPKG_CRT_LINKAGE Determines if the static (/MT(d)) or dynamic (/MD(d)) CRT (C runtime) is used

@Kolfering
Copy link
Contributor

Hello,
We were also facing this problem and this is basically due to github runners having different VC toolset versions installed at the same time. (in this case 17.9 & 17.8) and having the wrong one being picked up.
https://developercommunity.visualstudio.com/t/Latest-Visual-Studio-version-1791-ca/10598722
actions/runner-images#8259
Adding a step in the workflow to delete “C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.v143.default.*” as a workaround fixed the problem

@MadDeCoDeR
Copy link
Author

Hello, We were also facing this problem and this is basically due to github runners having different VC toolset versions installed at the same time. (in this case 17.9 & 17.8) and having the wrong one being picked up. https://developercommunity.visualstudio.com/t/Latest-Visual-Studio-version-1791-ca/10598722 actions/runner-images#8259 Adding a step in the workflow to delete “C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\Microsoft.VCToolsVersion.v143.default.*” as a workaround fixed the problem

Thank you, now it works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants