Repository navigation
Raise minimum CMake version to 3.16 - #1968
Conversation
|
|
|
I have |
|
Thanks! If you think 3.15 would be helpful for these various issues, maybe we should just bump to 3.15? Debian packages 3.16 in stretch-backports, and CentOS 8 "AppStream" seems to have 3.20, so given that this is only a build-dep, it doesn't seem that aggressive if it would help. Would this also help us with #1602? |
|
@keithw - absolutely it would help. I strongly favor being aggressive with CMake version updates. Halide just upgraded to 3.22. Why not just bump to 3.16 since that's the lower of the two baselines you mentioned? |
|
3.16 sgtm |
|
@keithw - done! I think I need you to re-start the workflows. |
|
@keithw - and we're green! Anything left for me to do here? I'm ready to rebase my other two PRs when this one is merged. |
The stated minimum, 3.1, was released on Dec 17, 2014 and did not support a value of 17 for CMAKE_CXX_STANDARD. The first version to do so was 3.8. In fact, attempting to build with CMake 3.7 fails with errors like: CMake Error in CMakeLists.txt: Target "wasm-strip" requires the language dialect "CXX17" , but CMake does not know the compile flags to use to enable it. So we might as well take this chance to raise the minimum to something more recent. I propose 3.16 here because of the following features: * CMP0077 (v3.13) makes the lives of FetchContent users easier by allowing option() to be overridden. * CMP0082 (v3.14) corrects the semantics of install() rules, which is relevant for FetchContent users. * CMake 3.12 allows the namelink of a shared library on Linux to be installed separately (i.e. in a dev package) * CMake 3.14 integrates the standard install destination variables from GNUInstallDirs with the install() command. * CMake 3.15 introduced the CMAKE_MSVC_RUNTIME_LIBRARY variable for controlling the selection of the runtime library from the outside. * CMake 3.16 gained support for generator expressions in RPATH properties, which will make it easier to ship shared libraries. This version is quite conservative and I would even suggest upgrading further. Windows and macOS users enjoy frequent updates from Homebrew and Microsoft Visual Studio. Ubuntu Linux 20.04 LTS ships 3.16 and the newest LTS ships 3.22. Linux users can always install the latest version through PIP, even on ARM, PowerPC, and s390x, and even without sudo. Fixes #1568
|
In the past we have tried to avoid bumping this to a version higher than is needed by the two peer projects binaryen (currently on 3.10.2) and llvm (currently on 3.13.4). However, less relevant today since we don't build wabt on emscripten-releases waterfall (normally the limiting factor) anymore. I do like the new test, but i would have rather we did a minimal bump to 3.8 (or 3.10 to match binaryen). |
|
In our experience on Halide, telling users that For another point of reference, the official x86 binaries require only glibc 2.12, which was released in 2010, four years before CMake 3.0 was released. The arm binaries require glibc 2.17, released in 2012, still predating CMake 3.0. Even if Python (which is a requirement for testing) is too much of a burden, one can still run: LLVM is a massive project and taking advantage of newer CMake features is an endeavor in itself. I'm not sure why binaryen doesn't upgrade more frequently. A comment in their code says they based their version off of the one in Ubuntu bionic. Maybe now that there are two LTS releases ahead of it, they would consider upgrading, too. And then there are the several clear benefits to upgrading that I outlined above... |
|
FWIW, I guess I wouldn't be thrilled for us to bump the required cmake version beyond what can be built for a recent version of Debian or other major Linux distribution of recent vintage. I recognize that Halide is a different story, but I don't think the pip availability of binaries for later cmake versions really helps when we're talking about something we want packaged by the major distributors -- they want to be building packages in their hermetic/reproducible build environments, with build-deps that are available in the build environment. |
@keithw - Well, I don't think that's an issue either since, as you previously observed, all the distros of recent vintage have at least CMake 3.16. The older distros aren't going to upgrade WABT beyond what they already packaged. Debian stable (bullseye) has 3.18. We got Halide packaged in Debian when it had a 3.16 requirement. |
The stated minimum, 3.1, was released on Dec 17, 2014 and did not support a value of 17 for CMAKE_CXX_STANDARD. The first version to do so was 3.8. In fact, attempting to build with CMake 3.7 fails with errors like: CMake Error in CMakeLists.txt: Target "wasm-strip" requires the language dialect "CXX17" , but CMake does not know the compile flags to use to enable it. So we might as well take this chance to raise the minimum to something more recent. I propose 3.16 here because of the following features: * CMP0077 (v3.13) makes the lives of FetchContent users easier by allowing option() to be overridden. * CMP0082 (v3.14) corrects the semantics of install() rules, which is relevant for FetchContent users. * CMake 3.12 allows the namelink of a shared library on Linux to be installed separately (i.e. in a dev package) * CMake 3.14 integrates the standard install destination variables from GNUInstallDirs with the install() command. * CMake 3.15 introduced the CMAKE_MSVC_RUNTIME_LIBRARY variable for controlling the selection of the runtime library from the outside. * CMake 3.16 gained support for generator expressions in RPATH properties, which will make it easier to ship shared libraries. This version is quite conservative and I would even suggest upgrading further. Windows and macOS users enjoy frequent updates from Homebrew and Microsoft Visual Studio. Ubuntu Linux 20.04 LTS ships 3.16 and the newest LTS ships 3.22. Linux users can always install the latest version through PIP, even on ARM, PowerPC, and s390x, and even without sudo. Fixes WebAssembly#1568
This PR disabled building on latest LTS Ubuntu (22.04), it only has 3.14 at the moment. |
@penzn - That is incorrect. The latest Ubuntu LTS (jammy) ships with CMake 3.22. Your environment is broken, somehow. |
|
Yeah, I found a rogue CMake on my system... |
The stated minimum, 3.1, was released on Dec 17, 2014 and did not support a value of 17 for
CMAKE_CXX_STANDARD. The first version to do so was 3.8. In fact, attempting to build with CMake 3.7 fails with errors like:So we might as well take this chance to raise the minimum to something more recent. I propose 3.16 here because of the following features:
FetchContentusers easier by allowingoption()to be overridden.install()rules, which is relevant forFetchContentusers.GNUInstallDirswith theinstall()command.CMAKE_MSVC_RUNTIME_LIBRARYvariable for controlling the selection of the runtime library from the outside.This version is quite conservative and I would even suggest upgrading further. Windows and macOS users enjoy frequent updates from Homebrew and Microsoft Visual Studio. Ubuntu Linux 20.04 LTS ships 3.16 and the newest LTS ships 3.22. Linux users can always install the latest version through PIP, even on ARM, PowerPC, and s390x, and even without sudo.
I have also added a GHA job to the CI workflow to test that WABT builds under its stated minimum version. This should prevent unintentional compatibility issues from creeping in. The other workflows can use newer CMake versions to catch issues there.
Fixes #1568