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

[portaudio:x64-windows] build failure (detect_compiler failed) #16448

Closed
ultrasound1372 opened this issue Feb 27, 2021 · 21 comments
Closed

[portaudio:x64-windows] build failure (detect_compiler failed) #16448

ultrasound1372 opened this issue Feb 27, 2021 · 21 comments
Assignees
Labels
category:question This issue is a question

Comments

@ultrasound1372
Copy link

Host Environment

  • OS: Windows 10 20H2 (64-bit) build 19042.844
  • Compiler: MSVC latest

To Reproduce
Steps to reproduce the behavior:
./vcpkg install portaudio:x64-windows

Failure logs
Computing installation plan...
The following packages will be built and installed:
portaudio[core]:x64-windows -> 2020-02-20
Detecting compiler hash for triplet x64-windows...
Error: while detecting compiler information:
The log content at C:\tools\vcpkg\buildtrees\detect_compiler\stdout-x64-windows.log is:
CMake Error at C:/tools/vcpkg/scripts/ports.cmake:46 (message):
Cannot find port:

Directory does not exist: C;/tools/vcpkg/scripts/detect_compiler

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

Additional context
I have made sure that everything is up to date via git pull and vcpkg update, it was during vcpkg update that I started seeing this error actually. Given the nature of the error, I would think this is more than just portaudio, but since I got it trying to build portaudio, I've noted it as such. I also tried a fresh git clone and install from scratch, same thing. The obvious bit to me is that there is a semicolon instead of a colon for the drive letter somehow, causing an invalid directory. I don't know enough about CMake to know what could have caused that error, because I don't know where that ports script is getting the directory from.
stdout-x64-windows.log

@ultrasound1372 ultrasound1372 changed the title [portaudio:x64-windows] build failure because the compiler can't find itself [portaudio:x64-windows] build failure (detect_compiler failed) Feb 27, 2021
@NancyLi1013
Copy link
Contributor

Hi @ultrasound1372

Thanks for posting this issue.

It seems that the path is incorrect here.

CMake Error at C:/tools/vcpkg/scripts/ports.cmake:46 (message):
  Cannot find port:

    Directory does not exist: C;/tools/vcpkg/scripts/detect_compiler

It seems that you used CMD to install the ports, could you please use PowerShell to try it again?

@NancyLi1013 NancyLi1013 added the category:question This issue is a question label Mar 1, 2021
@ultrasound1372
Copy link
Author

ultrasound1372 commented Mar 1, 2021

Attempted to do it from powershell with .\vcpkg install portaudio:x64-windows, same result. I have no idea how this happened, as I did a complete re-clone and started fresh and it still did this. Note I am a complete newb at powershell, was that not the command I was supposed to use?

@NancyLi1013
Copy link
Contributor

Could you please try to use git pull to update vcpkg to the latest version and run .\bootstrap-vcpkg.bat, then rebuild this? @ultrasound1372

@ultrasound1372
Copy link
Author

Same error, only the line number is now 51. How did a semicolon start showing up in that anyway? And I suppose I should rename this, this occurs with more than just portaudio, somebody recommended I try with sqlite3 and same result. @NancyLi1013

@NancyLi1013
Copy link
Contributor

The error info from here:

if(NOT EXISTS "${CURRENT_PORT_DIR}")
    message(FATAL_ERROR "Cannot find port: ${PORT}\n  Directory does not exist: ${CURRENT_PORT_DIR}")
endif()

https://github.com/microsoft/vcpkg/blob/master/scripts/ports.cmake#L50-L52

Seems there are something wrong with ${CURRENT_PORT_DIR}.

Could you please print the value of ${CURRENT_PORT_DIR}?

@ultrasound1372
Copy link
Author

Where is that variable coming from and how do I get it to print?

@NancyLi1013
Copy link
Contributor

You can add message("CURRENT_PORT_DIR:${CURRENT_PORT_DIR}") before these codes and then rerun ./vcpkg install portaudio:x64-windows.

if(NOT EXISTS "${CURRENT_PORT_DIR}")
    message(FATAL_ERROR "Cannot find port: ${PORT}\n  Directory does not exist: ${CURRENT_PORT_DIR}")
endif()

@ultrasound1372
Copy link
Author

