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

MSVC ARM compiler fails CMake configuration #10981

Open
2 of 15 tasks
madebr opened this issue Nov 16, 2024 · 5 comments
Open
2 of 15 tasks

MSVC ARM compiler fails CMake configuration #10981

madebr opened this issue Nov 16, 2024 · 5 comments

Comments

@madebr
Copy link

madebr commented Nov 16, 2024

Description

Using the MSVC ARM compiler on the latest windows-2022 image fails CMake configuration

  Image: windows-2022
  Version: 20241113.3.0
  Included Software: https://github.com/actions/runner-images/blob/win22/20241113.3/images/windows/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20241113.3

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • Ubuntu 24.04
  • macOS 12
  • macOS 13
  • macOS 13 Arm64
  • macOS 14
  • macOS 14 Arm64
  • macOS 15
  • macOS 15 Arm64
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

  Image: windows-2022
  Version: 20241113.3.0
  Included Software: https://github.com/actions/runner-images/blob/win22/20241113.3/images/windows/Windows2022-Readme.md
  Image Release: https://github.com/actions/runner-images/releases/tag/win22%2F20241113.3

https://github.com/libsdl-org/SDL/actions/runs/11873470201/job/33088578294

Is it regression?

https://github.com/libsdl-org/SDL/actions/runs/11873470201/job/33088868957

Expected behavior

CMake configuration suceeds. kernel32.lib is a library that is expected to be available in any Windows SDK.

-- The C compiler identification is MSVC 19.41.34123.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.41.34120/bin/Hostx64/arm/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done

Actual behavior

-- The C compiler identification is MSVC 19.42.34433.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/arm/cl.exe
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/arm/cl.exe - broken
CMake Error at C:/Program Files/CMake/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.42.34433/bin/Hostx64/arm/cl.exe"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: 'D:/a/SDL/SDL/build/CMakeFiles/CMakeScratch/TryCompile-rxem71'
    
    Run Build Command(s): D:/a/_temp/ninja-1.12.1-X64/ninja.exe -v cmTC_aa530
    [1/2] C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\arm\cl.exe  /nologo   /DWIN32 /D_WINDOWS  /Zi /Ob0 /Od -MTd /showIncludes /FoCMakeFiles\cmTC_aa530.dir\testCCompiler.c.obj /FdCMakeFiles\cmTC_aa530.dir\ /FS -c D:\a\SDL\SDL\build\CMakeFiles\CMakeScratch\TryCompile-rxem71\testCCompiler.c
    [2/2] C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1942 --intdir=CMakeFiles\cmTC_aa530.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\arm\link.exe /nologo CMakeFiles\cmTC_aa530.dir\testCCompiler.c.obj  /out:cmTC_aa530.exe /implib:cmTC_aa530.lib /pdb:cmTC_aa530.pdb /version:0.0 -DEBUG  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib && cd ."
    FAILED: cmTC_aa530.exe 
    C:\Windows\system32\cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --msvc-ver=1942 --intdir=CMakeFiles\cmTC_aa530.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100261~1.0\x64\mt.exe --manifests  -- C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\arm\link.exe /nologo CMakeFiles\cmTC_aa530.dir\testCCompiler.c.obj  /out:cmTC_aa530.exe /implib:cmTC_aa530.lib /pdb:cmTC_aa530.pdb /version:0.0 -DEBUG  /debug /INCREMENTAL /subsystem:console  kernel32.lib user32.lib && cd ."
    LINK Pass 1: command "C:\PROGRA~1\MICROS~2\2022\ENTERP~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\arm\link.exe /nologo CMakeFiles\cmTC_aa530.dir\testCCompiler.c.obj /out:cmTC_aa530.exe /implib:cmTC_aa530.lib /pdb:cmTC_aa530.pdb /version:0.0 -DEBUG /debug /INCREMENTAL /subsystem:console kernel32.lib user32.lib /MANIFEST /MANIFESTFILE:CMakeFiles\cmTC_aa530.dir/intermediate.manifest CMakeFiles\cmTC_aa530.dir/manifest.res" failed (exit code 1104) with the following output:
    LINK : fatal error LNK1104: cannot open file 'kernel32.lib'

    ninja: build stopped: subcommand failed.
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:4 (project)


