From e76df589e23ca07a0f3c1301580955c0e7d50e42 Mon Sep 17 00:00:00 2001 From: WarmUpTill <19472752+WarmUpTill@users.noreply.github.com> Date: Wed, 12 Aug 2026 21:19:07 +0200 Subject: [PATCH] Fix cmake configure errors during download retry --- cmake/common/buildspec_common.cmake | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/cmake/common/buildspec_common.cmake b/cmake/common/buildspec_common.cmake index b3fd96fb..8e58520c 100644 --- a/cmake/common/buildspec_common.cmake +++ b/cmake/common/buildspec_common.cmake @@ -191,14 +191,21 @@ function(_check_dependencies) foreach(i RANGE 1 ${MAX_DOWNLOAD_RETRIES}) message(STATUS "Attempt ${i}/${MAX_DOWNLOAD_RETRIES} for ${url}") - file( - DOWNLOAD "${url}" "${dependencies_dir}/${file}" - STATUS download_status - EXPECTED_HASH SHA256=${hash}) + file(DOWNLOAD "${url}" "${dependencies_dir}/${file}" + STATUS download_status) list(GET download_status 0 error_code) list(GET download_status 1 error_message) + if(error_code EQUAL 0) + file(SHA256 "${dependencies_dir}/${file}" actual_hash) + if(NOT actual_hash STREQUAL hash) + set(error_code 1) + set(error_message + "hash mismatch (expected ${hash}, got ${actual_hash})") + endif() + endif() + if(error_code EQUAL 0) message(STATUS "Downloading ${url} - success on attempt ${i}") set(download_success TRUE)