Skip to content

Commit 133197e

Browse files
authored
Merge pull request #1026 from mayeut/manylinux_2_28
feature: add manylinux_2_28 support
2 parents 2bc5297 + 6458604 commit 133197e

File tree

5 files changed

+41
-7
lines changed

5 files changed

+41
-7
lines changed

bin/update_docker.py

+6
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ class Image(NamedTuple):
4545
Image("manylinux_2_24", "pypy_x86_64", "quay.io/pypa/manylinux_2_24_x86_64", None),
4646
Image("manylinux_2_24", "pypy_i686", "quay.io/pypa/manylinux_2_24_i686", None),
4747
Image("manylinux_2_24", "pypy_aarch64", "quay.io/pypa/manylinux_2_24_aarch64", None),
48+
# manylinux_2_28 images
49+
Image("manylinux_2_28", "x86_64", "quay.io/pypa/manylinux_2_28_x86_64", None),
50+
Image("manylinux_2_28", "aarch64", "quay.io/pypa/manylinux_2_28_aarch64", None),
51+
Image("manylinux_2_28", "ppc64le", "quay.io/pypa/manylinux_2_28_ppc64le", None),
52+
Image("manylinux_2_28", "pypy_x86_64", "quay.io/pypa/manylinux_2_28_x86_64", None),
53+
Image("manylinux_2_28", "pypy_aarch64", "quay.io/pypa/manylinux_2_28_aarch64", None),
4854
# musllinux_1_1 images
4955
Image("musllinux_1_1", "x86_64", "quay.io/pypa/musllinux_1_1_x86_64", None),
5056
Image("musllinux_1_1", "i686", "quay.io/pypa/musllinux_1_1_i686", None),

cibuildwheel/resources/pinned_docker_images.cfg

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-06-12-a846b05
33
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-13-c365205
44
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-13-c365205
55
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-13-c365205
6+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-13-c365205
67
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-06-13-c365205
78

89
[i686]
@@ -16,6 +17,7 @@ musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-06-13-c365205
1617
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-13-c365205
1718
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-13-c365205
1819
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-13-c365205
20+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-13-c365205
1921

2022
[pypy_i686]
2123
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-13-c365205
@@ -25,11 +27,13 @@ manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-13-c365205
2527
[aarch64]
2628
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-13-c365205
2729
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-13-c365205
30+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-13-c365205
2831
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-06-13-c365205
2932

3033
[ppc64le]
3134
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-06-13-c365205
3235
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-06-13-c365205
36+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2022-06-13-c365205
3337
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-06-13-c365205
3438

3539
[s390x]
@@ -40,4 +44,5 @@ musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-06-13-c365205
4044
[pypy_aarch64]
4145
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-13-c365205
4246
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-13-c365205
47+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-13-c365205
4348

docs/options.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -886,14 +886,14 @@ The available options are (default value):
886886

887887
Set an alternative Docker image to be used for building [manylinux / musllinux](https://github.com/pypa/manylinux) wheels.
888888

889-
For `CIBW_MANYLINUX_*_IMAGE`, 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). Alternatively, set these options to any other valid Docker image name. For PyPy, the `manylinux1` image is not available. For architectures other
890-
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`.
889+
For `CIBW_MANYLINUX_*_IMAGE`, the value of this option can either be set to `manylinux1`, `manylinux2010`, `manylinux2014`, `manylinux_2_24` or `manylinux_2_28` to use a pinned version of the [official manylinux images](https://github.com/pypa/manylinux). Alternatively, set these options to any other valid Docker image name. For PyPy, the `manylinux1` image is not available. For architectures other
890+
than x86 (x86\_64 and i686) `manylinux2014`, `manylinux_2_24` or `manylinux_2_28` must be used, because the first version of the manylinux specification that supports additional architectures is `manylinux2014`. `manylinux_2_28` is not supported for `i686` & `s390x` architectures.
891891

892892
For `CIBW_MUSLLINUX_*_IMAGE`, the value of this option can either be set to `musllinux_1_1` to use a pinned version of the [official musllinux images](https://github.com/pypa/musllinux). Alternatively, set these options to any other valid Docker image name.
893893

894894
If this option is blank, it will fall though to the next available definition (environment variable -> pyproject.toml -> default).
895895

896-
If setting a custom Docker image, you'll need to make sure it 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 compatible to the relevant standard to produce valid manylinux1/manylinux2010/manylinux2014/manylinux_2_24/musllinux_1_1 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/), [PEP 600](https://www.python.org/dev/peps/pep-0600/) and [PEP 656](https://www.python.org/dev/peps/pep-0656/) for more details).
896+
If setting a custom Docker image, you'll need to make sure it 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 compatible to the relevant standard to produce valid manylinux1/manylinux2010/manylinux2014/manylinux_2_24/manylinux_2_28/musllinux_1_1 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/), [PEP 600](https://www.python.org/dev/peps/pep-0600/) and [PEP 656](https://www.python.org/dev/peps/pep-0656/) for more details).
897897

898898
Auditwheel detects the version of the manylinux / musllinux 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)"'`).
899899

