microsoft / vcpkg

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

error: vcpkg was unable to detect the active compiler's information #34924

Open kschulz-0001 opened 12 months ago

kschulz-0001 commented 12 months ago

Hi, I'm trying to build OpenXRSamples from here https://github.com/jherico/OpenXRSamples.git which seems to use vcpkg. I'm getting the following error:

CMake Error at scripts/ports.cmake:41 (message): Cannot find port: Directory does not exist: C:/.ezvcpkg/7d90f94da/scripts/detect_compiler

The mention directory indeed does not exist. I've installed

Microsoft Visual Studio Professional 2022 (64-bit) - Current Version 17.7.3

and usual cmake works fine.

Any ideas to solve the issue are highly appreciated. Thanks!

Cheney-W commented 11 months ago

Could you please provide a detailed set of steps to reproduce the issue? Start from when you open the cmd or PowerShell and walk me through every command you executed and any errors encountered.

kschulz-0001 commented 11 months ago

Could you please provide a detailed set of steps to reproduce the issue? Start from when you open the cmd or PowerShell and walk me through every command you executed and any errors encountered.

Hi Cheney-W, thanks for looking into my issue. Since it is not my code, I had to find time digging into it. Please find (the hopefully helpful) details below and thanks again for looking into it!

Prerequisites

  1. Edition Windows 11 Enterprise, Version 22H2, OS build 22621.2428, Experience Windows Feature Experience Pack 1000.22674.1000.0
  2. Microsoft Visual Studio Professional 2022 Version 17.7.6 VisualStudio.17.Release/17.7.6+34221.43
  3. cmake v3.27.1
  4. PowerShell (Windows Terminal Version: 1.18.2822.0)
  5. vcpkg package management program version 2023-07-19-814b7ec837b59f1c8778f72351c1dd7605983cd2

Steps to reproduce

  1. open PowerShell in some folder
  2. git clone https://github.com/jherico/OpenXRSamples.git
  3. cd OpenXRSamples
  4. git submodule update --init --recursive
  5. mkdir build;cd build
  6. cmake .. ---> unsuccessful

Error Log

-- EZVCPKG v0.1 starting up Website: https://github.com/jherico/ezvcpkg -- EZVCPKG_BASEDIR envrionment variable not found and basedir not set, using default /.ezvcpkg -- EZVCPKG using host vcpkg binary C:/usr/bin/vcpkg.exe -- EZVCPKG initializing commit: 7d90f94da repository: https://github.com/jherico/vcpkg.git local dir: /.ezvcpkg/7d90f94da -- EZVCPKG Bootstrapping -- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.37.1.windows.1") -- EZVCPKG Cloning repository Cloning into '/.ezvcpkg/7d90f94da'... Updating files: 100% (10142/10142), done. -- EZVCPKG Checking out commit 7d90f94da Note: switching to '7d90f94da'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 7d90f94da [openxr] disabling broken structure -- EZVCPKG Building/Verifying packages assimp;basisu;fmt;glad;glm;glfw3;imgui;openxr-loader;vulkan;magnum -- C:/usr/bin/vcpkg.exe --vcpkg-root /.ezvcpkg/7d90f94da install --triplet x64-windows CMake Error at cmake/ezvcpkg/ezvcpkg.cmake:155 (message): EZVCPKG vcpkg execute returned failure Computing installation plan...

The following packages will be built and installed:

  assimp:x64-windows -> 5.0.1
  basisu:x64-windows -> 1.11-4
* corrade[core,interconnect,pluginmanager,testsuite,utility]:x64-windows -> 2019.10-1
* egl-registry:x64-windows -> 2020-02-20
  fmt:x64-windows -> 6.2.1
  glad:x64-windows -> 0.1.33-1
  glfw3:x64-windows -> 3.3.2
  glm:x64-windows -> 0.9.9.8
  imgui:x64-windows -> 1.76-1
* lodepng:x64-windows -> 2020-03-15
  magnum[anyaudioimporter,anyimageconverter,anyimageimporter,anysceneimporter,audio,core,debugtools,gl,meshtools,primitives,scenegraph,sdl2application,shaders,text,texturetools,trade]:x64-windows -> 2019.10-2
* minizip:x64-windows -> 1.2.11-6
* openal-soft:x64-windows -> 1.20.1-1
* opengl-registry:x64-windows -> 2020-03-25
  openxr-loader:x64-windows -> 1.0.9
* rapidjson:x64-windows -> 2020-02-08
* sdl2:x64-windows -> 2.0.12-1
  vulkan:x64-windows -> 1.1.82.1-1
* zlib:x64-windows -> 1.2.11-6

Additional packages (*) will be modified to complete this operation.

Detecting compiler hash for triplet x64-windows...

A suitable version of powershell-core was not found (required v6.2.1) Downloading portable powershell-core 6.2.1...

Downloading powershell-core...

https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip->C:\.ezvcpkg\7d90f94da\downloads\PowerShell-6.2.1-win-x86.zip

Downloading https://github.com/PowerShell/PowerShell/releases/download/v6.2.1/PowerShell-6.2.1-win-x86.zip

Extracting powershell-core...

error: while detecting compiler information:

The log file content at "C:.ezvcpkg\7d90f94da\buildtrees\detect_compiler\stdout-x64-windows.log" is:

CMake Error at scripts/ports.cmake:41 (message):

Cannot find port:

  Directory does not exist: C:/.ezvcpkg/7d90f94da/scripts/detect_compiler

error: vcpkg was unable to detect the active compiler's information. See above for the CMake failure output.

Call Stack (most recent call first): cmake/ezvcpkg/ezvcpkg.cmake:234 (EZVCPKG_BUILD) cmake/ezvcpkg/ezvcpkg.cmake:248 (EZVCPKG_FETCH_IMPL) CMakeLists.txt:8 (ezvcpkg_fetch)

-- Configuring incomplete, errors occurred!

Analysis so far

message(STATUS "${EZVCPKG_EXE} --vcpkg-root ${EZVCPKG_DIR} install --triplet ${EZVCPKG_TRIPLET} ${_PACKAGE}")

Failing VCPKG call (as printed by the message I added above)

vcpkg.exe --vcpkg-root /.ezvcpkg/7d90f94da install --triplet x64-windows

github-actions[bot] commented 10 months ago

This is an automated message. Per our repo policy, stale issues get closed if there has been no activity in the past 28 days. The issue will be automatically closed in 14 days. If you wish to keep this issue open, please add a new comment.

Cheney-W commented 10 months ago

Stay active

twindan commented 4 months ago

Check your anti-virus. ESET was flagging CMakeCXXCompilerId.exe (which is generates as part of the CMake detection) as malicious. Virus total shows that 6 other AVs also treat it as suspicious: https://www.virustotal.com/gui/file/c6dc5ae45f3a68ec8c7dd55efda8633011aa0ca5100b1252b37c34f4a48ce1ec/detection

This the file gets deleted, it fails the detection process.