<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 30, 2019, at 12:02 PM, Andrew Kelley via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><div class=""><div class="">Here's an argument for why to *lower* the minimum supported CMake version:<br class=""></div></div></blockquote><div><br class=""></div><div>No offense, but that isn't going to happen.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">LLVM is a compiler backend.<br class=""></div></div></blockquote><div><br class=""></div><div>LLVM is *much* more than a compiler backend. Using LLVM as a compiler backend is one use of LLVM. It is also a JIT infrastructure, an object file toolchain, the underlying bits of a linker and a debugger. It is widely used in a lot of situations.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">LLVM is already the most difficult dependency to provide for most<br class="">projects that use it as a compiler backend. This is certainly true for<br class="">Zig, for example. This makes the requirements of building LLVM a<br class="">bottleneck in the bootstrapping process.<br class=""><br class="">Any bump in minimum required CMake version increases the requirements of<br class="">the system to bootstrap a project which depends on LLVM.<br class=""></div></div></blockquote><div><br class=""></div><div>Except that modern CMake's build requirements are a subset of LLVMs. Meaning if you have everything you need to build LLVM except CMake, you have everything you need to build a modern CMake.</div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">For programming languages, a more minimal bootstrapping process is a<br class="">feature.<br class=""><br class="">Therefore, bumping the minimum required CMake version of LLVM *removes a<br class="">feature* from any languages that depend on LLVM. This is O(N) cost where<br class="">N is the number of projects that depend on LLVM.<br class=""><br class="">Zig has cmake_minimum_required(VERSION 2.8.5). LLVM's higher CMake<br class="">requirement is already the most demanding CMake version of all Zig's<br class="">dependencies. Making it any higher than it already is is strictly worse.<br class=""><br class="">Why is newer CMake needed? What is LLVM's build process doing that is so<br class="">complicated that it needs bleeding edge CMake?<br class=""></div></div></blockquote><div><br class=""></div><div>CMake wasn't really designed to accurately represent all of the things that LLVM does in its build process. Here is a list of a few things LLVM projects do in CMake that we've had to implement hacks to work around in the past:</div><div><br class=""></div><div>(1) LLVM builds a DSL compiler then uses that compiler to generate source files. CMake historically couldn't represent those dependencies correctly, and still can't in the Xcode generator</div><div>(2) The compiler-rt builtins libraries need to be configured and built with a not fully functioning C toolchain, as Petr Hosek pointed out CMake 3.14 resolves that by adding <span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">CMAKE_TRY_COMPILE_TARGET_TYPE</span></div><div><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">(3) MSVC support has been constantly evolving since 2.8, and various releases have made huge strides in making it work</span></font></div><div><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">(4) LLDB generates an macOS framework target which was almost completely broken before CMake 3.8</span></font></div><div><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div><font color="#000000" class="">We've had lots of reasons in the past to update, and virtually none to stay on old versions. If building CMake from source was a prohibitively difficult problem, or CMake itself had wild requirements to bootstrap I'd probably argue differently about this. That just isn't the case. Holding ourselves to an old version of CMake is a <span style="caret-color: rgb(0, 0, 0);" class="">maintenance</span> burden on our community and IMO provides little benefit to our users.</font></div><div><br class=""></div><div><font color="#000000" class="">-Chris</font></div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">Regards,<br class="">Andrew<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></div></blockquote></div><br class=""></body></html>