test/test_manylinuxXXXX_only.py

+25-4
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,24 @@
2121
#if !__GLIBC_PREREQ(2, 5) /* manylinux1 is glibc 2.5 */
2222
#error "Must run on a glibc >= 2.5 linux environment"
2323
#endif
24+
25+
#if __GLIBC_PREREQ(2, 28)
26+
#include <threads.h>
27+
#endif
2428
"""
2529
),
2630
spam_c_function_add=textwrap.dedent(
2731
r"""
28-
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 24)
32+
#if __GLIBC_PREREQ(2, 28)
33+
// thrd_equal & thrd_current are only available in manylinux_2_28+
34+
sts = thrd_equal(thrd_current(), thrd_current()) ? 0 : 1;;
35+
#elif __GLIBC_PREREQ(2, 24)
2936
// nextupf is only available in manylinux_2_24+
3037
sts = (int)nextupf(0.0F);
31-
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17) /* manylinux2014 is glibc 2.17 */
38+
#elif __GLIBC_PREREQ(2, 17) /* manylinux2014 is glibc 2.17 */
3239
// secure_getenv is only available in manylinux2014+
3340
sts = (int)(intptr_t)secure_getenv("NON_EXISTING_ENV_VARIABLE");
34-
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) /* manylinux2010 is glibc 2.12 */
41+
#elif __GLIBC_PREREQ(2, 10) /* manylinux2010 is glibc 2.12 */
3542
// malloc_info is only available on manylinux2010+
3643
sts = malloc_info(0, stdout);
3744
#endif
@@ -41,14 +48,19 @@
4148

4249

4350
@pytest.mark.parametrize(
44-
"manylinux_image", ["manylinux1", "manylinux2010", "manylinux2014", "manylinux_2_24"]
51+
"manylinux_image",
52+
["manylinux1", "manylinux2010", "manylinux2014", "manylinux_2_24", "manylinux_2_28"],
4553
)
4654
def test(manylinux_image, tmp_path):
4755
if utils.platform != "linux":
4856
pytest.skip("the docker test is only relevant to the linux build")
4957
elif platform.machine() not in ["x86_64", "i686"]:
5058
if manylinux_image in ["manylinux1", "manylinux2010"]:
5159
pytest.skip("manylinux1 and 2010 doesn't exist for non-x86 architectures")
60+
elif manylinux_image == "manylinux_2_28" and platform.machine() == "s390x":
61+
pytest.skip("manylinux_2_28 doesn't exist for s390x architecture")
62+
elif manylinux_image == "manylinux_2_28" and platform.machine() == "i686":
63+
pytest.skip("manylinux_2_28 doesn't exist for i686 architecture")
5264

5365
project_dir = tmp_path / "project"
5466
project_with_manylinux_symbols.generate(project_dir)
@@ -74,6 +86,9 @@ def test(manylinux_image, tmp_path):
7486
if manylinux_image in {"manylinux2010"}:
7587
# We don't have a manylinux2010 image for PyPy 3.9, CPython 3.11
7688
add_env["CIBW_SKIP"] = "pp39* cp311*"
89+
if manylinux_image == "manylinux_2_28" and platform.machine() == "x86_64":
90+
# We don't have a manylinux_2_28 image for i686
91+
add_env["CIBW_ARCHS"] = "x86_64"
7792

7893
actual_wheels = utils.cibuildwheel_run(project_dir, add_env=add_env)
7994

@@ -91,7 +106,13 @@ def test(manylinux_image, tmp_path):
91106
if manylinux_image in {"manylinux1"}:
92107
# remove PyPy & CPython 3.10 and above
93108
expected_wheels = [w for w in expected_wheels if "-pp" not in w and "-cp31" not in w]
109+
94110
if manylinux_image in {"manylinux2010"}:
95111
# remove PyPy 3.9 & CPython 3.11
96112
expected_wheels = [w for w in expected_wheels if "-pp39" not in w and "-cp311" not in w]
113+
114+
if manylinux_image == "manylinux_2_28" and platform.machine() == "x86_64":
115+
# We don't have a manylinux_2_28 image for i686
116+
expected_wheels = [w for w in expected_wheels if "i686" not in w]
117+
97118
assert set(actual_wheels) == set(expected_wheels)

unit_test/main_tests/main_options_test.py

+2
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ def test_empty_selector(platform, intercepted_build_args, monkeypatch):
8080
("x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
8181
("x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
8282
("x86_64", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_x86_64:*"),
83+
("x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_x86_64:*"),
8384
("x86_64", "custom_image", "custom_image"),
8485
("i686", None, "quay.io/pypa/manylinux2014_i686:*"),
8586
("i686", "manylinux1", "quay.io/pypa/manylinux1_i686:*"),
@@ -92,6 +93,7 @@ def test_empty_selector(platform, intercepted_build_args, monkeypatch):
9293
("pypy_x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
9394
("pypy_x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
9495
("pypy_x86_64", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_x86_64:*"),
96+
("pypy_x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_x86_64:*"),
9597
("pypy_x86_64", "custom_image", "custom_image"),
9698
],
9799
)

0 commit comments

Comments
 (0)