Skip to content

Commit a484800

Browse files
committed
Add manylinux_2_24 support
1 parent 14f2f4e commit a484800

File tree

10 files changed

+46
-21
lines changed

10 files changed

+46
-21
lines changed

bin/update_dependencies.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@
7171
Image('manylinux2014', 'aarch64', 'quay.io/pypa/manylinux2014_aarch64', None),
7272
Image('manylinux2014', 'ppc64le', 'quay.io/pypa/manylinux2014_ppc64le', None),
7373
Image('manylinux2014', 's390x', 'quay.io/pypa/manylinux2014_s390x', None),
74+
75+
Image('manylinux_2_24', 'x86_64', 'quay.io/pypa/manylinux_2_24_x86_64', None),
76+
Image('manylinux_2_24', 'i686', 'quay.io/pypa/manylinux_2_24_i686', None),
77+
Image('manylinux_2_24', 'aarch64', 'quay.io/pypa/manylinux_2_24_aarch64', None),
78+
Image('manylinux_2_24', 'ppc64le', 'quay.io/pypa/manylinux_2_24_ppc64le', None),
79+
Image('manylinux_2_24', 's390x', 'quay.io/pypa/manylinux_2_24_s390x', None),
7480
]
7581

7682
config = configparser.ConfigParser()

cibuildwheel/resources/pinned_docker_images.cfg

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22
manylinux1 = quay.io/pypa/manylinux1_x86_64:2021-02-06-920c3c7
33
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-02-06-3d322a5
44
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-02-14-fc316c3
5+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-02-14-fc316c3
56

67
[i686]
78
manylinux1 = quay.io/pypa/manylinux1_i686:2021-02-06-920c3c7
89
manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-02-06-3d322a5
910
manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-02-14-fc316c3
11+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-02-14-fc316c3
1012

1113
[pypy_x86_64]
1214
manylinux2010 = pypywheels/manylinux2010-pypy_x86_64:2020-12-11-f1e0e80
1315

1416
[aarch64]
1517
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-02-14-fc316c3
18+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2021-02-14-fc316c3
1619

1720
[ppc64le]
1821
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2021-02-14-fc316c3
22+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2021-02-14-fc316c3
1923

2024
[s390x]
2125
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2021-02-14-fc316c3
26+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2021-02-14-fc316c3
2227

