Skip to content

Commit d03df9a

Browse files
committed
feature: add manylinux_2_28 support
1 parent c5c1766 commit d03df9a

File tree

5 files changed

+68
-34
lines changed

5 files changed

+68
-34
lines changed

bin/update_docker.py

Lines changed: 6 additions & 0 deletions
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),
Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,48 @@
11
[x86_64]
2-
manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-05-22-74adb27
3-
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-05-22-fbe07ea
4-
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-05-22-fbe07ea
5-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-05-22-fbe07ea
6-
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-05-22-fbe07ea
2+
manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-06-05-89b8e6d
3+
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-05-61145a4
4+
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-05-61145a4
5+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-05-61145a4
6+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-05-61145a4
7+
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-06-05-61145a4
78

89
[i686]
9-
manylinux1 = quay.io/pypa/manylinux1_i686:2022-05-22-74adb27
10-
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-05-22-fbe07ea
11-
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-05-22-fbe07ea
12-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-05-22-fbe07ea
13-
musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-05-22-fbe07ea
10+
manylinux1 = quay.io/pypa/manylinux1_i686:2022-06-05-89b8e6d
11+
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-05-61145a4
12+
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-06-05-61145a4
13+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-05-61145a4
14+
musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-06-05-61145a4
1415

1516
[pypy_x86_64]
16-
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-05-22-fbe07ea
17-
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-05-22-fbe07ea
18-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-05-22-fbe07ea
17+
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-06-05-61145a4
18+
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-06-05-61145a4
19+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-06-05-61145a4
20+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_x86_64:2022-06-05-61145a4
1921

2022
[pypy_i686]
21-
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-05-22-fbe07ea
22-
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-05-22-fbe07ea
23-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-05-22-fbe07ea
23+
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-06-05-61145a4
24+
manylinux2014 = quay.io/pypa/manylinux2014_i686:2022-06-05-61145a4
25+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-06-05-61145a4
2426

2527
[aarch64]
26-
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-05-22-fbe07ea
27-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-05-22-fbe07ea
28-
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-05-22-fbe07ea
28+
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-05-61145a4
29+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-05-61145a4
30+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-05-61145a4
31+
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-06-05-61145a4
2932

3033
[ppc64le]
31-
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-05-22-fbe07ea
32-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-05-22-fbe07ea
33-
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-05-22-fbe07ea
34+
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-06-05-61145a4
35+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-06-05-61145a4
36+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_ppc64le:2022-06-05-61145a4
37+
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-06-05-61145a4
3438

3539
[s390x]
36-
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2022-05-22-fbe07ea
37-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2022-05-22-fbe07ea
38-
musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-05-22-fbe07ea
40+
manylinux2014 = quay.io/pypa/manylinux2014_s390x:2022-06-05-61145a4
41+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2022-06-05-61145a4
42+
musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-06-05-61145a4
3943

4044
[pypy_aarch64]
41-
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-05-22-fbe07ea
42-
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-05-22-fbe07ea
45+
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-06-05-61145a4
46+
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-06-05-61145a4
47+
manylinux_2_28 = quay.io/pypa/manylinux_2_28_aarch64:2022-06-05-61145a4
4348

docs/options.md

Lines changed: 3 additions & 3 deletions
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

Lines changed: 25 additions & 4 deletions
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

Lines changed: 2 additions & 0 deletions
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)