Vcpkg: '_VCPKG_PWSH_PATH-NOTFOUND' is not recognized as an internal or external command

Created on 28 Oct 2020  路  10Comments  路  Source: microsoft/vcpkg

Describe the bug
CMake on Windows fails its C-Compiler test due to:
'_VCPKG_PWSH_PATH-NOTFOUND' is not recognized as an internal or external command

Environment

  • OS: Windows
  • Compiler: MSVC 19.27.29112.0

To Reproduce
Steps to reproduce the behavior:

  1. update submodule vcpkg to latest (ead8d6bad477f0b075f31097673c3e440356cd3b)
  2. Build top-level project using cmake on Windows

Expected behavior
The build to succeed.

Failure logs
Attached
vcpkg_cmake_failure_logs.txt

Additional context
Possibly related to changes in vcpkg/scripts/buildsystems/vcpkg.cmake with the introduction of _VCPKG_PWSH_PATH-NOTFOUND.
@BillyONeal

vcpkg-bug

Most helpful comment

A workaround is to change
https://github.com/microsoft/vcpkg/blob/1b1c17de8206231831b2bc8a06cff80506184be1/scripts/buildsystems/vcpkg.cmake#L402
to

if (${_VCPKG_PWSH_PATH} STREQUAL "_VCPKG_PWSH_PATH-NOTFOUND")

All 10 comments

As a workaround you should be able to install powershell-core https://github.com/PowerShell/PowerShell/releases/tag/v7.0.3

Really useful, Thanks.

As a workaround you should be able to install powershell-core https://github.com/PowerShell/PowerShell/releases/tag/v7.0.3

I meet this problem sometimes. It happened suddenly. If I try a few more times, maybe one of them can run.

鎴戜篃鍑虹幇浜嗚闂锛屾渶鏂扮殑鐗堟湰

A workaround is to change
https://github.com/microsoft/vcpkg/blob/1b1c17de8206231831b2bc8a06cff80506184be1/scripts/buildsystems/vcpkg.cmake#L402
to

if (${_VCPKG_PWSH_PATH} STREQUAL "_VCPKG_PWSH_PATH-NOTFOUND")

@lone-wolf-akela Yes, the fix will look something like that, should have a fix out for review sometime tomorrow at the latest

Thanks alot @BillyONeal!

Just wanted to mention that I ran into the very same issue after updatiing both VS 2019 and vcpkg to the latest version. Thanks in advance for fixing it!

--edit--

Really useful, Thanks.

As a workaround you should be able to install powershell-core https://github.com/PowerShell/PowerShell/releases/tag/v7.0.3

I just noticed that vcpkg has right this program in its own tools folder (for me "D:\Code\Repos\vcpkg\downloads\tools\powershell-core-7.0.3-windows"), but apparently isn't able to find it.

As a workaround, reverting to https://github.com/microsoft/vcpkg/commit/c34c4189ebbf0795e1f8e2de562c527a854c8db4 seems to have fixed it for me in the meantime 馃憤

We were using the master version, seems like setting it to the latest release fixes it

git clone https://github.com/microsoft/vcpkg --branch 2020.07
Was this page helpful?
0 / 5 - 0 ratings

Related issues

grandprixgp picture grandprixgp  路  3Comments

cskrisz picture cskrisz  路  3Comments

ghost picture ghost  路  3Comments

pakdel picture pakdel  路  3Comments

oahzuw picture oahzuw  路  3Comments