Skip to content

Commit 017e11f

Browse files
author
Doug Coleman
committed
[build-script-impl]: Fixes version number on Linux from 3.0 to 3.0.x
Brief: COMPILER_VENDOR is None on Linux, so we get version 3.0 instead of 3.0.x. Full: On Linux, SWIFT_VERSION is unset because the ``None)`` case for ``COMPILER_VENDOR`` is empty. When ``lib/Basic/CMakeLists.txt`` tries to match the empty ``SWIFT_VERSION`` against regexps testing for a version triple, matching fails and we set ``DSWIFT_HAS_VERSION_PATCHLEVEL=0``. Then, in ``lib/Basic/Version.cpp``, since PATCHLEVEL is 0, it chooses the ``#else`` and ``SWIFT_VERSION_STRING`` is set to a pair instead of a triple, which gives ``3.0``.
1 parent fa13055 commit 017e11f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

utils/build-script-impl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,6 +1808,9 @@ for host in "${ALL_HOSTS[@]}"; do
18081808

18091809
case "${COMPILER_VENDOR}" in
18101810
none)
1811+
swift_cmake_options=(
1812+
-DSWIFT_VERSION="${SWIFT_USER_VISIBLE_VERSION}"
1813+
)
18111814
;;
18121815
apple)
18131816
llvm_cmake_options=(

0 commit comments

Comments
 (0)