You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Build fails with error MSB6006: "cmd.exe" exited with code 1 when building the msix-packaging project in VSCode with specific CMake settings.
To Reproduce
Steps to reproduce the behavior:
Clone the master branch of the msix-packaging repository.
Open the cloned repository in VSCode with the following extensions installed: C/C++, C/C++ Extension Pack, C/C++ Themes, CMake, CMake Tools.
Press Ctrl+Shift+P, enter 'Settings' to search click "CMake: Open CMake Tools Extension Settings", and add -DWIN32=on under Cmake: Configure Args
Modify ProjectRoot/CMakeSettings.json for x64-Debug and x64-Release to include "cmakeCommandArgs": "-DWIN32=ON -DCMAKE_BUILD_TYPE=DMSIX_PACK=on".
Run the VSCode command CMake: Configure using the kit "Visual Studio Enterprise 2017 Release - amd64".
Open src/makemsix/main.cpp.
Run the command CMake: Build.
Expected behavior
The project should build successfully without any errors.
Screenshots
N/A
Platform
Operating System: Windows 10 Enterprise
Compiler: Microsoft Visual Studio 2017 Enterprise
VSCode Version: 1.87.1
MSIX SDK Version: Latest master branch build as of 3/7/2024
Additional context
The error occurs using VSCode and not when running makewin.cmd.
This commit fixes the issue where the incorrect path was used for copying the msix.dll file in the CMakeLists.txt files for samples and msixtest. The updated path correctly considers the build configuration (Release/Debug) when copying the file.
This resolves the build error reported in issue microsoft#620.
- In sample/CMakeLists.txt, the copy command now uses ${MSIX_BINARY_ROOT}/bin/${CMAKE_CFG_INTDIR}/msix.dll as the source path.
- In src/test/msixtest/CMakeLists.txt, the copy command now uses ${MSIX_BINARY_ROOT}/bin/${CMAKE_CFG_INTDIR}/msix.dll as the source path and ${MSIX_TEST_OUTPUT_DIRECTORY}/msixtest/msix.dll as the destination path.
The makewin.cmd is confirmed to work as before. Now builds from VSCode also build without an error using MSVC 15.
Fixesmicrosoft#620
st-gr
linked a pull request
Mar 9, 2024
that will
close
this issue
Project
MSIX SDK
Describe the bug
Build fails with error MSB6006: "cmd.exe" exited with code 1 when building the msix-packaging project in VSCode with specific CMake settings.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The project should build successfully without any errors.
Screenshots
N/A
Platform
Additional context
The error occurs using VSCode and not when running makewin.cmd.
The build error output is as follows:
[build] [build] "C:\Users\MyUser\Documents\msix-packaging\build\ALL_BUILD.vcxproj" (default target) (1) -> [build] "C:\Users\MyUser\Documents\msix-packaging\build\sample\samples.vcxproj" (default target) (13) -> [build] (CustomBuild target) -> [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(209,5): error MSB6006: "cmd.exe" exited with code 1. [C:\Users\MyUser\Documents\msix-packaging\build\sample\samples.vcxproj] [build] [build] [build] "C:\Users\MyUser\Documents\msix-packaging\build\ALL_BUILD.vcxproj" (default target) (1) -> [build] "C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj" (default target) (12) -> [build] (PostBuildEvent target) -> [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: The command "setlocal [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: cd C:\Users\MyUser\Documents\msix-packaging\build [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: C: [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E copy bin/msix.dll msixtest/msix.dll [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmEnd [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmErrorLevel [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: exit /b %1 [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :cmDone [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :VCEnd" exited with code 1. [C:\Users\MyUser\Documents\msix-packaging\build\src\test\msixtest\msixtest.vcxproj] [build] [build] 10 Warning(s) [build] 2 Error(s) [build] [build] Time Elapsed 00:01:27.87 [proc] The command: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build c:/Users/MyUser/Documents/msix-packaging/build --config Debug --target ALL_BUILD -- /maxcpucount:6 exited with code: 1 [driver] Build completed: 00:01:28.613 [build] Build finished with exit code 1
The text was updated successfully, but these errors were encountered: