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

'_VCPKG_PWSH_PATH-NOTFOUND' is not recognized as an internal or external command #14283

Closed
jaryder opened this issue Oct 28, 2020 · 13 comments · Fixed by #14317 or Jimmy-Hu/vcpkg#390
Closed
Assignees
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)

Comments

@jaryder
Copy link

jaryder commented Oct 28, 2020

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 (ead8d6b)
  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

@BillyONeal
Copy link
Member

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

@Domacles
Copy link

Really useful, Thanks.

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

@nil-is-lin
Copy link

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

@LilyWangL LilyWangL self-assigned this Oct 29, 2020
@swq123459
Copy link

我也出现了该问题,最新的版本

@lone-wolf-akela
Copy link

A workaround is to change

if (_VCPKG_PWSH_PATH-NOTFOUND)

to

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

@JackBoosY JackBoosY added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Oct 29, 2020
@JackBoosY JackBoosY self-assigned this Oct 29, 2020
@BillyONeal
Copy link
Member

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

@DuffsDevice
Copy link

Thanks alot @BillyONeal!

@Christsnatcher
Copy link

Christsnatcher commented Nov 1, 2020

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.

@EricHripko
Copy link
Contributor

As a workaround, reverting to c34c418 seems to have fixed it for me in the meantime 👍

@unfor19
Copy link

unfor19 commented Nov 1, 2020

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

BillyONeal added a commit that referenced this issue Nov 2, 2020
* Fix incorrect determination of PowerShell not found because Bill doesn't know enough CMake :(

Resolves #14283
@fferri
Copy link

fferri commented Nov 17, 2020

Installing powershell-core fixed the issue for me.

@fferri
Copy link

fferri commented Nov 17, 2020

A workaround is to change

if (_VCPKG_PWSH_PATH-NOTFOUND)

to

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

No.

if(_VCPKG_PWSH_PATH) / if(NOT _VCPKG_PWSH_PATH) should be enough.

From the CMake if documentation:

if(<constant>)

True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, the empty string, or ends in the suffix -NOTFOUND. Named boolean constants are case-insensitive. If the argument is not one of these specific constants, it is treated as a variable or string and the following signature is used.

@JackBoosY
Copy link
Contributor

@fferri #14317 should fixed this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`)
Projects
None yet