Skip to content

Commit

Permalink
feature: add manylinux_2_28 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mayeut committed Mar 12, 2022
1 parent 13b6541 commit 56d60ee
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
6 changes: 6 additions & 0 deletions bin/update_docker.py
Expand Up @@ -45,6 +45,12 @@ class Image(NamedTuple):
Image("manylinux_2_24", "pypy_x86_64", "quay.io/pypa/manylinux_2_24_x86_64", None),
Image("manylinux_2_24", "pypy_i686", "quay.io/pypa/manylinux_2_24_i686", None),
Image("manylinux_2_24", "pypy_aarch64", "quay.io/pypa/manylinux_2_24_aarch64", None),
# manylinux_2_28 images
Image("manylinux_2_28", "x86_64", "quay.io/pypa/manylinux_2_28_poc_x86_64", "poc"),
Image("manylinux_2_28", "aarch64", "quay.io/pypa/manylinux_2_28_poc_aarch64", "poc"),
Image("manylinux_2_28", "ppc64le", "quay.io/pypa/manylinux_2_28_poc_ppc64le", "poc"),
Image("manylinux_2_28", "pypy_x86_64", "quay.io/pypa/manylinux_2_28_poc_x86_64", "poc"),
Image("manylinux_2_28", "pypy_aarch64", "quay.io/pypa/manylinux_2_28_poc_aarch64", "poc"),
# musllinux_1_1 images
Image("musllinux_1_1", "x86_64", "quay.io/pypa/musllinux_1_1_x86_64", None),
Image("musllinux_1_1", "i686", "quay.io/pypa/musllinux_1_1_i686", None),
Expand Down
5 changes: 5 additions & 0 deletions cibuildwheel/resources/pinned_docker_images.cfg
Expand Up @@ -3,6 +3,7 @@ manylinux1 = quay.io/pypa/manylinux1_x86_64:2022-03-06-f52299e
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-03-06-4efbd88
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-03-06-4efbd88
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-03-06-4efbd88
manylinux_2_28 = quay.io/pypa/manylinux_2_28_poc_x86_64:poc
musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2022-03-06-4efbd88

[i686]
Expand All @@ -16,6 +17,7 @@ musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2022-03-06-4efbd88
manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2022-03-06-4efbd88
manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2022-03-06-4efbd88
manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2022-03-06-4efbd88
manylinux_2_28 = quay.io/pypa/manylinux_2_28_poc_x86_64:poc

[pypy_i686]
manylinux2010 = quay.io/pypa/manylinux2010_i686:2022-03-06-4efbd88
Expand All @@ -25,11 +27,13 @@ manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2022-03-06-4efbd88
[aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-03-06-4efbd88
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-03-06-4efbd88
manylinux_2_28 = quay.io/pypa/manylinux_2_28_poc_aarch64:poc
musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2022-03-06-4efbd88

[ppc64le]
manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2022-03-06-4efbd88
manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2022-03-06-4efbd88
manylinux_2_28 = quay.io/pypa/manylinux_2_28_poc_ppc64le:poc
musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2022-03-06-4efbd88

[s390x]
Expand All @@ -40,4 +44,5 @@ musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2022-03-06-4efbd88
[pypy_aarch64]
manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2022-03-06-4efbd88
manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2022-03-06-4efbd88
manylinux_2_28 = quay.io/pypa/manylinux_2_28_poc_aarch64:poc

29 changes: 25 additions & 4 deletions test/test_manylinuxXXXX_only.py
Expand Up @@ -21,17 +21,24 @@
#if !__GLIBC_PREREQ(2, 5) /* manylinux1 is glibc 2.5 */
#error "Must run on a glibc >= 2.5 linux environment"
#endif
#if __GLIBC_PREREQ(2, 28)
#include <threads.h>
#endif
"""
),
spam_c_function_add=textwrap.dedent(
r"""
#if defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 24)
#if __GLIBC_PREREQ(2, 28)
// thrd_equal & thrd_current are only available in manylinux_2_28+
sts = thrd_equal(thrd_current(), thrd_current()) ? 0 : 1;;
#elif __GLIBC_PREREQ(2, 24)
// nextupf is only available in manylinux_2_24+
sts = (int)nextupf(0.0F);
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 17) /* manylinux2014 is glibc 2.17 */
#elif __GLIBC_PREREQ(2, 17) /* manylinux2014 is glibc 2.17 */
// secure_getenv is only available in manylinux2014+
sts = (int)(intptr_t)secure_getenv("NON_EXISTING_ENV_VARIABLE");
#elif defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 10) /* manylinux2010 is glibc 2.12 */
#elif __GLIBC_PREREQ(2, 10) /* manylinux2010 is glibc 2.12 */
// malloc_info is only available on manylinux2010+
sts = malloc_info(0, stdout);
#endif
Expand All @@ -41,14 +48,19 @@


