Host Environment
To Reproduce
Steps to reproduce the behavior:
./vcpkg install portaudio:x64-windows
Failure logs
E:\dev\github\vcpkg>vcpkg install portaudio:x64-windows
Computing installation plan...
The following packages will be built and installed:
portaudio[core]:x64-windows
Detecting compiler hash for triplet x64-windows...
Starting package 1/1: portaudio:x64-windows
Building package portaudio[core]:x64-windows...
Could not locate cached archive: C:\Users\steve\AppData\Local\vcpkg/archives\62\62a238c860c243549610a2c315a2236e814d78ec.zip
-- Using cached E:/dev/github/vcpkg/downloads/portaudio-c5d2c51bd6fe354d0ee1119ba932bfebd3ebfacc.tar.gz
-- Cleaning sources at E:/dev/github/vcpkg/buildtrees/portaudio/src/ebd3ebfacc-5ed52dac86.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source E:/dev/github/vcpkg/downloads/portaudio-c5d2c51bd6fe354d0ee1119ba932bfebd3ebfacc.tar.gz
-- Applying patch fix-library-can-not-be-found.patch
-- Applying patch fix-include.patch
-- Using source at E:/dev/github/vcpkg/buildtrees/portaudio/src/ebd3ebfacc-5ed52dac86.clean
-- Configuring x64-windows
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:72 (message):
Command failed: ninja -v
Working Directory: E:/dev/github/vcpkg/buildtrees/portaudio/x64-windows-rel/vcpkg-parallel-configure
Error code: 1
See logs for more information:
E:\dev\github\vcpkg\buildtrees\portaudio\config-x64-windows-out.log
Call Stack (most recent call first):
scripts/cmake/vcpkg_configure_cmake.cmake:300 (vcpkg_execute_required_process)
ports/portaudio/portfile.cmake:12 (vcpkg_configure_cmake)
scripts/ports.cmake:79 (include)
Error: Building package portaudio:x64-windows failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
Package: portaudio:x64-windows
Vcpkg version: 2020.06.15-nohash
Additionally, attach any relevant sections from the log files above.
[1/2] cmd /c "cd .. && "E:/dev/github/vcpkg/downloads/tools/cmake-3.17.2-windows/cmake-3.17.2-win32-x86/bin/cmake.exe" "E:/dev/github/vcpkg/buildtrees/portaudio/src/ebd3ebfacc-5ed52dac86.clean" "-DPA_USE_DS=ON" "-DPA_USE_WASAPI=ON" "-DPA_USE_WDMKS=ON" "-DPA_USE_WMME=ON" "-DPA_LIBNAME_ADD_SUFFIX=OFF" "-DCMAKE_MAKE_PROGRAM=E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=E:/dev/github/vcpkg" "-D_VCPKG_INSTALLED_DIR=E:/dev/github/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=E:/dev/github/vcpkg/packages/portaudio_x64-windows""
FAILED: ../CMakeCache.txt
cmd /c "cd .. && "E:/dev/github/vcpkg/downloads/tools/cmake-3.17.2-windows/cmake-3.17.2-win32-x86/bin/cmake.exe" "E:/dev/github/vcpkg/buildtrees/portaudio/src/ebd3ebfacc-5ed52dac86.clean" "-DPA_USE_DS=ON" "-DPA_USE_WASAPI=ON" "-DPA_USE_WDMKS=ON" "-DPA_USE_WMME=ON" "-DPA_LIBNAME_ADD_SUFFIX=OFF" "-DCMAKE_MAKE_PROGRAM=E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=E:/dev/github/vcpkg" "-D_VCPKG_INSTALLED_DIR=E:/dev/github/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=E:/dev/github/vcpkg/packages/portaudio_x64-windows""
-- The C compiler identification is MSVC 19.27.29111.0
-- The CXX compiler identification is MSVC 19.27.29111.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ASIOSDK: E:/dev/github/vcpkg/buildtrees/portaudio/src/asiosdk
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring done
-- Generating done
CMake Error:
Running
'E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe' '-C' 'E:/dev/github/vcpkg/buildtrees/portaudio/x64-windows-rel' '-t' 'cleandead'
failed with:
ninja: error: build.ninja:615: multiple rules generate portaudio.lib [-w dupbuild=err]
CMake Error:
Running
'E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe' '-C' 'E:/dev/github/vcpkg/buildtrees/portaudio/x64-windows-rel' '-t' 'recompact'
failed with:
ninja: error: build.ninja:615: multiple rules generate portaudio.lib [-w dupbuild=err]
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
CMake Generate step failed. Build files cannot be regenerated correctly.
[2/2] cmd /c "cd ../../x64-windows-dbg && "E:/dev/github/vcpkg/downloads/tools/cmake-3.17.2-windows/cmake-3.17.2-win32-x86/bin/cmake.exe" "E:/dev/github/vcpkg/buildtrees/portaudio/src/ebd3ebfacc-5ed52dac86.clean" "-DPA_USE_DS=ON" "-DPA_USE_WASAPI=ON" "-DPA_USE_WDMKS=ON" "-DPA_USE_WMME=ON" "-DPA_LIBNAME_ADD_SUFFIX=OFF" "-DCMAKE_MAKE_PROGRAM=E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=E:/dev/github/vcpkg" "-D_VCPKG_INSTALLED_DIR=E:/dev/github/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DPA_ENABLE_DEBUG_OUTPUT:BOOL=ON" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=E:/dev/github/vcpkg/packages/portaudio_x64-windows/debug""
FAILED: ../../x64-windows-dbg/CMakeCache.txt
cmd /c "cd ../../x64-windows-dbg && "E:/dev/github/vcpkg/downloads/tools/cmake-3.17.2-windows/cmake-3.17.2-win32-x86/bin/cmake.exe" "E:/dev/github/vcpkg/buildtrees/portaudio/src/ebd3ebfacc-5ed52dac86.clean" "-DPA_USE_DS=ON" "-DPA_USE_WASAPI=ON" "-DPA_USE_WDMKS=ON" "-DPA_USE_WMME=ON" "-DPA_LIBNAME_ADD_SUFFIX=OFF" "-DCMAKE_MAKE_PROGRAM=E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=x64-windows" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=E:/dev/github/vcpkg/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_TARGET_ARCHITECTURE=x64" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=E:/dev/github/vcpkg" "-D_VCPKG_INSTALLED_DIR=E:/dev/github/vcpkg/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-DPA_ENABLE_DEBUG_OUTPUT:BOOL=ON" "-G" "Ninja" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=E:/dev/github/vcpkg/packages/portaudio_x64-windows/debug""
-- The C compiler identification is MSVC 19.27.29111.0
-- The CXX compiler identification is MSVC 19.27.29111.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ASIOSDK: E:/dev/github/vcpkg/buildtrees/portaudio/src/asiosdk
-- Check if the system is big endian
-- Searching 16 bit integer
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of unsigned short
-- Check size of unsigned short - done
-- Searching 16 bit integer - Using unsigned short
-- Check if the system is big endian - little endian
-- Configuring done
-- Generating done
CMake Error:
Running
'E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe' '-C' 'E:/dev/github/vcpkg/buildtrees/portaudio/x64-windows-dbg' '-t' 'cleandead'
failed with:
ninja: error: build.ninja:615: multiple rules generate portaudio.lib [-w dupbuild=err]
CMake Error:
Running
'E:/dev/github/vcpkg/downloads/tools/ninja/1.10.0-windows/ninja.exe' '-C' 'E:/dev/github/vcpkg/buildtrees/portaudio/x64-windows-dbg' '-t' 'recompact'
failed with:
ninja: error: build.ninja:615: multiple rules generate portaudio.lib [-w dupbuild=err]
CMake Warning:
Manually-specified variables were not used by the project:
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_LIBDIR
CMake Generate step failed. Build files cannot be regenerated correctly.
ninja: build stopped: subcommand failed.
Additional context
This started failing about 6-7 days ago. Has been reproduced on multiple machines since. Not really sure why it's failing. Looks like an internal ninjia error? Maybe someone better versed can take a look?
I'm not well versed but probably Ninja is the culprit here!
I haven't had any issues building it so far.

