asm-parser icon indicating copy to clipboard operation
asm-parser copied to clipboard

Handle conan.cmake download failures gracefully

Open fghzxm opened this issue 2 years ago • 0 comments

This patch adds code to CMakeLists.txt to detect failure to download conan.cmake and handle it gracefully.

CMake's file(DOWNLOAD ...) command appears to retain an empty or corrupt file even when the download failed, and it does this silently without issuing any sort of errors or warnings. Currently, once the download failed, subsequent configures and reconfigures will all read from this bad conan.cmake until the build directory is wiped (not even deleting the cache helps). To fix this, we detect download failures explicitly, remove the bad file, and report the error to the user.

Also added a SHA256 check to the download command; this is usually redundant with TLS_VERIFY ON, but can be helpful against very bad MITM actors (sometimes seen in corporate environments).

fghzxm avatar Oct 13 '23 05:10 fghzxm