-- Configuring incomplete, errors occurred!

Repro steps

build:
  os: windows-latest
  steps:
  - use: ilammy/msvc-dev-cmd@v1
    with:
      arch: x64_arm
  - run: |
      # download ninja
  - run: |
      cmake -S some-cmake-project -B build -GNinja
@zufuliu
Copy link

zufuliu commented Nov 17, 2024

See zufuliu/notepad4#839, Windows SDK 10.0.26100.0 no longer install libs for 32-bit arm.
Following is my workaround (copy libs from Windows SDK 10.0.22621.0). see zufuliu/notepad4@e53e433:

SET "Win10Lib=C:\Program Files (x86)\Windows Kits\10\Lib"
robocopy "%Win10Lib%\10.0.22621.0\ucrt\arm" "%Win10Lib%\10.0.26100.0\ucrt\arm" /E 1>NUL
robocopy "%Win10Lib%\10.0.22621.0\um\arm" "%Win10Lib%\10.0.26100.0\um\arm" /E 1>NUL

@madebr
Copy link
Author

madebr commented Nov 17, 2024

Thanks, I worked around this issue on ci by pinning the Windows SDK version to 10.0.22621.0 (sdk input of ilammy/msvc-dev-cmd)

Is there a public announcement about ARM32 on Windows being deprecated?

@Prabhatkumar59
Copy link
Contributor

Hi @madebr - Thank you for bringing this issue to our attention. We will look into this issue and will update you after investigating.

@binarymaster
Copy link

Meh... this broke ReactOS ARM port build: #10978 (comment)

(at first I thought this is a problem with 20241113.3.0 image)

binarymaster added a commit to binarymaster/reactos that referenced this issue Nov 21, 2024
The latest GitHub Actions runner image 20241113.3.0 uses WDK 10.0.26100.0,
which dropped support for 32-bit ARM platform:
- golang/go#68552 (comment)
- actions/runner-images#10981

Fix the failing build by sticking to WDK 10.0.22621.0.
binarymaster added a commit to reactos/reactos that referenced this issue Nov 21, 2024
The latest GitHub Actions runner image 20241113.3.0 uses WDK 10.0.26100.0,
which dropped support for 32-bit ARM platform:
- golang/go#68552 (comment)
- actions/runner-images#10981

Fix the failing build by sticking to WDK 10.0.22621.0.

CORE-17604
pbatard added a commit to pbatard/rufus that referenced this issue Nov 22, 2024
* Per actions/runner-images#10981 and plenty of other similar
  reports, GitHub Actions can no longer compile ARM32 binaries by default using the
  latest Visual Studio toolchain, due to Microsoft current Windows SDK having dropped
  the ARM32 toolchain (per zufuliu/notepad4#839).
* Well, I have better things to do then try to maintain platforms in the process of
  being deprecated, so I'll let the people who care about Rufus on ARM32 propose a
  non-intrusive workaround that can work with current GitHub Actions.
@maron2000
Copy link

maron2000 commented Nov 22, 2024

I haven't tested yet but explicitly setting the SDK version in your project files (.vcxproj) might be a workaround.

Another workaround is to explicitly set the SDK version in your project files (.vcxproj) to 10.0.22621.0.
Setting it to 10.0 will make Visual Studio pick the latest installed version.

  <PropertyGroup Label="Globals">
    <WindowsTargetPlatformVersion>10.0.22621.0</WindowsTargetPlatformVersion>
    ...

https://learn.microsoft.com/en-us/gaming/gdk/_content/gc/tools-pc/visualstudio/gr-vs-2019-support-notes

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

No branches or pull requests

6 participants