<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></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 Apr 2, 2020, at 11:43, Chris Tetreault <<a href="mailto:ctetreau@quicinc.com" class="">ctetreau@quicinc.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Assuming this is a one-time version bump, this seems reasonable to me. <span style="font-size: 11pt;" class="">Perhaps this goes without saying, but the warning for point 1 should only happen if you don’t have CMake >= 3.13.4 installed.</span></div></div></div></blockquote><div><br class=""></div>We agree.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">It sounded to me from your original message that you have an urgent need to upgrade to 3.8. Were you planning on going ahead with that right away?</div></div></div></blockquote><div><br class=""></div><div>Well, I'm just thinking that if we're going to bump it soon, it's unnecessary overhead to bump it right now too. It's true, I do have an urgent need to use 3.8 features inside libc++, but I will try to find a temporary workaround until we bump. I'll basically need to force-set `-std=c++17` when building libc++ instead of relying on CMake compile-features.</div><div><br class=""></div><div>Louis</div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""></o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0in 0in;" class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class="">From:</b><span class="Apple-converted-space"> </span>llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" class="">llvm-dev-bounces@lists.llvm.org</a>><span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Louis Dionne via llvm-dev<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, April 2, 2020 7:20 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Shoaib Meenai <<a href="mailto:smeenai@fb.com" class="">smeenai@fb.com</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[EXT] Re: [llvm-dev] Upgrading LLVM's minimum required CMake version<o:p class=""></o:p></div></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Okay, so we've had some discussion on this thread, and although some people (including me) would like a more aggressive policy, I believe the following will not get any objection (based on the thread). On April 23rd 2020, Ubuntu 20.04 LTS will ship with CMake 3.16.x. This will make the lower bound for LTS distributions be 3.13.4, and so I suggest we upgrade to that. Here's a proposed process:<o:p class=""></o:p></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">1. Immediately add a CMake warning in<span class="Apple-converted-space"> </span><span style="font-family: Monaco, serif;" class=""><root>/llvm/CMakeLists.txt</span><span class="Apple-converted-space"> </span>saying that CMake 3.13.4 will be the new minimum version starting with LLVM 12.0.0, and mentioning the versions used in various LTSes.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">2. Immediately send a courtesy heads-up email to all build-bot owners telling them about the upcoming change.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">3. Right after we branch off the release branch for LLVM 11.0.0 (the next one), make the minimum CMake version required be 3.13.4.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">4. Iterate on (3) until all bots are migrated.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">5. Send a message to the list saying the bump is complete. At that time, projects are free to start using features from 3.13.4.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Unless someone else absolutely wants to bite the bullet, I volunteer to do the above steps.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Thoughts?<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Louis<o:p class=""></o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div class=""><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class=""><div class=""><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Mar 26, 2020, at 16:07, Shoaib Meenai <<a href="mailto:smeenai@fb.com" style="color: purple; text-decoration: underline;" class="">smeenai@fb.com</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><p class="MsoNormal" style="margin: 0in 0in 12pt; font-size: 11pt; font-family: Calibri, sans-serif;">We had this discussion a few months ago and it petered out, and it’s recently been revived in the context of upgrading the CMake version specifically for libc++ (at which point people suggested upgrading the CMake version used by all of LLVM), so let’s try to move this forward.<br class=""><br class="">Our current required minimum version is CMake 3.4.3, which was released on January 25th 2016. It’s interesting to note that LLVM started requiring 3.4.3 on May 31st 2016, which was just 4 months after its release.<br class=""><br class="">Let’s look at the CMake versions available on various distros and operating systems. I’m unfamiliar with many of these, so I apologize if I get something wrong. (I’m using<span class="Apple-converted-space"> </span><a href="http://pkgs.org/" style="color: purple; text-decoration: underline;" class="">pkgs.org</a><span class="Apple-converted-space"> </span>for most of this information.)<br class="">* RHEL 6 (released Nov 10th 2010) : 3.6.1 (via EPEL)<br class="">* RHEL 7 (released June 10th 2014): 3.14.7 (via EPEL)<br class="">* RHEL 8 (released May 7th 2019): 3.11.4 (maybe<span class="Apple-converted-space"> </span><a href="http://pkgs.org/" style="color: purple; text-decoration: underline;" class="">pkgs.org</a><span class="Apple-converted-space"> </span>is screwy on this one, because it doesn’t make sense that RHEL 7 should have a newer available version than RHEL 8)<br class="">* Debian 9 (released June 17th 2017): 3.7.2<br class="">* Debian 10 (released July 6th 2019): 3.13.4<br class="">* Ubuntu 16.04 LTS (released April 21st 2016): 3.5.1<br class="">* Ubuntu 18.04 LTS (released April 26th 2018): 3.10.2<br class="">* FreeBSD 11 (released October 10th 2016): 3.15.5 (presumably upgraded in a point release)<br class="">* FreeBSD 12 (released December 11th 2018): 3.15.5 (presumably upgraded in a point release)<br class="">* NetBSD 8.1 (released May 31st 2019): 3.16.1<br class="">* NetBSD 9.0 (released February 14th 2020): 3.16.1<br class="">* OpenBSD: couldn’t find the version<br class="">* macOS: latest version is readily available through Homebrew<br class="">* Windows: You can install it yourself or use the one bundled with Visual Studio. I don't know what versions are bundled with Visual Studio; some searching suggests Visual Studio 2017 has CMake 3.12 and Visual Studio 2019 has 3.15, though I have no confirmation of that.<br class=""><br class="">Note that CMake provides prebuilt binaries for Linux, macOS, and Windows, and it’s also straightforward to build from source (it has very conservative compiler requirements). One suggestion that was brought up in the past was for LLVM’s build system to just download a newer version of CMake if you attempted to build it using one that was too old, but there was opposition [1]. There was also a suggestion to have a script in LLVM to download and build CMake for you, but there were mixed opinions on this too [2], particularly since many developers might prefer downloading a binary release to building from source themselves (though of course the script could also download binary releases if applicable). I personally think downloading or building CMake yourself isn’t a high barrier for anyone wanting to build LLVM (and in particular it’s *much* more straightforward than building LLVM itself), but I can understand why people would prefer to stick to versions available in distros.<br class=""><br class="">Another suggestion that came up last time was to set a policy for upgrading CMake versions on some regular basis. The opposition to this was that we should upgrade CMake versions only when a newer version has a compelling enough feature to justify upgrading, rather than always upgrading. I can see arguments for both approaches, but we should definitely at least think about the benefits we can get from upgrading versions. I've gone through the CMake release notes and highlighted features which seemed potentially valuable for LLVM. Note that I'm only highlighting features for which our minimum CMake version would have to be bumped up in order for our build system to take advantage of. There are other useful features in newer CMake versions, but you can take advantage of them just by using a newer CMake yourself. For example, 3.9 loosens the dependencies of object compilation, which should result in faster Ninja builds.<span class="Apple-converted-space"> </span><br class=""><br class="">CMake 3.5 (released March 8th 2016):<br class="">* install(DIRECTORY) supports generator expressions<br class=""><br class="">CMake 3.6 (released July 7th 2016):<br class="">* install() supports EXCLUDE_FROM_ALL<br class="">* list() supports FILTER to filter by regular expression<br class="">* Subninja support, which could theoretically be used for much faster runtimes builds, although in practice we probably want to make ExternalProject support this directly instead of trying to layer our own meta-build system on top<br class="">* CMAKE_TRY_COMPILE_TARGET_TYPE to tell try_compile to build a static library instead of an executable, which will greatly simplify the compiler-rt build<br class=""><br class="">CMake 3.7 (released November 11th 2016):<br class="">* New if() comparison operators LESS_EQUAL, GREATER_EQUAL, STRLESS_EQUAL, STRGREATER_EQUAL, VERSION_LESS_EQUAL, and VERSION_GREATER_EQUAL<br class=""><br class="">CMake 3.8 (released April 10th 2017):<br class="">* Compile features for C++17, which is required to build libc++ correctly<br class="">* Support for compile features for specific C++ features instead of only being able to specify standard versions<br class="">* rpath support via BUILD_RPATH target property and CMAKE_BUILD_RPATH variable<br class="">* Apple framework support for static libraries<br class="">* New swig_add_library command in the UseSWIG module<br class="">* New generator expression $<IF:cond,true-value,false-value><br class=""><br class="">CMake 3.9 (released July 18th 2017):<br class="">* install(TARGETS) and install(EXPORTS) support for object libraries, which will simplify the compiler-rt build<br class="">* TARGET_OBJECTS generator expression support in add_custom_command and file(GENERATE)<br class="">* $<TARGET_BUNDLE_DIR:tgt> and $<TARGET_BUNDLE_CONTENT_DIR:tgt> generator expressions for Apple bundles<br class=""><br class="">CMake 3.10 (released November 20th 2017):<br class="">* include_guard() command for proper guarding against double includes of CMake scripts<br class="">* An interesting aside is that this is the first verion of CMake to require C++11 to build, which should give a good sense of how conservative they are about compiler requirements<br class=""><br class="">CMake 3.11 (released March 28th 2018):<br class="">* add_library() and add_executable() can be called without sources as long as target_sources() is used later<br class="">* target_compile_{definitions,features,options}, target_include_directories(), target_sources(), and target_link_libraries() can set the corresponding INTERFACE_* properties on imported targets<br class="">* COMPILE_DEFINITIONS supports generator expressions<br class="">* COMPILE_OPTIONS source file property added<br class="">* INCLUDE_DIRECTORIES source file property added<br class="">* Interface libraries support custom properites<br class=""><br class="">CMake 3.12 (released July 17th 2018):<br class="">* add_compile_definitions() added to add compile definitions for targets (to avoid the global pollution caused by add_definitions())<br class="">* cmake_minimum_required() supports a version range to indicate tested CMake versions and set policies accordingly<br class="">* file(TOUCH) and file(TOUCH_NOCREATE) added<br class="">* list(JOIN), list(SUBLIST) and list(TRANSFORM) added<br class="">* string(JOIN) added<br class="">* SHELL: prefix support in target_compile_options to avoid errant deduplication<br class="">* target_link_libraries() supports object libraries and propagates usage requirements<br class="">* EXPORT_PROPERTIES target property to control the target properties exported by export() and install(EXPORT)<br class="">* FindLibXml2 provides imported targets<br class="">* New FindPython, FindPython2, and FindPython3 modules to ease location Python and selecting a specific version<br class="">* Modernization of UseSWIG module<br class="">* New generator expressions $<GENEX_EVAL:...>, $<TARGET_GENEX_EVAL:target,...>, $<IN_LIST:...>, $<TARGET_EXISTS:...> and $<TARGET_NAME_IF_EXISTS:...><br class="">* Compile features support for C++20<br class=""><br class="">CMake 3.13 (released November 20th 2018):<br class="">* cmake -E create_symlink supported on Windows<br class="">* target_link_directories() and target_link_options() commands to set link options instead of awkwardly having to use target_link_libraries() for this purpose<br class="">* UseSWIG can manage INCLUDE_DIRECTORIES for SWIG compilation<br class=""><br class="">CMake 3.14 (released March 14th 2019):<br class="">* file(CREATE_LINK) to create hard or symbolic links<br class="">* if(DEFINED CACHE{VAR}) for checking if a cache variable is defined<br class="">* $<IN_LIST:...> generator expression correctly handles empty argument<br class="">* Fixes for object library linking propagation<br class="">* Link options to manage position independent executables added automatically<br class=""><br class="">CMake 3.15 (released July 17th 2019):<br class="">* list(PREPEND), list(POP_FRONT) and list(POP_BACK) added<br class="">* New message() types NOTICE, VERBOSE, DEBUG and TRACE<br class="">* string(REPEAT) added<br class="">* MSVC_RUNTIME_LIBRARY target property and CMAKE_MSVC_RUNTIME_LIBRARY variable to select the runtime library type for MSVC<br class="">* $<C_COMPILER_ID:...>, $<CXX_COMPILER_ID:...>, $<COMPILE_LANGUAGE:...>, and $<PLATFORM_ID:...> generator expressions support matching one value from a list<br class="">* $<COMPILE_LANG_AND_ID:...> generator expression added<br class="">* $<FILTER:list,INCLUDE|EXCLUDE,regex> generator expression added<br class="">* $<REMOVE_DUPLICATES:list> generator expression added<br class="">* New $<TARGET_FILE*> generator expressions added: $<TARGET_FILE_PREFIX:...>, $<TARGET_FILE_BASE_NAME:...>, $<TARGET_FILE_SUFFIX:...>, $<TARGET_LINKER_FILE_PREFIX:...>, $<TARGET_LINKER_FILE_BASE_NAME:...>, $<TARGET_LINKER_FILE_SUFFIX:...>, $<TARGET_PDB_FILE_BASE_NAME:...><br class="">* $<TARGET_OBJECTS:...> generator expression supports executables and static, shared, and module libraries<br class=""><br class="">CMake 3.16 (released November 26th 2019):<br class="">* Support for generator expressions in BUILD_RPATH and INSTALL_RPATH<br class=""><br class="">CMake 3.17 (released March 20th 2020):<br class="">* Ninja Multi-Config generator, which among other things would greatly simplify LLVM_OPTIMIZED_TABLEGEN<br class="">* foreach(ZIP_LISTS) added to iterate multiple lists simultaneously<br class="">* New message() keywords CHECK_START, CHECK_PASS, and CHECK_FAIL<br class="">* INSTALL_NAME_DIR supports generator expressions<br class=""><br class="">Our build system is incredibly complex, and many of these features can be used to clean it up and make it much more maintainable. I would personally like us to at least bump up to CMake 3.12. I also do think it's worth establishing a policy and process around upgrading CMake versions, since newer versions keep on adding useful features (particularly better generator expression support), and we want to be able to keep taking advantage of them.<br class=""><br class="">[1]<span class="Apple-converted-space"> </span><a href="http://lists.llvm.org/pipermail/llvm-dev/2019-November/136485.html" style="color: purple; text-decoration: underline;" class="">http://lists.llvm.org/pipermail/llvm-dev/2019-November/136485.html</a><span class="Apple-converted-space"> </span><br class="">[2]<span class="Apple-converted-space"> </span><a href="http://lists.llvm.org/pipermail/llvm-dev/2019-November/136488.html" style="color: purple; text-decoration: underline;" class="">http://lists.llvm.org/pipermail/llvm-dev/2019-November/136488.html</a></p></div></div></blockquote></div></div></div></div></div></blockquote></div><br class=""></body></html>