swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.19k stars 10.32k forks source link

LLVM Version Defaults to 13.0.0 #63163

Open thekief opened 1 year ago

thekief commented 1 year ago

I built a recent snapshot of the toolchain locally and noticed that the LLVM version defaults to 13.0.0 [1] although the LLVM itself defaults to 15.0.0 [2] if no version is otherwise set.

What is the reasoning behind setting the LLVM version to a (much) lower major version than it actually is?

[1] https://github.com/apple/swift/blob/swift-DEVELOPMENT-SNAPSHOT-2022-12-29-a/utils/build_swift/build_swift/defaults.py#L50 [2] https://github.com/apple/llvm-project/blob/swift-DEVELOPMENT-SNAPSHOT-2022-12-29-a/llvm/CMakeLists.txt#L14

thekief commented 1 year ago

It also seems that "official" builds seem to set the proper LLVM version:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51)
Target: arm64-apple-macosx13.0

Which makes me also wonder why there is such a difference between custom builds and official ones.

thekief commented 1 year ago

@shahmishal I was wondering if I should submit a patch that parses the clang version based on the LLVM project's version?

jgollenz commented 11 months ago

@shahmishal any news on why this still defaults to 13.0.0?

thekief commented 10 months ago

@shahmishal do you happen to have an update on this? I guess that the LLVM 13.0.0 is a safe callback, but I it is still preferable IMHO that the actual version is shown.