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
To Reproduce
Steps to reproduce the behavior:
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
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
Most helpful comment
A workaround is to change
https://github.com/microsoft/vcpkg/blob/1b1c17de8206231831b2bc8a06cff80506184be1/scripts/buildsystems/vcpkg.cmake#L402
to