This was observed while using: CMake version 4.4.3 on windows
To me, this looks like a clear bug in CMake. While I was switching from Boost 1.86.0 to 1.90.0, I forgot to update to the correct URL_HASH. Instead of telling me that the hash was wrong, I observed that it was downloading six times in a row and ended with this message:
CMake Error at C:/builds/xxx/CMakeFiles/fc-stamp/boost/download-boost.cmake:163 (message):
[cmake] Each download failed!
This sent me down the wrong rabbit hole checking my ethernet connection. ![]()
Expected behavior
When a hash does not match, it should print an error message saying something like “Hey, the hash you supplied does not match!”
Observed behavior
Unnecessarily downloading six times and printing a wrong message at the end: “Each download failed!”. It is a) the wrong message and b) not true: all downloads succeeded perfectly.
my finally working code here:
FetchContent_Declare(
Boost
URL
# https://artifactory/3rd-party/boost/releases/download/boost-1.86.0/boost-1.86.0-cmake.tar.xz
https://artifactory/3rd-party/boost/releases/download/boost-1.90.0/boost-1.90.0-cmake.tar.xz
URL_HASH
# SHA256=2c5ec5edcdff47ff55e27ed9560b0a0b94b07bd07ed9928b476150e16b0efc57
SHA256=aca59f889f0f32028ad88ba6764582b63c916ce5f77b31289ad19421a96c555f
DOWNLOAD_EXTRACT_TIMESTAMP OFF
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(Boost)