Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle conan.cmake download failures gracefully
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][so] 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). [so]: https://stackoverflow.com/q/61255773
- Loading branch information