microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
23.17k stars 6.38k forks source link

`vcpkg install` quits immediately after printing Computing installation plan... #18718

Closed wangqr closed 3 years ago

wangqr commented 3 years ago

Describe the bug vcpkg install quits immediately after printing Computing installation plan.... No package is actually built or installed. It does create 2 empty folders, installed\vcpkg\info and installed\vcpkg\updates.

Environment

To Reproduce Steps to reproduce the behavior:

  1. Run .\vcpkg.exe install <any package>
  2. vcpkg prints Computing installation plan... and quit
    
    PS C:\> git clone https://github.com/microsoft/vcpkg.git
    Cloning into 'vcpkg'...
    remote: Enumerating objects: 113520, done.
    remote: Counting objects: 100% (201/201), done.
    remote: Compressing objects: 100% (117/117), done.
    remote: Total 113520 (delta 105), reused 149 (delta 84), pack-reused 113319
    Receiving objects: 100% (113520/113520), 34.94 MiB | 1.46 MiB/s, done.
    Resolving deltas: 100% (71679/71679), done.
    Updating files: 100% (7804/7804), done.
    PS C:\> cd vcpkg
    PS C:\vcpkg>.\bootstrap-vcpkg.bat -disableMetrics
    Downloading https://github.com/microsoft/vcpkg-tool/releases/download/2021-06-19/vcpkg.exe -> C:\vcpkg\vcpkg.exe
    Done.

PS C:\vcpkg> .\vcpkg.exe install icu --triplet=x64-windows Computing installation plan... PS C:\vcpkg> .\vcpkg.exe update Using local portfile versions. To update the local portfiles, use git pull. No packages need updating. PS C:\vcpkg> .\vcpkg.exe install icu --triplet=x64-windows Computing installation plan... PS C:\vcpkg> .\vcpkg.exe install icu Computing installation plan... PS C:\vcpkg> .\vcpkg.exe install boost Computing installation plan... PS C:\vcpkg> .\vcpkg.exe install --dry-run icu Computing installation plan... PS C:\vcpkg>



**Expected behavior**
vcpkg actually installs the package

**Failure logs** 
I'm not sure how to get failure log. There is no newly created file after running `vcpkg install` in vcpkg's directory.
strega-nil-ms commented 3 years ago

@wangqr could you try running .\vcpkg install icu --debug?