As it says in the error message.
CURRENT_PORT_DIR:C;/tools/vcpkg/scripts/detect_compiler
I don't know how the semicolon ended up in the path but I'm sure that's the problem. Is nobody else getting this?

@NancyLi1013
Copy link
Contributor

@ultrasound1372

Are there any spaces in the path?

@ultrasound1372
Copy link
Author

No, other than the semicolon the path is as it is supposed to be, C:\tools\vcpkg. My system is using cp1252 for character encoding but the file system is Unicode anyway. Again, is no one else receiving this? It just started happening on my system out of the blue and no amount of updates or redownloads fixed it.

@NancyLi1013
Copy link
Contributor

Could you please try to update your system as Unicode encoding and rebuild again?

@ultrasound1372
Copy link
Author

How do I do that without breaking legacy apps that need to use ANSI? Shouldn't this program be using Unicode anyway?

@NancyLi1013
Copy link
Contributor

Currently, the only way I have known is to change the system local.

You can tick a "Use Unicode UTF-8 for worldwide language support", box in "Region & Language" - "Administrative" - "Change system locale" - "Region Settings".

Please see the details here #12865 (comment)

@ultrasound1372
Copy link
Author

This did not fix it, still a semicolon in the path that fails to resolve. Fresh clone from UTF-8, cp 65001.

@ultrasound1372
Copy link
Author

@NancyLi1013 here's a debug log that I got from it while trying to do that install again. This is also occurring in #17188. I suppose that is a better issue to track this?
vcpkg_failure.log

@ultrasound1372
Copy link
Author

ultrasound1372 commented Apr 10, 2021

Looking at that log, it might actually be a bug in the cmake that comes with msys2. Is there a way for me to make it use the cmake that I have installed without reordering my entire path?
Edit: It was, in fact, a bug in the cmake that you can get with msys2's pacman. I uninstalled it and it built fine. So I suppose that's a bug to submit to the maintainers of cmake for msys2, vcpkg doesn't call the mingw version which I've read doesn't have that problem. So now my question is is there a way to make it use the mingw prefixed filenames and build everything with mingw that I have inside msys2?

@dg0yt
Copy link
Contributor

dg0yt commented Apr 11, 2021

From the log:

[DEBUG] CreateProcessW("C:\msys64\usr\bin\cmake.exe"

This is cmake for the msys2 subsystem. But you need to use a mingw subsystem (mingw64 or mingw32). Then cmake will be taken from "C:\msys64\mingw64\bin\cmake.exe".
For more information on the subsystems: https://www.msys2.org/wiki/MSYS2-introduction/

@dg0yt
Copy link
Contributor

dg0yt commented Apr 11, 2021

(And for subtle changes to process arguments and environment variables: https://www.msys2.org/docs/filesystem-paths/#automatic-unix-windows-path-conversion)

@NancyLi1013
Copy link
Contributor

Sorry for the long delay. Thanks for your investigation.

Form the above vcpkg_failure.log:

There are two cmake executable found on your machine.

[DEBUG] Found path: C:\msys64\usr\bin\cmake.exe
[DEBUG] Found path: C:\Program Files\CMake\bin\cmake.exe

Could you please try to disable cmake in C:\msys64\usr\bin\cmake.exe to rebuild this? @ultrasound1372

@ultrasound1372
Copy link
Author

@NancyLi1013 I tried that and it was indeed the problem, it was a bug inside the cmake that you can get with msys2's pacman. I installed mingw-w64-x86_64-cmake and put msys64/mingw64/bin before msys64/usr/bin in my path and it worked fine. So that's the solution to this bug, a non-mingw cmake was being called on an emulated unix-like.

@dg0yt
Copy link
Contributor

dg0yt commented Apr 12, 2021

it was a bug inside the cmake that you can get with msys2's pacman

I don't think it is a bug, and probably it cannot be attributed to cmake at all. You were using cmake from which belongs to the msys subsystem. This won't play well with Windows programs like vcpkg. However, maybe the required packages were missing. For the mingw subsystem, there are individual cmake packages. Please have a look if this is clear enough from mingw.md in #17219.

And I wonder if vcpkg could catch the unsuitable cmake more clearly, hooking in on the presented error pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:question This issue is a question
Projects
None yet
Development

No branches or pull requests

3 participants