[CMake] FetchContent/ExternalProject and URL_HASH

fdk17 fdk17 at ftml.net
Mon Jul 22 14:16:21 EDT 2019



On Mon, Jul 22, 2019, at 11:51 AM, Dustyn Blasig wrote:
> *"I don't think it is realistic to expect CMake or the underlying tools to still give you a successful file download if you interrupt it. ;)"*
> 
> Sorry, I didn't word that well : )
> 
> I was curious if CMake uses handlers behind the scenes similar to GNU Make such that if a signal occurs it will cleanup any partially-written files so the next time you build it will retry those targets. In this case, if the download is interrupted, will CMake know it needs to redo the download? Are the checksum files used to verify the download was successful, or really only useful for authenticity like the man-in-the-middle attacks?
> 
> I definitely like the download and configure once and reuse the download offline part, that is useful!
> 
I recall FetchContent being smart enough to determine that it was interrupted by user. The time stamps typically don't get updated until after successfully completing the fetch and configure. So it’ll just redo the pieces that needs to be updated or didn’t run in the first place. 

The checksums are used to verify the download was successful. Typical Ethernet and TCP/IP is not robust enough to detect single bit errors in large downloads. It’s one of the reasons why md5sum accompanies ISO downloads. Less of an issue with small items but still can happen. 

One reason for not downloading checksum file is that you don’t know if package had an issue or if the checksum file had an issue. You wouldn’t want to download a large file because the checksum file had an error. 

I can see how having this feature would be beneficial to you but you may just be forced to download checksum independently and parse it first. Then use contents for the real item to be downloaded. 

—
F
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190722/7b534300/attachment.html>


More information about the CMake mailing list