docs/options.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,14 +448,14 @@ CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair --lib-sdir . -w {dest_dir} {
448448

449449
An alternative Docker image to be used for building [`manylinux`](https://github.com/pypa/manylinux) wheels. `cibuildwheel` will then pull these instead of the default images, [`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64), [`quay.io/pypa/manylinux2010_i686`](https://quay.io/pypa/manylinux2010_i686), [`pypywheels/manylinux2010-pypy_x86_64`](https://hub.docker.com/r/pypywheels/manylinux2010-pypy_x86_64), [`quay.io/pypa/manylinux2014_aarch64`](https://quay.io/pypa/manylinux2014_aarch64), [`quay.io/pypa/manylinux2014_ppc64le`](https://quay.io/pypa/manylinux2014_ppc64le), and [`quay.io/pypa/manylinux2014_s390x`](https://quay.io/pypa/manylinux2010_s390x).
450450

451-
The value of this option can either be set to `manylinux1`, `manylinux2010` or `manylinux2014` to use a pinned version of the [official `manylinux` images](https://github.com/pypa/manylinux) and [PyPy `manylinux` images](https://github.com/pypy/manylinux). Alternatively, set these options to any other valid Docker image name. Note that for PyPy, only the official `manylinux2010` image is currently available. For architectures other
452-
than x86 (x86\_64 and i686) manylinux2014 must be used because this is the first version of the manylinux specification that supports additional architectures.
451+
The value of this option can either be set to `manylinux1`, `manylinux2010`, `manylinux2014` or `manylinux_2_24` to use a pinned version of the [official `manylinux` images](https://github.com/pypa/manylinux) and [PyPy `manylinux` images](https://github.com/pypy/manylinux). Alternatively, set these options to any other valid Docker image name. Note that for PyPy, only the official `manylinux2010` image is currently available. For architectures other
452+
than x86 (x86\_64 and i686) `manylinux2014` or `manylinux_2_24` must be used because the first version of the manylinux specification that supports additional architectures is `manylinux2014`.
453453

454-
Beware to specify a valid Docker image that can be used in the same way as the official, default Docker images: all necessary Python and pip versions need to be present in `/opt/python/`, and the `auditwheel` tool needs to be present for `cibuildwheel` to work. Apart from that, the architecture and relevant shared system libraries need to be manylinux1-, manylinux2010- or manylinux2014-compatible in order to produce valid `manylinux1`/`manylinux2010`/`manylinux2014` wheels (see [pypa/manylinux on GitHub](https://github.com/pypa/manylinux), [PEP 513](https://www.python.org/dev/peps/pep-0513/), [PEP 571](https://www.python.org/dev/peps/pep-0571/) and [PEP 599](https://www.python.org/dev/peps/pep-0599/) for more details).
454+
Beware to specify a valid Docker image that can be used in the same way as the official, default Docker images: all necessary Python and pip versions need to be present in `/opt/python/`, and the `auditwheel` tool needs to be present for `cibuildwheel` to work. Apart from that, the architecture and relevant shared system libraries need to be manylinux1-, manylinux2010- or manylinux2014-compatible in order to produce valid `manylinux1`/`manylinux2010`/`manylinux2014`/`manylinux_2_24` wheels (see [pypa/manylinux on GitHub](https://github.com/pypa/manylinux), [PEP 513](https://www.python.org/dev/peps/pep-0513/), [PEP 571](https://www.python.org/dev/peps/pep-0571/), [PEP 599](https://www.python.org/dev/peps/pep-0599/) and [PEP 600](https://www.python.org/dev/peps/pep-0600/) for more details).
455455

456456
Note that `auditwheel` detects the version of the `manylinux` standard in the Docker image through the `AUDITWHEEL_PLAT` environment variable, as `cibuildwheel` has no way of detecting the correct `--plat` command line argument to pass to `auditwheel` for a custom image. If a Docker image does not correctly set this `AUDITWHEEL_PLAT` environment variable, the `CIBW_ENVIRONMENT` option can be used to do so (e.g., `CIBW_ENVIRONMENT='AUDITWHEEL_PLAT="manylinux2010_$(uname -m)"'`).
457457

458-
Note that `manylinux2014` doesn't support builds with Python 2.7 - when building with `manylinux2014`, skip Python 2.7 using `CIBW_SKIP` (see example below).
458+
Note that `manylinux2014`/`manylinux_2_24` don't support builds with Python 2.7 - when building with `manylinux2014`/`manylinux_2_24`, skip Python 2.7 using `CIBW_SKIP` (see example below).
459459

460460
#### Examples
461461

test/test_before_build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
project_with_before_build_asserts = test_projects.new_c_project(
99
setup_py_add=textwrap.dedent(r'''
10-
import sys, os
10+
import os
1111
1212
# assert that the Python version as written to pythonversion.txt in the CIBW_BEFORE_BUILD step
1313
# is the same one as is currently running.

test/test_docker_images.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
dockcross_only_project = test_projects.new_c_project(
99
setup_py_add=textwrap.dedent(r'''
10-
import os, sys
10+
import os
1111
1212
# check that we're running in the correct docker image as specified in the
1313
# environment options CIBW_MANYLINUX1_*_IMAGE

test/test_manylinuxXXXX_only.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
project_with_manylinux_symbols = test_projects.new_c_project(
1010
spam_c_top_level_add=textwrap.dedent(r'''
1111
#include <malloc.h>
12+
#include <stdlib.h>
13+
#include <stdint.h>
14+
#include <math.h>
1215
1316
#if !defined(__GLIBC_PREREQ)
1417
#error "Must run on a glibc linux environment"
@@ -19,19 +22,21 @@
1922
#endif
2023
'''),
2124
spam_c_function_add=textwrap.dedent(r'''
22-
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17) /* manylinux2014 is glibc 2.17 */
23-
// secure_getenv is only available in manylinux2014, ensuring
24-
// that only a manylinux2014 wheel is produced
25-
secure_getenv("NON_EXISTING_ENV_VARIABLE");
25+
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 24)
26+
// nextupf is only available in manylinux_2_24+
27+
sts = (int)nextupf(0.0F);
28+
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17) /* manylinux2014 is glibc 2.17 */
29+
// secure_getenv is only available in manylinux2014+
30+
sts = (int)(intptr_t)secure_getenv("NON_EXISTING_ENV_VARIABLE");
2631
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) /* manylinux2010 is glibc 2.12 */
2732
// malloc_info is only available on manylinux2010+
28-
malloc_info(0, stdout);
33+
sts = malloc_info(0, stdout);
2934
#endif
3035
'''),
3136
)
3237

3338

34-
@pytest.mark.parametrize('manylinux_image', ['manylinux1', 'manylinux2010', 'manylinux2014'])
39+
@pytest.mark.parametrize('manylinux_image', ['manylinux1', 'manylinux2010', 'manylinux2014', 'manylinux_2_24'])
3540
def test(manylinux_image, tmp_path):
3641
if utils.platform != 'linux':
3742
pytest.skip('the docker test is only relevant to the linux build')
@@ -46,7 +51,7 @@ def test(manylinux_image, tmp_path):
4651
# CFLAGS environment variable is necessary to fail on 'malloc_info' (on manylinux1) during compilation/linking,
4752
# rather than when dynamically loading the Python
4853
add_env = {
49-
'CIBW_ENVIRONMENT': 'CFLAGS="$CFLAGS -Werror=implicit-function-declaration"',
54+
'CIBW_ENVIRONMENT': 'CFLAGS="$CFLAGS -O0 -Werror=implicit-function-declaration"',
5055
'CIBW_MANYLINUX_X86_64_IMAGE': manylinux_image,
5156
'CIBW_MANYLINUX_I686_IMAGE': manylinux_image,
5257
'CIBW_MANYLINUX_PYPY_X86_64_IMAGE': manylinux_image,
@@ -57,14 +62,14 @@ def test(manylinux_image, tmp_path):
5762
if manylinux_image == 'manylinux1':
5863
# We don't have a manylinux1 image for PyPy
5964
add_env['CIBW_SKIP'] = 'pp*'
60-
elif manylinux_image == 'manylinux2014':
61-
# We don't have a manylinux2014 image for PyPy (yet?)
62-
add_env['CIBW_SKIP'] = 'cp27* pp*' # Python 2.7 not available on manylinux2014
65+
elif manylinux_image in {'manylinux2014', 'manylinux_2_24'}:
66+
# We don't have a manylinux2014 / 'manylinux_2_24' image for PyPy (yet?)
67+
add_env['CIBW_SKIP'] = 'cp27* pp*' # Python 2.7 not available on manylinux2014 / 'manylinux_2_24'
6368
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)
6469

6570
expected_wheels = [w for w in utils.expected_wheels('spam', '0.1.0', manylinux_versions=[manylinux_image])]
66-
if manylinux_image == 'manylinux2014':
71+
if manylinux_image in {'manylinux2014', 'manylinux_2_24'}:
6772
expected_wheels = [w for w in expected_wheels if '-cp27' not in w]
68-
if manylinux_image in ['manylinux1', 'manylinux2014']:
73+
if manylinux_image in {'manylinux1', 'manylinux2014', 'manylinux_2_24'}:
6974
expected_wheels = [w for w in expected_wheels if '-pp' not in w]
7075
assert set(actual_wheels) == set(expected_wheels)

test/test_pep518.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
setup_py_add=textwrap.dedent(
88
"""
99
# Will fail if PEP 518 does work
10-
import sys
1110
import requests
1211
if sys.version_info < (3, 6, 0):
1312
assert requests.__version__ == "2.22.0", "Requests found but wrong version ({0})".format(requests.__version__)

test/test_projects/c.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,21 @@
6060
'''
6161

6262
SETUP_PY_TEMPLATE = r'''
63+
import sys
6364
from setuptools import setup, Extension
6465
6566
{{ setup_py_add }}
6667
68+
libraries = []
69+
if sys.platform.startswith('linux'):
70+
libraries.extend(['m', 'c'])
71+
6772
setup(
68-
ext_modules=[Extension('spam', sources=['spam.c'])],
73+
ext_modules=[Extension(
74+
'spam',
75+
sources=['spam.c'],
76+
libraries=libraries,
77+
)],
6978
{{ setup_py_setup_args_add | indent(4) }}
7079
)
7180
'''

test/test_ssl.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
project_with_ssl_tests = test_projects.new_c_project(
66
setup_py_add=textwrap.dedent(r'''
77
import ssl
8-
import sys
98
109
if sys.version_info[0] == 2:
1110
from urllib2 import urlopen

unit_test/main_tests/main_options_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@ def test_empty_selector(platform, intercepted_build_args, monkeypatch):
7171
('x86_64', 'manylinux1', 'quay.io/pypa/manylinux1_x86_64:*'),
7272
('x86_64', 'manylinux2010', 'quay.io/pypa/manylinux2010_x86_64:*'),
7373
('x86_64', 'manylinux2014', 'quay.io/pypa/manylinux2014_x86_64:*'),
74+
('x86_64', 'manylinux_2_24', 'quay.io/pypa/manylinux_2_24_x86_64:*'),
7475
('x86_64', 'custom_image', 'custom_image'),
7576
('i686', None, 'quay.io/pypa/manylinux2010_i686:*'),
7677
('i686', 'manylinux1', 'quay.io/pypa/manylinux1_i686:*'),
7778
('i686', 'manylinux2010', 'quay.io/pypa/manylinux2010_i686:*'),
7879
('i686', 'manylinux2014', 'quay.io/pypa/manylinux2014_i686:*'),
80+
('i686', 'manylinux_2_24', 'quay.io/pypa/manylinux_2_24_i686:*'),
7981
('i686', 'custom_image', 'custom_image'),
8082
('pypy_x86_64', None, 'pypywheels/manylinux2010-pypy_x86_64:*'),
8183
('pypy_x86_64', 'manylinux1', 'manylinux1'), # Does not exist

0 commit comments

Comments
 (0)