wangqr commented 3 years ago
PS C:\vcpkg> .\vcpkg install icu --debug
[DEBUG] Feature flag 'binarycaching' unset
[DEBUG] Feature flag 'manifests' unset
[DEBUG] Feature flag 'compilertracking' unset
[DEBUG] Feature flag 'registries' unset
[DEBUG] Feature flag 'versions' unset
[DEBUG] BuiltinRegistry initialized with: ""
[DEBUG] Using vcpkg-root: C:\vcpkg
[DEBUG] Using installed-root: C:\vcpkg\installed
[DEBUG] BuiltinRegistry initialized with: ""
[DEBUG] Using buildtrees-root: C:\vcpkg\buildtrees
[DEBUG] Using downloads-root: C:\vcpkg\downloads
[DEBUG] Using packages-root: C:\vcpkg\packages
[DEBUG] Using scripts-root: C:\vcpkg\scripts
[DEBUG] Using ports-root: C:\vcpkg\ports
[DEBUG] Using versions-root: C:\vcpkg\versions
[DEBUG] Default binary cache path is: C:\Users\wangqr\AppData\Local\vcpkg\archives
Computing installation plan...
[DEBUG] CreateProcessW("C:\Program Files\CMake\bin\cmake.exe" --version)
[DEBUG] cmd_execute_and_stream_data() returned 0 after    23367 us
[DEBUG] CreateProcessW("C:\Program Files\CMake\bin\cmake.exe" -DVCPKG_ROOT_DIR=C:/vcpkg -DPACKAGES_DIR=C:/vcpkg/packages -DBUILDTREES_DIR=C:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=C:/vcpkg/installed -DDOWNLOADS=C:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\vcpkg\buildtrees\0.vcpkg_tags.cmake")
[DEBUG] cmd_execute_and_stream_data() returned 0 after    24837 us
wangqr commented 3 years ago

Here's the output if I run the last 2 commands directly:

PS C:\vcpkg> & "C:\Program Files\CMake\bin\cmake.exe" --version
cmake version 3.21.0-rc1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
PS C:\vcpkg> & "C:\Program Files\CMake\bin\cmake.exe" -DVCPKG_ROOT_DIR=C:/vcpkg -DPACKAGES_DIR=C:/vcpkg/packages -DBUILDTREES_DIR=C:/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=C:/vcpkg/installed -DDOWNLOADS=C:/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\vcpkg\buildtrees\0.vcpkg_tags.cmake"
d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af
c35112b6-d1ba-415b-aa5d-81de856ef8eb
VCPKG_TARGET_ARCHITECTURE=x64
VCPKG_CMAKE_SYSTEM_NAME=
VCPKG_CMAKE_SYSTEM_VERSION=
VCPKG_PLATFORM_TOOLSET=
VCPKG_VISUAL_STUDIO_PATH=
VCPKG_CHAINLOAD_TOOLCHAIN_FILE=
VCPKG_BUILD_TYPE=
VCPKG_LIBRARY_LINKAGE=dynamic
VCPKG_CRT_LINKAGE=dynamic
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f
c35112b6-d1ba-415b-aa5d-81de856ef8eb
VCPKG_PUBLIC_ABI_OVERRIDE=
VCPKG_ENV_PASSTHROUGH=
VCPKG_ENV_PASSTHROUGH_UNTRACKED=
VCPKG_LOAD_VCVARS_ENV=
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f
8c504940-be29-4cba-9f8f-6cd83e9d87b7
d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af
c35112b6-d1ba-415b-aa5d-81de856ef8eb
VCPKG_TARGET_ARCHITECTURE=x86
VCPKG_CMAKE_SYSTEM_NAME=
VCPKG_CMAKE_SYSTEM_VERSION=
VCPKG_PLATFORM_TOOLSET=
VCPKG_VISUAL_STUDIO_PATH=
VCPKG_CHAINLOAD_TOOLCHAIN_FILE=
VCPKG_BUILD_TYPE=
VCPKG_LIBRARY_LINKAGE=dynamic
VCPKG_CRT_LINKAGE=dynamic
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f
c35112b6-d1ba-415b-aa5d-81de856ef8eb
VCPKG_PUBLIC_ABI_OVERRIDE=
VCPKG_ENV_PASSTHROUGH=
VCPKG_ENV_PASSTHROUGH_UNTRACKED=
VCPKG_LOAD_VCVARS_ENV=
e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f
8c504940-be29-4cba-9f8f-6cd83e9d87b7

Uninstalling CMake can resolve this issue.

dg0yt commented 3 years ago

An issue with CMake 3.21.0-rc1, cf. #18636.

sidd-kishan commented 3 years ago

Same issues with libusb and libusb-win32 :-

`Microsoft Windows [Version 10.0.17134.1304] (c) 2018 Microsoft Corporation. All rights reserved.

C:\Windows\system32>vcpkg install libusb --debug [DEBUG] Feature flag 'binarycaching' unset [DEBUG] Feature flag 'manifests' unset [DEBUG] Feature flag 'compilertracking' unset [DEBUG] Feature flag 'registries' unset [DEBUG] Feature flag 'versions' unset [DEBUG] BuiltinRegistry initialized with: "" [DEBUG] Using vcpkg-root: C:\Program Files (Arm)\vcpkg [DEBUG] Using installed-root: C:\Program Files (Arm)\vcpkg\installed [DEBUG] BuiltinRegistry initialized with: "" [DEBUG] Using buildtrees-root: C:\Program Files (Arm)\vcpkg\buildtrees [DEBUG] Using downloads-root: C:\Program Files (Arm)\vcpkg\downloads [DEBUG] Using packages-root: C:\Program Files (Arm)\vcpkg\packages [DEBUG] Using scripts-root: C:\Program Files (Arm)\vcpkg\scripts [DEBUG] Using ports-root: C:\Program Files (Arm)\vcpkg\ports [DEBUG] Using versions-root: C:\Program Files (Arm)\vcpkg\versions [DEBUG] Default binary cache path is: C:\Users\Marcin\AppData\Local\vcpkg\archives Computing installation plan... [DEBUG] Found path: C:\Program Files (x86)\CMake\bin\cmake.exe [DEBUG] CreateProcessW("C:\Program Files (x86)\CMake\bin\cmake.exe" --version) [DEBUG] cmd_execute_and_stream_data() returned 0 after 2346723 us [DEBUG] CreateProcessW("C:\Program Files (x86)\CMake\bin\cmake.exe" "-DVCPKG_ROOT_DIR=C:/Program Files (Arm)/vcpkg" "-DPACKAGES_DIR=C:/Program Files (Arm)/vcpkg/packages" "-DBUILDTREES_DIR=C:/Program Files (Arm)/vcpkg/buildtrees" "-D_VCPKG_INSTALLED_DIR=C:/Program Files (Arm)/vcpkg/installed" "-DDOWNLOADS=C:/Program Files (Arm)/vcpkg/downloads" -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\Program Files (Arm)\vcpkg\buildtrees\0.vcpkg_tags.cmake") [DEBUG] cmd_execute_and_stream_data() returned 0 after 1919234 us

C:\Windows\system32>cmake --version cmake version 3.21.0-rc1

CMake suite maintained and supported by Kitware (kitware.com/cmake).

C:\Windows\system32> C:\Windows\system32>"C:\Program Files (x86)\CMake\bin\cmake.exe" "-DVCPKG_ROOT_DIR=C:/Program Files (Arm)/vcpkg" "-DPACKAGES_DIR=C:/Program Files (Arm)/vcpkg/packages" "-DBUILDTREES_DIR=C:/Program Files (Arm)/vcpkg/buildtrees" "-D_VCPKG_INSTALLED_DIR=C:/Program Files (Arm)/vcpkg/installed" "-DDOWNLOADS=C:/Program Files (Arm)/vcpkg/downloads" -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\Program Files (Arm)\vcpkg\buildtrees\0.vcpkg_tags.cmake" d8187afd-ea4a-4fc3-9aa4-a6782e1ed9af c35112b6-d1ba-415b-aa5d-81de856ef8eb VCPKG_TARGET_ARCHITECTURE=x86 VCPKG_CMAKE_SYSTEM_NAME= VCPKG_CMAKE_SYSTEM_VERSION= VCPKG_PLATFORM_TOOLSET= VCPKG_VISUAL_STUDIO_PATH= VCPKG_CHAINLOAD_TOOLCHAIN_FILE= VCPKG_BUILD_TYPE= VCPKG_LIBRARY_LINKAGE=dynamic VCPKG_CRT_LINKAGE=dynamic e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f c35112b6-d1ba-415b-aa5d-81de856ef8eb VCPKG_PUBLIC_ABI_OVERRIDE= VCPKG_ENV_PASSTHROUGH= VCPKG_ENV_PASSTHROUGH_UNTRACKED= VCPKG_LOAD_VCVARS_ENV= e1e74b5c-18cb-4474-a6bd-5c1c8bc81f3f 8c504940-be29-4cba-9f8f-6cd83e9d87b7

C:\Windows\system32>`

dg0yt commented 3 years ago

Same issues with libusb and libusb-win32 :-

And still the same version of cmake, which is only a release candidate.

C:\Windows\system32>cmake --version cmake version 3.21.0-rc1

sidd-kishan commented 3 years ago

Raised an issue at https://gitlab.kitware.com/cmake/cmake/-/issues/22367 if Kitware may take notice we will have CMAKE Windows on ARM64 binaries. 🤞

dg0yt commented 3 years ago

The original post here is for x64-windows.

JonLiu1993 commented 3 years ago

An issue with CMake 3.21.0-rc1, cf. #18636.

@wangqr , @sidd-kishan .Duplicate of #18636

tommyvct commented 3 years ago

Same issue here. I was trying the ARM64EC toolchain and I need vcpkg to work.

It's tedious that I need to reinstall an older version of cmake every time I need to use vcpkg.

I created an issue on Kitware's CMake repo: https://gitlab.kitware.com/cmake/cmake/-/issues/22371

MatthewPowley commented 3 years ago

I have also seen this issue and traced it to a regression in CMake 3.21.0-rc1. When running the command line similar to that show below: "C:\Program Files\CMake\bin\cmake.exe" -DVCPKG_ROOT_DIR=C:/Git/vcpkg -DPACKAGES_DIR=C:/Git/vcpkg/packages -DBUILDTREES_DIR=C:/Git/vcpkg/buildtrees -D_VCPKG_INSTALLED_DIR=C:/Git/vcpkg/installed -DDOWNLOADS=C:/Git/vcpkg/downloads -DVCPKG_MANIFEST_INSTALL=OFF -P "C:\Git\vcpkg\buildtrees\0.vcpkg_dep_info.cmake"

You get what appears to be the same output from CMake 3.20.5 but in reality some of the lines are delimited with '\r\n' and others '\n'. This causes an issue when the returned lines are split on each '\n' and then the searching function fails to find the inserted UUIDs delimiting the output for parsing.

I will create a pull request with a fix and let the powers that be decide whether to try and ask Kitware to fix their regression or make VcPkg tolerant of line endings.

wangqr commented 3 years ago

You get [...] some of the lines are delimited with '\r\n' and others '\n'.

Git bisect shows Kitware/CMake@0a0a0f8a744e2bfa35cdbc90db6e4e23adadd59b introduced this the behavior, changing line breaks within a message from '\n' (old) to '\r\n' (new), and the auto-appended '\n' is not changed.

MatthewPowley commented 3 years ago

I have created a pull request for the VcPkg tool here: https://github.com/microsoft/vcpkg-tool/pull/107

tan-wei commented 3 years ago

Met the same issue when update CMake to 3.21.0

strega-nil-ms commented 3 years ago

This should be fixed by #18983 ; can you try updating your git repository and re-bootstrap?

orgads commented 3 years ago

Do you plan to publish a new release with this fix soon?