Skip to content

Update to CMake 3.20.2 #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ matrix:
language: generic
env:
- PYTHON_VERSION=3.7.9
- MACOSX_DEPLOYMENT_TARGET=10.10

- os: osx
language: generic
env:
- PYTHON_VERSION=2.7.18
- MACOSX_DEPLOYMENT_TARGET=10.10

- arch: arm64-graviton2
virt: vm
Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ if(CMakePythonDistributions_SUPERBUILD)
set(binary_archive "linux64_binary")
endif()
if(APPLE)
set(binary_archive "macosx_binary")
if("${CMAKE_OSX_DEPLOYMENT_TARGET}" VERSION_LESS "10.10")
message(FATAL_ERROR "Unsupported macOS deployment target: ${CMAKE_OSX_DEPLOYMENT_TARGET} is less than 10.10")
else()
set(binary_archive "macos10_10_binary")
endif()
endif()
if(WIN32)
set(binary_archive "win32_binary")
Expand Down
28 changes: 14 additions & 14 deletions CMakeUrls.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@

#-----------------------------------------------------------------------------
# CMake sources
set(unix_source_url "https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1.tar.gz")
set(unix_source_sha256 "1d266ea3a76ef650cdcf16c782a317cb4a7aa461617ee941e389cb48738a3aba")
set(unix_source_url "https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.tar.gz")
set(unix_source_sha256 "aecf6ecb975179eb3bb6a4a50cae192d41e92b9372b02300f9e8f1d5f559544e")

set(windows_source_url "https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1.zip")
set(windows_source_sha256 "d3c8fc07b3207c6826b49e46b8194fcdbaab95eaba75dd735e348230efd4400d")
set(windows_source_url "https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2.zip")
set(windows_source_sha256 "70c6fcb80adfc7aa2969c7b1fd020381ea528d06f3c2aab546f4c2407ed5d148")

#-----------------------------------------------------------------------------
# CMake binaries

set(linux32_binary_url "NA") # Linux 32-bit binaries not available
set(linux32_binary_sha256 "NA")
set(linux32_binary_url "NA") # Linux 32-bit binaries not available
set(linux32_binary_sha256 "NA")

