mbuild icon indicating copy to clipboard operation
mbuild copied to clipboard

Visual Studio 2022 build fails on Windows

Open flobernd opened this issue 2 years ago • 4 comments

Hi there,

I just tryed to build xed on a Windows 10 machine with Visual Studio 2022 (v17.4.1):

[MBUILD WARNING] Command execution failed. Waiting for remaining jobs and exiting.
R: 0 P: 110 C: 4 E: 4 / 129 msecs
[COMMAND     ] "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/bin/amd64/cl.exe" -I../include/private -I../include/public/xed -I../include/public -Iobj -Iobj/include-private     /nologo  /MT  /favor:EM64T  /W4 /WX /wd4091 /wd4127 /wd4505 /wd4702 /wd4244 /wd4292 /DXED_VERSION="v2022.10.11" /DXED_AMD_ENABLED /DXED_VIA_ENABLED /DXED_AVX /DXED_SUPPORTS_AVX512 /DXED_MPX /DXED_CET /DXED_SUPPORTS_SHA /DXED_SUPPORTS_WBNOINVD /DXED_DECODER /DXED_ENCODER /DXED_SUPPORTS_LZCNT_TZCNT /DXED_BUILD /c /Foobj/xed-reg-enum.obj D:/Development/intelxed/xed/Build64/obj/xed-reg-enum.c
[EXIT_STATUS ] 399
[STDERR]

COMMAND ENCOUNTERD AN EXCEPTION
Traceback (most recent call last):
  File "D:\Development\intelxed\xed\Build64\..\..\mbuild\mbuild\util.py", line 1043, in run
    self.sub = subprocess.Popen(cmd_args,
  File "C:\Program Files\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2]

It seems like the directory structure has changed and C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/bin/amd64/cl.exe does not exist anymore in this version.

I was able to find this executable here instead:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64

flobernd avatar Nov 29 '22 11:11 flobernd

Thanks. Can you please provide a build command?

marjevan avatar Nov 30 '22 07:11 marjevan

The build command was python ../mfile.py examples in this case. Executed from within a Build64 directory inside the xed folder.

The following is an example of what Visual Studio uses when compiling a project:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.34.31933\bin\HostX64\x64\CL.exe /c /ID:\Development\zyantific\zydis\dependencies\zycore\include /ID:\Development\zyantific\zydis\Build64\zycore /ID:\Development\zyantific\zydis\dependencies\zycore\src /Zi /nologo /W4 /WX /diagnostics:column /Od /Ob0 /GL /D _MBCS /D WIN32 /D _WINDOWS /D ZYCORE_STATIC_BUILD /D _CRT_SECURE_NO_WARNINGS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"Zycore.dir\Debug\\" /Fd"D:\Development\zyantific\zydis\Build64\zycore\Debug\Zycore.pdb" /external:W4 /Gd /TC /wd4201 /errorReport:prompt D:\Development\zyantific\zydis\dependencies\zycore\src\API\Memory.c D:\Development\zyantific\zydis\dependencies\zycore\src\API\Process.c D:\Development\zyantific\zydis\dependencies\zycore\src\API\Synchronization.c D:\Development\zyantific\zydis\dependencies\zycore\src\API\Terminal.c D:\Development\zyantific\zydis\dependencies\zycore\src\API\Thread.c D:\Development\zyantific\zydis\dependencies\zycore\src\Allocator.c D:\Development\zyantific\zydis\dependencies\zycore\src\ArgParse.c D:\Development\zyantific\zydis\dependencies\zycore\src\Bitset.c D:\Development\zyantific\zydis\dependencies\zycore\src\Format.c D:\Development\zyantific\zydis\dependencies\zycore\src\List.c D:\Development\zyantific\zydis\dependencies\zycore\src\String.c D:\Development\zyantific\zydis\dependencies\zycore\src\Vector.c D:\Development\zyantific\zydis\dependencies\zycore\src\Zycore.c

flobernd avatar Nov 30 '22 09:11 flobernd

Hi, Do you still encounter this issue?

marjevan avatar Mar 25 '24 11:03 marjevan

@marjevan Yes, after pulling the latest mbuild and xed heads, the build still outputs:

[MBUILD WARNING] Command execution failed. Waiting for remaining jobs and exiting.
R: 0 P: 114 C: 4 E: 4 / 80 msecs
[COMMAND     ] "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/bin/amd64/cl.exe" -I../include/private -I../include/public/xed -I../include/public -Iobj -Iobj/include-private     /nologo  /MT  /favor:EM64T  /W4 /WX /wd4091 /wd4127 /wd4505 /wd4702 /wd4244 /wd4292 /DXED_VERSION="v2024.02.22" /DXED_AMD_ENABLED /DXED_VIA_ENABLED /DXED_AVX /DXED_SUPPORTS_AVX512 /DXED_MPX /DXED_CET /DXED_APX /DXED_SUPPORTS_SHA /DXED_SUPPORTS_WBNOINVD /DXED_DECODER /DXED_ENCODER /DXED_SUPPORTS_LZCNT_TZCNT /DXED_BUILD /c /Foobj/xed-address-width-enum.obj D:/Development/intelxed/xed/Build64/obj/xed-address-width-enum.c
[EXIT_STATUS ] 399
[STDERR]

COMMAND ENCOUNTERD AN EXCEPTION
Traceback (most recent call last):
  File "D:\Development\intelxed\xed\Build64\..\..\mbuild\mbuild\util.py", line 1043, in run
    self.sub = subprocess.Popen(cmd_args,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\subprocess.py", line 1022, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\Python311\Lib\subprocess.py", line 1491, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The following file does not exist for me:

C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/bin/amd64/cl.exe

It's instead located at:

C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.39.33519\bin\{Hostx86|Hostx64}\{x86|x64}

So depending on 86 vs 64 there are 4 versions in total. I copied the Hostx64\x64 directory to C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/bin/amd64 in order to do a successful build.

flobernd avatar Mar 25 '24 12:03 flobernd