From f8c52377a313dcd420a098e6bbd1342818645174 Mon Sep 17 00:00:00 2001 From: Rafael Kitover Date: Sun, 13 Jul 2025 16:17:48 +0000 Subject: [PATCH] build: fix binpkg hostdeps again Followup on 357eccc6 (build: fix checking if bin pkg host deps installed, 2025-07-13) keep a count of already installed host deps, and when the host deps count is equal to it rather than zero, break out of the loop. This fixes the infinite loop and hang caused by host deps being required but already being installed. Signed-off-by: Rafael Kitover --- cmake/Set-Toolchain-vcpkg.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/Set-Toolchain-vcpkg.cmake b/cmake/Set-Toolchain-vcpkg.cmake index a3f67d63..867a8587 100644 --- a/cmake/Set-Toolchain-vcpkg.cmake +++ b/cmake/Set-Toolchain-vcpkg.cmake @@ -318,6 +318,8 @@ function(get_binary_packages vcpkg_exe) endif() endforeach() + set(installed_host_dep_count 0) + while(TRUE) # -command "import-module ($env:USERPROFILE + '/source/repos/vcpkg-binpkg-prototype/vcpkg-binpkg.psm1'); vcpkg-listmissing ." execute_process( @@ -336,7 +338,9 @@ function(get_binary_packages vcpkg_exe) string(REGEX REPLACE "\r?\n" ";" host_deps "${host_deps}") - if(NOT host_deps) + list(LENGTH host_deps host_deps_count) + + if(host_deps_count EQUAL installed_host_dep_count) break() endif() @@ -370,6 +374,8 @@ function(get_binary_packages vcpkg_exe) message(STATUS "Failed to download host dependency package '${pkg}', aborting.") return() endif() + else() + math(EXPR installed_host_dep_count "${installed_host_dep_count} + 1") endif() endforeach() endwhile()