@pytest.mark.parametrize(
"manylinux_image", ["manylinux1", "manylinux2010", "manylinux2014", "manylinux_2_24"]
"manylinux_image",
["manylinux1", "manylinux2010", "manylinux2014", "manylinux_2_24", "manylinux_2_28"],
)
def test(manylinux_image, tmp_path):
if utils.platform != "linux":
pytest.skip("the docker test is only relevant to the linux build")
elif platform.machine() not in ["x86_64", "i686"]:
if manylinux_image in ["manylinux1", "manylinux2010"]:
pytest.skip("manylinux1 and 2010 doesn't exist for non-x86 architectures")
elif manylinux_image == "manylinux_2_28" and platform.machine() == "s390x":
pytest.skip("manylinux_2_28 doesn't exist for s390x architecture")
elif manylinux_image == "manylinux_2_28" and platform.machine() == "i686":
pytest.skip("manylinux_2_28 doesn't exist for i686 architecture")

project_dir = tmp_path / "project"
project_with_manylinux_symbols.generate(project_dir)
Expand All @@ -74,6 +86,9 @@ def test(manylinux_image, tmp_path):
if manylinux_image in {"manylinux2010"}:
# We don't have a manylinux2010 image for PyPy 3.9
add_env["CIBW_SKIP"] = "pp39*"
if manylinux_image == "manylinux_2_28" and platform.machine() == "x86_64":
# We don't have a manylinux_2_28 image for i686
add_env["CIBW_ARCHS"] = "x86_64"

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

Expand All @@ -91,7 +106,13 @@ def test(manylinux_image, tmp_path):
if manylinux_image in {"manylinux1"}:
# remove PyPy & CPython 3.10 and above
expected_wheels = [w for w in expected_wheels if "-pp" not in w and "-cp31" not in w]

if manylinux_image in {"manylinux2010"}:
# remove PyPy 3.9
expected_wheels = [w for w in expected_wheels if "-pp39" not in w]

if manylinux_image == "manylinux_2_28" and platform.machine() == "x86_64":
# We don't have a manylinux_2_28 image for i686
expected_wheels = [w for w in expected_wheels if "i686" not in w]

assert set(actual_wheels) == set(expected_wheels)
2 changes: 2 additions & 0 deletions unit_test/main_tests/main_options_test.py
Expand Up @@ -76,6 +76,7 @@ def test_empty_selector(platform, intercepted_build_args, monkeypatch):
("x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
("x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
("x86_64", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_x86_64:*"),
("x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_poc_x86_64:*"),
("x86_64", "custom_image", "custom_image"),
("i686", None, "quay.io/pypa/manylinux2014_i686:*"),
("i686", "manylinux1", "quay.io/pypa/manylinux1_i686:*"),
Expand All @@ -88,6 +89,7 @@ def test_empty_selector(platform, intercepted_build_args, monkeypatch):
("pypy_x86_64", "manylinux2010", "quay.io/pypa/manylinux2010_x86_64:*"),
("pypy_x86_64", "manylinux2014", "quay.io/pypa/manylinux2014_x86_64:*"),
("pypy_x86_64", "manylinux_2_24", "quay.io/pypa/manylinux_2_24_x86_64:*"),
("pypy_x86_64", "manylinux_2_28", "quay.io/pypa/manylinux_2_28_poc_x86_64:*"),
("pypy_x86_64", "custom_image", "custom_image"),
],
)
Expand Down

0 comments on commit 56d60ee

Please sign in to comment.