set(linux64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-Linux-x86_64.tar.gz")
set(linux64_binary_sha256 "587fb2d882214511f4b260329800de7903eba7827498f06a0dee234ed579bdc3")
set(linux64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-linux-x86_64.tar.gz")
set(linux64_binary_sha256 "3f827544f9c82e74ddf5016461fdfcfea4ede58a26f82612f473bf6bfad8bfc2")

set(macosx_binary_url "https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-Darwin-x86_64.tar.gz")
set(macosx_binary_sha256 "8b1caf1da7bc738a27c820ca8dc2ddb610b7526b4507095de87d79cd5a27028b")
set(macos10_10_binary_url "https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-macos10.10-universal.tar.gz")
set(macos10_10_binary_sha256 "6d9c1c1aecb61d085b1a20503fa94b0c28abae617e20189df61eea4cf876fba0")

set(win32_binary_url "https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-win32-x86.zip")
set(win32_binary_sha256 "7c01b9cc29a0e5051c11c605b7dd43d187fb25b277e7a3dc4085b9eaf36a0387")
set(win32_binary_url "https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-windows-i386.zip")
set(win32_binary_sha256 "8ad1f1f9a1a0a0dc82107eb9a4351d91d4e72504b0343368f1569b72a5e48bc1")

set(win64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.19.1/cmake-3.19.1-win64-x64.zip")
set(win64_binary_sha256 "e95d70549f306adb46e0f131dcecdbcbc6412d3a1e073c2c0078812391bf21d3")
set(win64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-windows-x86_64.zip")
set(win64_binary_sha256 "15a49e2ab81c1822d75b1b1a92f7863f58e31f6d6aac1c4103eef2b071be3112")
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The suite of CMake tools were created by Kitware in response to the need
for a powerful, cross-platform build environment for open-source projects
such as ITK and VTK.

The CMake python wheels provide `CMake 3.19.1 <https://cmake.org/cmake/help/v3.19/index.html>`_.
The CMake python wheels provide `CMake 3.20.2 <https://cmake.org/cmake/help/v3.20/index.html>`_.

Latest Release
--------------
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The suite of CMake tools were created by Kitware in response to the need
for a powerful, cross-platform build environment for open-source projects
such as `ITK <https://www.itk.org>`_ and `VTK <http://www.vtk.org>`_.

The CMake python wheels provide `CMake 3.19.1 <https://cmake.org/cmake/help/v3.19/index.html>`_.
The CMake python wheels provide `CMake 3.20.2 <https://cmake.org/cmake/help/v3.20/index.html>`_.

.. toctree::
:maxdepth: 2
Expand Down
25 changes: 21 additions & 4 deletions scikit-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ before_install:
osx:
environment:
PATH: $<HOME>/.pyenv/versions/$<PYTHON_VERSION>/bin:$<PATH>
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-10.6-x86_64
SETUP_BDIST_WHEEL_ARGS: --plat-name macosx-$<MACOSX_DEPLOYMENT_TARGET>-x86_64
commands:
- python scripts/ssl-check.py
- python ../addons/travis/install_cmake.py 3.12.0
Expand All @@ -59,7 +59,7 @@ before_install:
if platform.machine() in {"ppc64le"}:
# the container sees all 16 threads but building with all of them
# triggers the OoM killer due to RAM limitations
os.environ["SETUP_MAKE_ARGS"] = "-j4"
os.environ["SETUP_MAKE_ARGS"] = "-j2"
else:
os.environ["SETUP_MAKE_ARGS"] = "-j$(nproc)"
ci.driver.Driver.save_env(os.environ)
Expand Down Expand Up @@ -117,12 +117,29 @@ test:
commands:
# Convert to generic platform wheel
- python: |
import glob, sys
import glob, os, sys
sys.path.insert(0, "./scripts")
from convert_to_generic_platform_wheel import convert_to_generic_platform_wheel
wheels = glob.glob("dist/*.whl")
additional_platforms = []
if "MACOSX_DEPLOYMENT_TARGET" in os.environ:
target = tuple(int(p) for p in os.environ["MACOSX_DEPLOYMENT_TARGET"].split("."))
# let's add universal2 platform for this wheel.
additional_platforms = ["macosx_{}_{}_universal2".format(*target)]

# given pip support for universal2 was added after arm64 introduction
# let's also add arm64 platform.
arm64_target = target
if arm64_target < (11, 0):
arm64_target = (11, 0)
additional_platforms.append("macosx_{}_{}_arm64".format(*arm64_target))

if target < (11, 0):
# They're were also issues with pip not picking up some universal2 wheels, tag twice
additional_platforms.append("macosx_11_0_universal2")

for wheel in wheels:
convert_to_generic_platform_wheel(wheel, remove_original=True)
convert_to_generic_platform_wheel(wheel, remove_original=True, additional_platforms=additional_platforms)

appveyor:
commands:
Expand Down
20 changes: 15 additions & 5 deletions scripts/convert_to_generic_platform_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def _to_generic_pyver(pyver_tags):
return ['py%s' % tag[2] if tag.startswith('cp') else tag for tag in pyver_tags]


def _convert_to_generic_platform_wheel(wheel_ctx):
def _convert_to_generic_platform_wheel(wheel_ctx, additional_platforms):
"""Switch to generic python tags and remove ABI tags from a wheel

Convert implementation specific python tags to their generic equivalent and
Expand All @@ -51,6 +51,8 @@ def _convert_to_generic_platform_wheel(wheel_ctx):
----------
wheel_ctx : InWheelCtx
An open wheel context
additional_platforms : Optional[Iterable[str]]
An optional iterable of additional platform to add to the wheel
"""

abi_tags = ['none']
Expand All @@ -69,7 +71,14 @@ def _convert_to_generic_platform_wheel(wheel_ctx):

# Update wheel filename
fparts = wf.parsed_filename.groupdict()
original_platform_tags = fparts['plat'].split('.')
platform_tags = fparts['plat'].split('.')
logger.debug('Previous platform tags: %s', ', '.join(platform_tags))
if additional_platforms:
platform_tags = list(sorted(set(platform_tags + [p for p in additional_platforms])))
fparts['plat'] = '.'.join(platform_tags)
logger.debug('New platform tags ....: %s', ', '.join(platform_tags))
else:
logger.debug('No platform tags change needed.')

original_abi_tags = fparts['abi'].split('.')
logger.debug('Previous ABI tags: %s', ', '.join(original_abi_tags))
Expand Down Expand Up @@ -114,7 +123,7 @@ def _convert_to_generic_platform_wheel(wheel_ctx):
pyc_apis = unique_by_index(pyc_apis)

# Set tags for each Python version, C-API combination
updated_tags = ['-'.join(tup) for tup in product(pyc_apis, original_platform_tags)]
updated_tags = ['-'.join(tup) for tup in product(pyc_apis, platform_tags)]

if updated_tags != in_info_tags:
del info['Tag']
Expand All @@ -128,7 +137,8 @@ def _convert_to_generic_platform_wheel(wheel_ctx):
return out_wheel


def convert_to_generic_platform_wheel(wheel_path, out_dir='./dist/', remove_original=False, verbose=0):
def convert_to_generic_platform_wheel(wheel_path, out_dir='./dist/', remove_original=False, verbose=0,
additional_platforms=None):
logging.disable(logging.NOTSET)
if verbose >= 1:
logging.basicConfig(level=logging.DEBUG)
Expand All @@ -140,7 +150,7 @@ def convert_to_generic_platform_wheel(wheel_path, out_dir='./dist/', remove_orig

with InWheelCtx(wheel_path) as ctx:
ctx.out_wheel = pjoin(out_dir, wheel_fname)
ctx.out_wheel = _convert_to_generic_platform_wheel(ctx)
ctx.out_wheel = _convert_to_generic_platform_wheel(ctx, additional_platforms)

if remove_original:
logger.info('Removed original wheel %s' % wheel_path)
Expand Down
40 changes: 20 additions & 20 deletions scripts/update_cmake_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ def get_cmake_archive_urls_and_sha256s(version, verbose=False):
sha_256_file = "cmake-%s-SHA-256.txt" % version

expected_files = {
"cmake-%s.tar.gz" % version: "unix_source",
"cmake-%s.zip" % version: "win_source",
"cmake-%s-Linux-x86_64.tar.gz" % version: "linux64_binary",
"cmake-%s-Darwin-x86_64.tar.gz" % version: "macosx_binary",
"cmake-%s-win32-x86.zip" % version: "win32_binary",
"cmake-%s-win64-x64.zip" % version: "win64_binary",
"cmake-%s.tar.gz" % version: "unix_source",
"cmake-%s.zip" % version: "win_source",
"cmake-%s-linux-x86_64.tar.gz" % version: "linux64_binary",
"cmake-%s-macos10.10-universal.tar.gz" % version: "macos10_10_binary",
"cmake-%s-windows-i386.zip" % version: "win32_binary",
"cmake-%s-windows-x86_64.zip" % version: "win64_binary",
}

# Get SHA256s for each asset
Expand Down Expand Up @@ -102,29 +102,29 @@ def generate_cmake_variables(urls_and_sha256s):
cmake_variables = textwrap.dedent("""
#-----------------------------------------------------------------------------
# CMake sources
set(unix_source_url "{unix_source_url}")
set(unix_source_sha256 "{unix_source_sha256}")
set(unix_source_url "{unix_source_url}")
set(unix_source_sha256 "{unix_source_sha256}")

set(windows_source_url "{win_source_url}")
set(windows_source_sha256 "{win_source_sha256}")
set(windows_source_url "{win_source_url}")
set(windows_source_sha256 "{win_source_sha256}")

#-----------------------------------------------------------------------------
# CMake binaries

set(linux32_binary_url "NA") # Linux 32-bit binaries not available
set(linux32_binary_sha256 "NA")
set(linux32_binary_url "NA") # Linux 32-bit binaries not available
set(linux32_binary_sha256 "NA")

set(linux64_binary_url "{linux64_binary_url}")
set(linux64_binary_sha256 "{linux64_binary_sha256}")
set(linux64_binary_url "{linux64_binary_url}")
set(linux64_binary_sha256 "{linux64_binary_sha256}")

set(macosx_binary_url "{macosx_binary_url}")
set(macosx_binary_sha256 "{macosx_binary_sha256}")
set(macos10_10_binary_url "{macos10_10_binary_url}")
set(macos10_10_binary_sha256 "{macos10_10_binary_sha256}")

set(win32_binary_url "{win32_binary_url}")
set(win32_binary_sha256 "{win32_binary_sha256}")
set(win32_binary_url "{win32_binary_url}")
set(win32_binary_sha256 "{win32_binary_sha256}")

set(win64_binary_url "{win64_binary_url}")
set(win64_binary_sha256 "{win64_binary_sha256}")
set(win64_binary_url "{win64_binary_url}")
set(win64_binary_sha256 "{win64_binary_sha256}")
""").format(**template_inputs)

return cmake_variables
Expand Down
2 changes: 1 addition & 1 deletion tests/test_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def _check_cmake_install(virtualenv, tmpdir):
expected_version = "3.19.1"
expected_version = "3.20.2"

for executable_name in ["cmake", "cpack", "ctest"]:
output = virtualenv.run(
Expand Down