Hi @stekyne
Thanks for posting this issue.
This is caused by Ninja. If the version is equal or greater than 1.9.0, which will trigger this issue if we use ninja to build the ports on Windows.
Currently, there are several ports that will build fail due to this reason.
For the root cause of this kind of issue, please see https://github.com/microsoft/vcpkg/pull/10964#issuecomment-656362040.
Related issue #10887.
@NancyLi1013 Should I attempt to patch this package to only emit static or dynamic per build so? Or what can be done right now?
@stekyne Are you still having issues building portaudio?
Have you tried other alternatives?

@sfhacker what alternatives?
@stekyne How familiar are you with building projects like portaudio? Are you a newbie?
For example, is it mandatory to use Ninja? Can you use/try something else? That would be an alternative!
Let us know if you require further assistance.
@sfhacker You do realise this is posted under the context of VCPKG right? I can build portaudio in isolation. The build is failing when used as a package.
@stekyne
Currently, I have no any idea to fix this issue on source sides. But there are some workarounds that can avoid triggering this issue.
PERFER_NINJANINJAthat the version is less than 1.9.0.@NancyLi1013 This issue seems hard to troubleshoot, doesn't it? I have advised some alternatives/workarounds but ....
Perhaps we lack the knowledge and/or experience to try other things that will, for sure, work.
@stekyne Let us know if we can be of further assistance!
@NancyLi1013 Removing PREFER_NINJA seems to work that's good. Does VCPKG not install Ninja or does it only use the system version? If it doesn't install it, vcpkg installs embedded versions of cmake etc, why not this as well?
Anyways, I think this is the issue. I have Ninja 1.10 installed which I didn't realise. I will submit the PR to remove the PREFER_NINJA seeing as it's not really needed afaik.
Hi @stekyne
This issue seems to be solved now in the latest version.
So could you please help confirm if this can work fine for you? Please use git pull to update to the latest version.
Yeah seems to be working now. Thanks.