Bump CMake version to 3.18

Hello all.

I'd like to propose we update the required CMake version to be 3.18 (the current minimum version for macOS). This is two releases behind the current RC (3.20). If anyone is still using an old CMake, we already have the infrastructure to bootstrap a newer version as part of the build process. Are there any objections to doing this from the community?

Refs: Bump CMake version to 3.18. by zoecarver · Pull Request #36094 · apple/swift · GitHub

(I'm not opposed to bumping the version but:) Could you point out why we are bumping the version? That information might be helpful in investigating CMake failures.

1 Like

What is LLVM using now?

What is LLVM using now?

According to their docs, 3.13.4 or higher.

(I'm not opposed to bumping the version but:) Could you point out why we are bumping the version? That information might be helpful in investigating CMake failures.

  1. As I understand it, there are some improvements/fixes for linking Swift programs. However, I don't really know the details on this. Maybe @compnerd can elaborate a bit.

  2. uswift, which I'm proposing we add as a dependency, requires version 3.18. In the future, other dependencies might require newer versions of cmake as well.

In particular, there were fixes related to handling of output locations and fixes related to handling of module search paths and linker search paths for transitive dependencies of targets which required workarounds previously.

Another option would be to actually have two separate versions of CMake and use that specifically for the specific target, but of course that incurs a complexity in the build system.

I'm not suggesting that any one solution is better, just trying to make sure that all the information is available so we can make an informed decision.

3 Likes

Given that how many different failure modes people hit in practice with the build, IMO having a single CMake version is the way to go; if something goes wrong, debugging will be easier with one CMake rather than two.

It sounds like you want to do this b/c of 2. What is this? Bumping the cmake version is a big thing to do. What is this "uswift"? And what are you really trying to do.

It sounds like you want to do this b/c of 2. What is this? Bumping the cmake version is a big thing to do. What is this "uswift"? And what are you really trying to do.

uSwift is a "micro" Swift standard library created by @compnerd. As I discuss in the forum post here and the PR here, I'd like to use this to cross-compile some of the C++ interop tests.

While you're right that I mainly want to update the CMake version so that we can use uswift, the reason that uswift uses CMake 3.18 (and not an earlier version) is important, and a good reason for us, too, to update our CMake version. Especially as we have more Swift code in the compiler/build pipeline.

1 Like
Terms of Service

Privacy Policy

Cookie Policy