View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015987CMakeCMakepublic2016-02-25 09:062016-06-10 14:21
ReporterTobias Hieta 
Assigned ToBrad King 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformApple MacOSOS XOS Version10.4.10
Product VersionCMake 3.4.3 
Target VersionCMake 3.6Fixed in VersionCMake 3.6 
Summary0015987: STATUS variable to FILE(DOWNLOAD) does not consider HASH mismatch failures
DescriptionThis threw me for a bit of a loop when working with our cmake lists that download dependencies. It seems like the STATUS variable to file(download) only records errors if they happen when downloading the file. If the has mismatches the STATUS variable will still be set to 0 and "No error" as the error string. The only thing that does happen is that it prints a error message.

This makes it very hard to handle errors where the HASH is not correct since you can't use the status variable to abort the the processing like:

file(DOWNLOAD <url> STATUS DL_STATUS)
if(NOT DL_STATUS EQUAL 0)
  message(FATAL_ERROR "Failed")
endif()

I would expect the STATUS variable to be set to "1;HASH MISMATCH" or something when the has mismatches.
TagsNo tags attached.
Attached Filespatch file icon set_file_download_status_on_hash_mismatch.patch [^] (793 bytes) 2016-02-25 09:27 [Show Content]

 Relationships

  Notes
(0040550)
Tobias Hieta (reporter)
2016-02-25 09:27

Uploaded a patch that makes it behave as I expect
(0040552)
Brad King (manager)
2016-02-25 11:45

Thanks. This should fix it:

 file(DOWNLOAD): Fill STATUS variable on hash mismatch
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6c9586f9 [^]
(0041242)
Kitware Robot (administrator)
2016-06-10 14:21

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2016-02-25 09:06 Tobias Hieta New Issue
2016-02-25 09:27 Tobias Hieta File Added: set_file_download_status_on_hash_mismatch.patch
2016-02-25 09:27 Tobias Hieta Note Added: 0040550
2016-02-25 11:45 Brad King Note Added: 0040552
2016-02-25 11:45 Brad King Assigned To => Brad King
2016-02-25 11:45 Brad King Status new => resolved
2016-02-25 11:45 Brad King Resolution open => fixed
2016-02-25 11:45 Brad King Fixed in Version => CMake 3.6
2016-02-25 11:45 Brad King Target Version => CMake 3.6
2016-06-10 14:21 Kitware Robot Note Added: 0041242
2016-06-10 14:21 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team