Skip to content

Commit e4dd1d5

Browse files
mayeuthenryiii
andauthored
Update to cmake 3.23.3 (#253)
* Update to CMake 3.23.3 * Drop manylinux1 wheels cmake >= 3.23 requires a version of libuv that can't be built on manylinux1. This drops manylinux1 wheels in favor of manylinux2010 wheels. * docs: mention final manylinux1 version * chore: clean-up libuv related code No need to build a custom libuv anymore, remove dead code. Co-authored-by: Henry Schreiner <[email protected]>
1 parent ff98a7b commit e4dd1d5

File tree

8 files changed

+209
-159
lines changed

8 files changed

+209
-159
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ jobs:
115115
with:
116116
path: ./wheelhouse/*.whl
117117

118-
build_manylinux1_wheels:
119-
name: Build ${{ matrix.arch }} manylinux1 wheels
118+
build_manylinux2010_wheels:
119+
name: Build ${{ matrix.arch }} manylinux2010 wheels
120120
needs: [lint]
121121
runs-on: ubuntu-20.04
122122
strategy:
@@ -136,8 +136,8 @@ jobs:
136136
env:
137137
CIBW_ARCHS: "${{ matrix.arch }}"
138138
CIBW_BUILD: "cp39-manylinux_*"
139-
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux1"
140-
CIBW_MANYLINUX_I686_IMAGE: "manylinux1"
139+
CIBW_MANYLINUX_X86_64_IMAGE: "manylinux2010"
140+
CIBW_MANYLINUX_I686_IMAGE: "manylinux2010"
141141

142142
- uses: actions/upload-artifact@v3
143143
with:
@@ -198,7 +198,7 @@ jobs:
198198

199199
check_dist:
200200
name: Check dist
201-
needs: [build_wheels, build_manylinux1_wheels, build_sdist, test_sdist]
201+
needs: [build_wheels, build_manylinux2010_wheels, build_sdist, test_sdist]
202202
runs-on: ubuntu-20.04
203203
steps:
204204
- uses: actions/download-artifact@v3
@@ -210,7 +210,7 @@ jobs:
210210

211211
upload_pypi:
212212
name: Upload to PyPI
213-
needs: [build_wheels, build_manylinux1_wheels, build_sdist, test_sdist, check_dist]
213+
needs: [build_wheels, build_manylinux2010_wheels, build_sdist, test_sdist, check_dist]
214214
runs-on: ubuntu-latest
215215
if: github.event_name == 'push' && github.repository == 'scikit-build/cmake-python-distributions' && startsWith(github.ref, 'refs/tags/')
216216
steps:

CMakeLists.txt

Lines changed: 41 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,34 @@ if(CMakePythonDistributions_SUPERBUILD)
164164
#
165165
if(NOT DEFINED CMakeProject_BINARY_DIR)
166166

167-
# cache arguments common to LibUV and CMake
168-
set(_common_cache_args)
167+
# glibc check
168+
if(UNIX AND NOT APPLE)
169+
# as of CMake 3.23.0, the minimum supported version of libuv is 1.28.0.
170+
# this implies that the minimum supported glibc version is 2.12
171+
# https://github.com/libuv/libuv/blob/v1.x/SUPPORTED_PLATFORMS.md
172+
include(CheckSymbolExists)
173+
check_symbol_exists(__GLIBC__ "stdlib.h" HAS_GLIBC_MAJOR)
174+
check_symbol_exists(__GLIBC_MINOR__ "stdlib.h" HAS_GLIBC_MINOR)
175+
if(HAS_GLIBC_MAJOR AND HAS_GLIBC_MINOR AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
176+
execute_process(COMMAND echo __GLIBC__ COMMAND "${CMAKE_CXX_COMPILER}" -E -P -imacros stdlib.h - OUTPUT_VARIABLE GLIBC_MAJOR_)
177+
string(STRIP "${GLIBC_MAJOR_}" GLIBC_MAJOR)
178+
execute_process(COMMAND echo __GLIBC_MINOR__ COMMAND "${CMAKE_CXX_COMPILER}" -E -P -imacros stdlib.h - OUTPUT_VARIABLE GLIBC_MINOR_)
179+
string(STRIP "${GLIBC_MINOR_}" GLIBC_MINOR)
180+
if("${GLIBC_MAJOR}.${GLIBC_MINOR}" VERSION_LESS "2.12")
181+
message(FATAL_ERROR "GLIBC ${GLIBC_MAJOR}.${GLIBC_MINOR} not supported")
182+
endif()
183+
endif()
184+
endif()
185+
186+
# cmake cache arguments
187+
set(_cmake_cache_args)
169188
if(DEFINED CMAKE_BUILD_TYPE)
170-
list(APPEND _common_cache_args
189+
list(APPEND _cmake_cache_args
171190
-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
172191
)
173192
endif()
174193
if(DEFINED CMAKE_TOOLCHAIN_FILE)
175-
list(APPEND _common_cache_args
194+
list(APPEND _cmake_cache_args
176195
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
177196
)
178197
endif()
@@ -183,81 +202,13 @@ if(CMakePythonDistributions_SUPERBUILD)
183202
CMAKE_JOB_POOL_LINK
184203
)
185204
if(DEFINED ${var_name})
186-
list(APPEND _common_cache_args
205+
list(APPEND _cmake_cache_args
187206
-D${var_name}:STRING=${${var_name}}
188207
)
189208
message(STATUS "SuperBuild - CMakeProject-build - ${var_name}: ${${var_name}}")
190209
endif()
191210
endforeach()
192211

193-
set(_common_args )
194-
if(UNIX AND (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"))
195-
# Since CMAKE_C_FLAGS and CMAKE_EXE_LINKER_FLAGS arguments contain spaces, we generate an initial
196-
# cache file.
197-
file(WRITE "${CMAKE_BINARY_DIR}/initial-cache.txt"
198-
"set(CMAKE_C_FLAGS \"-D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1\" CACHE STRING \"Initial cache\" FORCE)
199-
set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\" FORCE)
200-
")
201-
set(_common_args
202-
CMAKE_ARGS -C "${CMAKE_BINARY_DIR}/initial-cache.txt"
203-
)
204-
endif()
205-
206-
# cache arguments for CMake
207-
set(_cmake_cache_args)
208-
209-
# libuv
210-
set(UseCustomLibUV OFF)
211-
if(UNIX AND NOT APPLE)
212-
# libuv 1.23.0 is the last version to build on CentOS 5 (or glibc < 2.12)
213-
# Use libuv 1.23.0 instead of cmake embedded libuv when detecting glibc < 2.12
214-
# https://github.com/libuv/libuv/blob/v1.x/SUPPORTED_PLATFORMS.md
215-
include(CheckSymbolExists)
216-
check_symbol_exists(__GLIBC__ "stdlib.h" HAS_GLIBC_MAJOR)
217-
check_symbol_exists(__GLIBC_MINOR__ "stdlib.h" HAS_GLIBC_MINOR)
218-
if(HAS_GLIBC_MAJOR AND HAS_GLIBC_MINOR AND (CMAKE_CXX_COMPILER_ID STREQUAL "GNU"))
219-
execute_process(COMMAND echo __GLIBC__ COMMAND "${CMAKE_CXX_COMPILER}" -E -P -imacros stdlib.h - OUTPUT_VARIABLE GLIBC_MAJOR_)
220-
string(STRIP "${GLIBC_MAJOR_}" GLIBC_MAJOR)
221-
execute_process(COMMAND echo __GLIBC_MINOR__ COMMAND "${CMAKE_CXX_COMPILER}" -E -P -imacros stdlib.h - OUTPUT_VARIABLE GLIBC_MINOR_)
222-
string(STRIP "${GLIBC_MINOR_}" GLIBC_MINOR)
223-
if("${GLIBC_MAJOR}.${GLIBC_MINOR}" VERSION_LESS "2.12")
224-
set(UseCustomLibUV ON)
225-
endif()
226-
endif()
227-
endif()
228-
if(UseCustomLibUV)
229-
set(LibUV_SOURCE_DIR ${CMAKE_BINARY_DIR}/LibUV-src)
230-
set(LibUV_BINARY_DIR ${CMAKE_BINARY_DIR}/LibUV-build)
231-
set(LibUV_INSTALL_DIR ${CMAKE_BINARY_DIR}/LibUV-install)
232-
233-
ExternalProject_add(LibUV
234-
SOURCE_DIR ${LibUV_SOURCE_DIR}
235-
BINARY_DIR ${LibUV_BINARY_DIR}
236-
URL "https://dist.libuv.org/dist/v1.23.0/libuv-v1.23.0.tar.gz"
237-
URL_HASH "SHA256=d1746d324dea973d9f4c7ff40ba9cf60556c0bae9a92ad970568211b0e3bce27"
238-
DOWNLOAD_DIR ${CMakePythonDistributions_ARCHIVE_DOWNLOAD_DIR}
239-
${_common_args}
240-
CMAKE_CACHE_ARGS
241-
${_common_cache_args}
242-
-DCMAKE_INSTALL_PREFIX:PATH=${LibUV_INSTALL_DIR}
243-
-DCMAKE_INSTALL_LIBDIR:STRING=lib
244-
USES_TERMINAL_CONFIGURE 1
245-
USES_TERMINAL_BUILD 1
246-
${ep_log_configure_build_args}
247-
INSTALL_DIR ${LibUV_INSTALL_DIR}
248-
)
249-
list(APPEND _cmake_cache_args
250-
-DCMAKE_USE_SYSTEM_LIBRARY_LIBUV:BOOL=ON
251-
-DLibUV_LIBRARY:FILEPATH=${LibUV_INSTALL_DIR}/lib/libuv_a.a
252-
-DLibUV_INCLUDE_DIR:PATH=${LibUV_INSTALL_DIR}/include
253-
)
254-
else()
255-
cpd_ExternalProject_Add_Empty(LibUV "")
256-
endif()
257-
258-
# cmake
259-
set(CMakeProject_BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeProject-build)
260-
261212
if(DEFINED OPENSSL_ROOT_DIR)
262213
list(APPEND _cmake_cache_args
263214
-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}
@@ -272,28 +223,42 @@ set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\
272223
message(STATUS "SuperBuild - CMakeProject-build - CMAKE_CXX_STANDARD: ${CMAKE_CXX_STANDARD}")
273224
endif()
274225

226+
set(_cmake_args )
227+
if(UNIX AND (NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD"))
228+
# Since CMAKE_C_FLAGS and CMAKE_EXE_LINKER_FLAGS arguments contain spaces, we generate an initial
229+
# cache file.
230+
file(WRITE "${CMAKE_BINARY_DIR}/initial-cache.txt"
231+
"set(CMAKE_C_FLAGS \"-D_POSIX_C_SOURCE=199506L -D_POSIX_SOURCE=1 -D_SVID_SOURCE=1 -D_BSD_SOURCE=1\" CACHE STRING \"Initial cache\" FORCE)
232+
set(CMAKE_EXE_LINKER_FLAGS \"-lstdc++ -lgcc -lrt\" CACHE STRING \"Initial cache\" FORCE)
233+
")
234+
set(_cmake_args
235+
CMAKE_ARGS -C "${CMAKE_BINARY_DIR}/initial-cache.txt"
236+
)
237+
endif()
238+
239+
# cmake
240+
set(CMakeProject_BINARY_DIR ${CMAKE_BINARY_DIR}/CMakeProject-build)
241+
275242
ExternalProject_add(CMakeProject-build
276243
SOURCE_DIR ${CMakeProject_SOURCE_DIR}
277244
BINARY_DIR ${CMakeProject_BINARY_DIR}
278245
DOWNLOAD_COMMAND ""
279246
UPDATE_COMMAND ""
280247
BUILD_ALWAYS 1
281-
${_common_args}
248+
${_cmake_args}
282249
CMAKE_CACHE_ARGS
283250
-DBUILD_CursesDialog:BOOL=OFF
284251
-DCMAKE_USE_OPENSSL:BOOL=ON
285252
-DBUILD_TESTING:BOOL=ON
286253
-DCMake_INSTALL_DEPENDENCIES:BOOL=ON
287254
-DCMAKE_INSTALL_MESSAGE:STRING=NEVER
288-
${_common_cache_args}
289255
${_cmake_cache_args}
290256
USES_TERMINAL_CONFIGURE 1
291257
USES_TERMINAL_BUILD 1
292258
${ep_log_configure_build_args}
293259
INSTALL_COMMAND ""
294260
DEPENDS
295261
CMakeProject-src-download
296-
LibUV
297262
)
298263

299264
set(CMAKEPROJECT_BUILD_LAST_STEP "build")

CMakeUrls.cmake

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11

22
#-----------------------------------------------------------------------------
33
# CMake sources
4-
set(unix_source_url "https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6.tar.gz")
5-
set(unix_source_sha256 "73933163670ea4ea95c231549007b0c7243282293506a2cf4443714826ad5ec3")
4+
set(unix_source_url "https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3.tar.gz")
5+
set(unix_source_sha256 "06fefaf0ad94989724b56f733093c2623f6f84356e5beb955957f9ce3ee28809")
66

7-
set(windows_source_url "https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6.zip")
8-
set(windows_source_sha256 "e878cdaf2a8a0aac5c8ec8d5e1df1c5abd0d307ea9b9be2008ac56e2e8077cfb")
7+
set(windows_source_url "https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3.zip")
8+
set(windows_source_sha256 "1b023cedab15fb384e6617f54f181bd4bcf1ececb40cbb12985b573fa96ee299")
99

1010
#-----------------------------------------------------------------------------
1111
# CMake binaries
1212

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

16-
set(linux64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6-linux-x86_64.tar.gz")
17-
set(linux64_binary_sha256 "09e1b34026c406c5bf4d1b053eadb3a8519cb360e37547ebf4b70ab766d94fbc")
16+
set(linux64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-linux-x86_64.tar.gz")
17+
set(linux64_binary_sha256 "39e1c2eccda989b0d000dc5f4ee2cb031bdda799163780d855acc0bd9eda9d92")
1818

19-
set(macos10_10_binary_url "https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6-macos10.10-universal.tar.gz")
20-
set(macos10_10_binary_sha256 "873d296000b2fbd5cd306a3455fddc254b485cad988c67bf4ee0ba4fd7a1e057")
19+
set(macos10_10_binary_url "https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-macos10.10-universal.tar.gz")
20+
set(macos10_10_binary_sha256 "b9f6c3c51d437a08f20df2f34a6f65658bd837d6a299cf2e4e583c81484e8f9c")
2121

22-
set(win32_binary_url "https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6-windows-i386.zip")
23-
set(win32_binary_sha256 "058572b13af626e48cc8cba235c14491117b761354fb3c567b11c29835ff8283")
22+
set(win32_binary_url "https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-windows-i386.zip")
23+
set(win32_binary_sha256 "5c6fe36122e0ba41baadd0eb80157f107d2cca39894df22e472fcced9542358d")
2424

25-
set(win64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.22.6/cmake-3.22.6-windows-x86_64.zip")
26-
set(win64_binary_sha256 "48bcc3e71e918b72e2682f9ca9d44dd6c416379071c1ecb530d0633374f91f15")
25+
set(win64_binary_url "https://github.com/Kitware/CMake/releases/download/v3.23.3/cmake-3.23.3-windows-x86_64.zip")
26+
set(win64_binary_sha256 "b3365f30fc9fb27ffa524c2a987c34b307382930007341b39d3f0e271930d883")

README.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The suite of CMake tools were created by Kitware in response to the need
1111
for a powerful, cross-platform build environment for open-source projects
1212
such as ITK and VTK.
1313

14-
The CMake python wheels provide `CMake 3.22.6 <https://cmake.org/cmake/help/v3.22/index.html>`_.
14+
The CMake python wheels provide `CMake 3.23.3 <https://cmake.org/cmake/help/v3.23/index.html>`_.
1515

1616
Latest Release
1717
--------------
@@ -50,9 +50,9 @@ The following platforms are supported with binary wheels:
5050
| Windows | | 64-bit |
5151
| | | 32-bit |
5252
+---------------+--------------------------+
53-
| Linux Intel | | manylinux1+ 64-bit |
53+
| Linux Intel | | manylinux2010+ 64-bit |
5454
| | | musllinux 64-bit |
55-
| | | manylinux1+ 32-bit |
55+
| | | manylinux2010+ 32-bit |
5656
| | | musllinux 32-bit |
5757
+---------------+--------------------------+
5858
| Linux ARM | | manylinux2014+ AArch64 |
@@ -69,6 +69,8 @@ The following platforms are supported with binary wheels:
6969
| macOS 11+ | Apple Silicon |
7070
+---------------+--------------------------+
7171

72+
The last version to provide ``manylinux1`` wheels was ``3.22.x``.
73+
7274
Maintainers
7375
-----------
7476

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The suite of CMake tools were created by Kitware in response to the need
1515
for a powerful, cross-platform build environment for open-source projects
1616
such as `ITK <https://www.itk.org>`_ and `VTK <http://www.vtk.org>`_.
1717

18-
The CMake python wheels provide `CMake 3.22.6 <https://cmake.org/cmake/help/v3.22/index.html>`_.
18+
The CMake python wheels provide `CMake 3.23.3 <https://cmake.org/cmake/help/v3.23/index.html>`_.
1919

2020
.. toctree::
2121
:maxdepth: 2

docs/update_cmake_version.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ Classic procedure:
2929
2. Execute `scripts/update_cmake_version.py` command line tool with the desired
3030
``X.Y.Z`` CMake version available for download. For example::
3131

32-
$ release=3.22.6
32+
$ release=3.23.3
3333
$ ./scripts/update_cmake_version.py $release
34-
Collecting URLs and SHA256s from 'https://api.github.com/repos/Kitware/CMake/releases/tags/v3.22.6'
34+
Collecting URLs and SHA256s from 'https://api.github.com/repos/Kitware/CMake/releases/tags/v3.23.3'
3535
[...]
36-
Collecting URLs and SHA256s from 'https://api.github.com/repos/Kitware/CMake/releases/tags/v3.22.6' - done
37-
Updating 'CMakeUrls.cmake' with CMake version 3.22.6
38-
Updating 'CMakeUrls.cmake' with CMake version 3.22.6 - done
36+
Collecting URLs and SHA256s from 'https://api.github.com/repos/Kitware/CMake/releases/tags/v3.23.3' - done
37+
Updating 'CMakeUrls.cmake' with CMake version 3.23.3
38+
Updating 'CMakeUrls.cmake' with CMake version 3.23.3 - done
3939
Updating docs/index.rst
4040
Updating docs/index.rst - done
4141
Updating README.rst
@@ -46,7 +46,7 @@ Classic procedure:
4646
3. Create a topic named `update-to-cmake-X.Y.Z` and commit the changes.
4747
For example::
4848

49-
release=3.22.6
49+
release=3.23.3
5050
git switch -c update-to-cmake-$release
5151
git add -u CMakeUrls.cmake docs/index.rst README.rst tests/test_distribution.py docs/update_cmake_version.rst
5252
git commit -m "Update to CMake $release"

0 commit comments

Comments
 (0)