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

[BUG] Build Error on Windows 10 with Visual Studio 2017 Enterprise #620

Open
st-gr opened this issue Mar 8, 2024 · 0 comments · May be fixed by #621
Open

[BUG] Build Error on Windows 10 with Visual Studio 2017 Enterprise #620

st-gr opened this issue Mar 8, 2024 · 0 comments · May be fixed by #621
Labels
Needs-Triage Issue needs to be triaged by a member of the core team

Comments

@st-gr
Copy link
Contributor

st-gr commented Mar 8, 2024

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:

  1. Clone the master branch of the msix-packaging repository.
  2. Open the cloned repository in VSCode with the following extensions installed: C/C++, C/C++ Extension Pack, C/C++ Themes, CMake, CMake Tools.
  3. Press Ctrl+Shift+P, enter 'Settings' to search click "CMake: Open CMake Tools Extension Settings", and add -DWIN32=on under Cmake: Configure Args
  4. Modify ProjectRoot/CMakeSettings.json for x64-Debug and x64-Release to include "cmakeCommandArgs": "-DWIN32=ON -DCMAKE_BUILD_TYPE=DMSIX_PACK=on".
  5. Run the VSCode command CMake: Configure using the kit "Visual Studio Enterprise 2017 Release - amd64".
  6. Open src/makemsix/main.cpp.
  7. 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.

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

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Triage Issue needs to be triaged by a member of the core team label Mar 8, 2024
st-gr pushed a commit to st-gr/msix-packaging that referenced this issue Mar 9, 2024
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.

Fixes microsoft#620
@st-gr st-gr linked a pull request Mar 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Triage Issue needs to be triaged by a member of the core team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant