Skip to content

Conversation

@spevans
Copy link
Contributor

@spevans spevans commented Aug 16, 2019

For Linux only, if the checked out CMake repository is a newer version than the installed CMake version, build and use CMake from source.

This does not affect macOS build or set any minimum required CMake version in CMakeLists.txt

@spevans spevans requested a review from compnerd August 16, 2019 23:00
@spevans
Copy link
Contributor Author

spevans commented Aug 16, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c0c054f0e6998c15a63e6b4ba305e282d9714946

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c0c054f0e6998c15a63e6b4ba305e282d9714946

@spevans
Copy link
Contributor Author

spevans commented Aug 17, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c0c054f0e6998c15a63e6b4ba305e282d9714946

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c0c054f0e6998c15a63e6b4ba305e282d9714946

@spevans spevans force-pushed the pr_linux_build_cmake branch from c0c054f to 35b37ef Compare August 17, 2019 12:50
@spevans
Copy link
Contributor Author

spevans commented Aug 17, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - c0c054f0e6998c15a63e6b4ba305e282d9714946

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - c0c054f0e6998c15a63e6b4ba305e282d9714946

@spevans spevans force-pushed the pr_linux_build_cmake branch from 35b37ef to 82b2055 Compare August 17, 2019 15:21
@spevans
Copy link
Contributor Author

spevans commented Aug 17, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 35b37ef90c0b3830ec6bc4e23c50755ba76497e0

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 35b37ef90c0b3830ec6bc4e23c50755ba76497e0

@compnerd
Copy link
Member

CC: @shahmishal @Rostepher @drodriguez

@spevans spevans force-pushed the pr_linux_build_cmake branch from e70a80b to 79ba077 Compare August 17, 2019 18:26
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

else is unnecessary after the return.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 82b205595d64e7fcdf780d89bde2e89b4e4be218

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 82b205595d64e7fcdf780d89bde2e89b4e4be218

@spevans
Copy link
Contributor Author

spevans commented Aug 17, 2019

@swift-ci test macOS

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 79ba077f605b227772389bf8f72ec8ca43a53458

@spevans
Copy link
Contributor Author

spevans commented Aug 17, 2019

@swift-ci test macOS

@shahmishal
Copy link
Member

@swift-ci test

@shahmishal
Copy link
Member

@spevans can you please verify this works on Ubuntu 14.04 and 18.04?

…lled version.

- For Linux only, if the checked out CMake repository is a newer version
  than the installed CMake version or CMake is not installed, build and
  use CMake from source.

- This does not affect macOS build or set any minimum required CMake
  version in CMakeLists.txt
@spevans spevans force-pushed the pr_linux_build_cmake branch from 79ba077 to ded44f5 Compare August 21, 2019 11:06
@spevans
Copy link
Contributor Author

spevans commented Aug 21, 2019

@swift-ci test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 79ba077f605b227772389bf8f72ec8ca43a53458

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 79ba077f605b227772389bf8f72ec8ca43a53458

@spevans
Copy link
Contributor Author

spevans commented Aug 21, 2019

@shahmishal Ive just tested it locally on 14.04 and 18.04 and it worked ok.

(i_major, i_minor, i_patch) = self.installed_cmake_version(cmake_binary)
(s_major, s_minor, s_patch) = self.cmake_source_version(cmake_source_dir)
if (i_major > s_major or (i_major == s_major and i_minor >= s_minor) or
(i_major == s_major and i_minor == s_minor and i_patch >= s_patch)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Python you can simply do self.installed_cmake_version(cmake_binary) > self.cmake_source_version(cmake_source_dir) and the tuples will be compared lexicographically.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the info I will sort out a fix.

@shahmishal
Copy link
Member

I am going to merge this, but please create a new PR to simplify the suggestion @drodriguez had. Thanks!

@shahmishal shahmishal merged commit bebbcf4 into swiftlang:master Aug 22, 2019
@aschwaighofer
Copy link
Contributor

This breaks the incremental build because of python lint errors.
https://ci.swift.org/job/oss-swift-incremental-RA-osx/8587

I am going to revert.

@aschwaighofer
Copy link
Contributor

FAIL: Swift(macosx-x86_64) :: Python/python-lint.swift (7244 of 12214)
******************** TEST 'Swift(macosx-x86_64) :: Python/python-lint.swift' FAILED ********************
Script:
--
: 'RUN: at line 1';   /usr/bin/python /Users/buildnode/jenkins/workspace/oss-swift-incremental-RA-osx/swift/utils/python_lint.py
--
Exit Code: 1

Command Output (stdout):
--
./utils/build-script:1046:80: E501 line too long (82 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:23:1: I100 Import statements are in the wrong order. import re should be before from .
./utils/swift_build_support/swift_build_support/cmake.py:24:1: I100 Import statements are in the wrong order. import os should be before import re
./utils/swift_build_support/swift_build_support/cmake.py:188:37: E127 continuation line over-indented for visual indent
./utils/swift_build_support/swift_build_support/cmake.py:191:80: E501 line too long (82 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:200:47: E127 continuation line over-indented for visual indent
./utils/swift_build_support/swift_build_support/cmake.py:224:36: E127 continuation line over-indented for visual indent
./utils/swift_build_support/swift_build_support/cmake.py:238:80: E501 line too long (86 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:246:41: E127 continuation line over-indented for visual indent
./utils/swift_build_support/swift_build_support/cmake.py:250:80: E501 line too long (82 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:251:80: E501 line too long (85 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:257:80: E501 line too long (80 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:268:80: E501 line too long (80 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:269:80: E501 line too long (81 > 79 characters)
./utils/swift_build_support/swift_build_support/cmake.py:271:13: E129 visually indented line with same indent as next logical line
./utils/swift_build_support/swift_build_support/cmake.py:271:80: E501 line too long (80 > 79 characters)

--

********************

@aschwaighofer
Copy link
Contributor

Please reapply with those errors fixed.

@spevans
Copy link
Contributor Author

spevans commented Aug 22, 2019

@aschwaighofer I'll sort out the linter errors, but shouldnt the linter have run as part of the macOS ci-tests and failed earlier or is it run as a separate CI test?

@aschwaighofer
Copy link
Contributor

@spevans It should run as part of @swift-ci test (if not even smoke-test).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants