actions / runner-images

GitHub Actions runner images
MIT License
9.39k stars 2.91k forks source link

Building using nmake on Azure Pipelines broke in windows-2022 image 20220710.1 #5986

Closed swt2c closed 1 year ago

swt2c commented 1 year ago

Description

Before image 20220710.1, it used to be possible to use nmake to build a VS project on windows-2022. However, this no longer works as nmake doesn't seem to be able to find system headers:

nmake.exe -f makefile.vc UNICODE=1 OFFICIAL_BUILD=1 COMPILER_VERSION=140 SHARED=1 MONOLITHIC=0 USE_OPENGL=1 USE_GDIPLUS=1 BUILD=release

Microsoft (R) Program Maintenance Utility Version 14.32.31332.0
Copyright (C) Microsoft Corporation.  All rights reserved.

    if not exist vc140_mswudll mkdir vc140_mswudll
    if not exist ..\..\lib\vc140_dll mkdir ..\..\lib\vc140_dll
    if not exist ..\..\lib\vc140_dll\mswu mkdir ..\..\lib\vc140_dll\mswu
    if not exist ..\..\lib\vc140_dll\mswu\wx mkdir ..\..\lib\vc140_dll\mswu\wx
    if not exist ..\..\lib\vc140_dll\mswu\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\vc140_dll\mswu\wx\setup.h
        1 file(s) copied.
    if not exist ..\..\lib\vc140_dll\mswu\wx\msw mkdir ..\..\lib\vc140_dll\mswu\wx\msw
    cl /EP /nologo  "..\..\include\wx\msw\genrcdefs.h" > "..\..\lib\vc140_dll\mswu\wx\msw\rcdefs.h"
genrcdefs.h
    cl /c /nologo /TC /Fovc140_mswudll\wxregex_pcre2_auto_possess.obj /MD /DWIN32  /Zi /Fd..\..\lib\vc140_dll\wxregexu.pdb   /O2 /D_CRT_SECURE_NO_DEPRECATE=1  /D_CRT_NON_CONFORMING_SWPRINTFS=1 /D_SCL_SECURE_NO_WARNINGS=1  /D__NO_VC_CRTDBG__ /DTARGET_CPU_COMPFLAG=0 /DNDEBUG  /D_CRT_SECURE_NO_WARNINGS /I..\..\include /I..\..\lib\vc140_dll\mswu  /I..\..\3rdparty\pcre\src\wx /D__WX__ /DHAVE_CONFIG_H /D_UNICODE    ..\..\3rdparty\pcre\src\pcre2_auto_possess.c
pcre2_auto_possess.c
D:\a\1\s\ext\wxWidgets\include\wx/chartype.h(105): fatal error C1083: Cannot open include file: 'tchar.h': No such file or directory
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.32.31326\bin\HostX86\x86\cl.EXE"' : return code '0x2'
Stop.

This worked fine with 20220626.1 (here's an example: https://alldunn.visualstudio.com/wxPython-CI/_build/results?buildId=965)

Platforms affected

Virtual environments affected

Image version and build link

20220710.1

https://alldunn.visualstudio.com/wxPython-CI/_build/results?buildId=972

Is it regression?

Yes 20220626.1 https://alldunn.visualstudio.com/wxPython-CI/_build/results?buildId=965

Expected behavior

Build successfully.

Actual behavior

Build fails.

Repro steps

Run CI job.

al-cheb commented 1 year ago

Hey @swt2c. We will take a look at it.

al-cheb commented 1 year ago

I was able to reproduce the issue. Looks like building tools can't find path to libs. I took msvc-dev-cmd task to initialize VS environment and the build completed successfully.

jobs:
  build:
    runs-on: windows-2022

    steps:
     - uses: actions/checkout@v3
       with:
        repository: 'wxWidgets/Phoenix'
        submodules: 'recursive'
     - uses: actions/setup-python@v4
       with:
        python-version: '3.10'        
     - name: Install dep
       run: |
          curl.exe -O https://bootstrap.pypa.io/get-pip.py
          python get-pip.py
          python -m pip install -U setuptools wheel
          python -m pip install -r requirements.txt
     - uses: ilammy/msvc-dev-cmd@v1
     - name: build
       run: |
          python build.py --jobs=4 build_wx

image

swt2c commented 1 year ago

Thanks @al-cheb - I can't use ilammy/msvc-dev-cmd on Azure Pipelines, though, can I?

dmitry-shibanov commented 1 year ago

Hello @swt2c. Could you please try to use this steps for windows-2022:

- task: BatchScript@1
  displayName: 'Set up vcvarsall '
  inputs:
    filename: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat'
    arguments: x64
    modifyEnvironment: true
- script: |
   python build.py --jobs=4 build_wx
  displayName: 'Python build'
swt2c commented 1 year ago

@dmitry-shibanov, I can confirm that works.

dmitry-shibanov commented 1 year ago

Hello @swt2c. Thank you for your response. In this case I'm going to close the issue.