This is an archive of the discontinued LLVM Phabricator instance.

Provide some instructions to guide the user on how to get a more up-to-date CMake in CMake error message
Needs ReviewPublic

Authored by mehdi_amini on Jul 16 2020, 6:28 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This will display:

CMake Error at CMakeLists.txt:18 (message):
   Your CMake version is 3.17.0. The minimum version of CMake  required to build LLVM is now 3.13.4.

   You can download CMake from: https://github.com/Kitware/CMake/releases
   or can locally get cmake in the current build directory:
   $ wget https://github.com/Kitware/CMake/releases/download/v3.18.0/cmake-3.18.0-Linux-x86_64.tar.gz
   $ echo "4d9a9d3351161073a67e49366d701b6fa4b0343781982dc5eef08a02a750d403  cmake-3.18.0-Linux-x86_64.tar.gz" | sha256sum -c
   $ tar -xf cmake-3.18.0-Linux-x86_64.tar.gz && (cd cmake-3.18.0-Linux-x86_64 && ./bootstrap && make)
   # Done, cmake is usable, nothing is installed on the system, everything is self-contained *inside* the build directory itself.
   $ ./cmake-3.18.0-Linux-x86_64/bin/cmake ../llvm/ -D.... # build LLVM as usual.

Diff Detail

Event Timeline

mehdi_amini created this revision.Jul 16 2020, 6:28 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 16 2020, 6:28 PM
mehdi_amini edited the summary of this revision. (Show Details)Jul 16 2020, 6:32 PM

(remove duplicated newline)

mehdi_amini edited the summary of this revision. (Show Details)Jul 16 2020, 6:35 PM

I think a change such as this would be an improvement. However, I think the linux special case is encouraging bad security habits "wget this random binary and run it!", and IMO should be removed.

I would also provide the download link from cmake.org rather than github. This is more robust in the face of kitware changing their repo hosting site (the github repo that you linked is not even the real repo, it's a mirror)

I think a change such as this would be an improvement. However, I think the linux special case is encouraging bad security habits "wget this random binary and run it!", and IMO should be removed.

Do you mean the non-linux special case? The linux special case does not download a binary but the sources, and also explicitly check the checksum.

I would also provide the download link from cmake.org rather than github. This is more robust in the face of kitware changing their repo hosting site (the github repo that you linked is not even the real repo, it's a mirror)

Look good, I'll update to https://cmake.org/download/