From 731e2c85bfa0b165078be7f33c7810f5dce8d4e3 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 18 Jul 2021 18:29:11 +0200 Subject: [PATCH 1/6] feat: add musllinux support (PEP 656) Add musllinux support (PEP 656) allowing to build wheels for musl libc based distros (e.g. Alpine) --- bin/update_docker.py | 13 ++++-- cibuildwheel/__main__.py | 31 ++++++++++++- cibuildwheel/linux.py | 6 +++ cibuildwheel/logger.py | 5 +++ cibuildwheel/resources/build-platforms.toml | 25 +++++++++++ cibuildwheel/resources/defaults.toml | 6 +++ .../resources/pinned_docker_images.cfg | 45 ++++++++++--------- cibuildwheel/util.py | 1 + test/test_0_basic.py | 4 +- test/test_docker_images.py | 4 +- test/test_manylinuxXXXX_only.py | 6 ++- test/utils.py | 14 ++++++ 12 files changed, 131 insertions(+), 29 deletions(-) diff --git a/bin/update_docker.py b/bin/update_docker.py index 2e97a8e6f..73da5a1ba 100755 --- a/bin/update_docker.py +++ b/bin/update_docker.py @@ -19,14 +19,15 @@ class Image(NamedTuple): images = [ + # manylinux1 images Image("manylinux1", "x86_64", "quay.io/pypa/manylinux1_x86_64", None), Image("manylinux1", "i686", "quay.io/pypa/manylinux1_i686", None), - # 2010 images + # manylinux2010 images Image("manylinux2010", "x86_64", "quay.io/pypa/manylinux2010_x86_64", None), Image("manylinux2010", "i686", "quay.io/pypa/manylinux2010_i686", None), Image("manylinux2010", "pypy_x86_64", "quay.io/pypa/manylinux2010_x86_64", None), Image("manylinux2010", "pypy_i686", "quay.io/pypa/manylinux2010_i686", None), - # 2014 images + # manylinux2014 images Image("manylinux2014", "x86_64", "quay.io/pypa/manylinux2014_x86_64", None), Image("manylinux2014", "i686", "quay.io/pypa/manylinux2014_i686", None), Image("manylinux2014", "aarch64", "quay.io/pypa/manylinux2014_aarch64", None), @@ -35,7 +36,7 @@ class Image(NamedTuple): Image("manylinux2014", "pypy_x86_64", "quay.io/pypa/manylinux2014_x86_64", None), Image("manylinux2014", "pypy_i686", "quay.io/pypa/manylinux2014_i686", None), Image("manylinux2014", "pypy_aarch64", "quay.io/pypa/manylinux2014_aarch64", None), - # 2_24 images + # manylinux_2_24 images Image("manylinux_2_24", "x86_64", "quay.io/pypa/manylinux_2_24_x86_64", None), Image("manylinux_2_24", "i686", "quay.io/pypa/manylinux_2_24_i686", None), Image("manylinux_2_24", "aarch64", "quay.io/pypa/manylinux_2_24_aarch64", None), @@ -44,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), + # 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), + Image("musllinux_1_1", "aarch64", "quay.io/pypa/musllinux_1_1_aarch64", None), + Image("musllinux_1_1", "ppc64le", "quay.io/pypa/musllinux_1_1_ppc64le", None), + Image("musllinux_1_1", "s390x", "quay.io/pypa/musllinux_1_1_s390x", None), ] config = configparser.ConfigParser() diff --git a/cibuildwheel/__main__.py b/cibuildwheel/__main__.py index 9d1421ed9..22d3db5ab 100644 --- a/cibuildwheel/__main__.py +++ b/cibuildwheel/__main__.py @@ -41,6 +41,14 @@ "pypy_i686", ) +MUSLLINUX_ARCHS = ( + "x86_64", + "i686", + "aarch64", + "ppc64le", + "s390x", +) + def main() -> None: platform: PlatformName @@ -167,10 +175,13 @@ def main() -> None: manylinux_identifiers = { f"manylinux-{build_platform}-image" for build_platform in MANYLINUX_ARCHS } + musllinux_identifiers = { + f"musllinux-{build_platform}-image" for build_platform in MUSLLINUX_ARCHS + } disallow = { "linux": {"dependency-versions"}, - "macos": manylinux_identifiers, - "windows": manylinux_identifiers, + "macos": manylinux_identifiers | musllinux_identifiers, + "windows": manylinux_identifiers | musllinux_identifiers, } options = ConfigOptions(package_dir, args.config_file, platform=platform, disallow=disallow) output_dir = Path( @@ -278,6 +289,7 @@ def main() -> None: sys.exit(0) manylinux_images: Dict[str, str] = {} + musllinux_images: Dict[str, str] = {} if platform == "linux": pinned_docker_images_file = resources_dir / "pinned_docker_images.cfg" all_pinned_docker_images = ConfigParser() @@ -303,6 +315,20 @@ def main() -> None: manylinux_images[build_platform] = image + for build_platform in MUSLLINUX_ARCHS: + pinned_images = all_pinned_docker_images[build_platform] + + config_value = options(f"musllinux-{build_platform}-image") + + if config_value is None: + image = pinned_images.get("musllinux_1_1") + elif config_value in pinned_images: + image = pinned_images[config_value] + else: + image = config_value + + musllinux_images[build_platform] = image + build_options = BuildOptions( architectures=archs, package_dir=package_dir, @@ -320,6 +346,7 @@ def main() -> None: environment=environment, dependency_constraints=dependency_constraints, manylinux_images=manylinux_images or None, + musllinux_images=musllinux_images or None, build_frontend=build_frontend, ) diff --git a/cibuildwheel/linux.py b/cibuildwheel/linux.py index 24008cdf6..321101e96 100644 --- a/cibuildwheel/linux.py +++ b/cibuildwheel/linux.py @@ -61,6 +61,7 @@ def build(options: BuildOptions) -> None: sys.exit(2) assert options.manylinux_images is not None + assert options.musllinux_images is not None python_configurations = get_python_configurations(options.build_selector, options.architectures) platforms = [ ("cp", "manylinux_x86_64", options.manylinux_images["x86_64"]), @@ -71,6 +72,11 @@ def build(options: BuildOptions) -> None: ("pp", "manylinux_x86_64", options.manylinux_images["pypy_x86_64"]), ("pp", "manylinux_aarch64", options.manylinux_images["pypy_aarch64"]), ("pp", "manylinux_i686", options.manylinux_images["pypy_i686"]), + ("cp", "musllinux_x86_64", options.musllinux_images["x86_64"]), + ("cp", "musllinux_i686", options.musllinux_images["i686"]), + ("cp", "musllinux_aarch64", options.musllinux_images["aarch64"]), + ("cp", "musllinux_ppc64le", options.musllinux_images["ppc64le"]), + ("cp", "musllinux_s390x", options.musllinux_images["s390x"]), ] cwd = Path.cwd() diff --git a/cibuildwheel/logger.py b/cibuildwheel/logger.py index 0ade9751a..12c4462a3 100644 --- a/cibuildwheel/logger.py +++ b/cibuildwheel/logger.py @@ -20,6 +20,11 @@ "manylinux_aarch64": "manylinux aarch64", "manylinux_ppc64le": "manylinux ppc64le", "manylinux_s390x": "manylinux s390x", + "musllinux_x86_64": "musllinux x86_64", + "musllinux_i686": "musllinux i686", + "musllinux_aarch64": "musllinux aarch64", + "musllinux_ppc64le": "musllinux ppc64le", + "musllinux_s390x": "manylinux s390x", "win32": "Windows 32bit", "win_amd64": "Windows 64bit", "macosx_x86_64": "macOS x86_64", diff --git a/cibuildwheel/resources/build-platforms.toml b/cibuildwheel/resources/build-platforms.toml index 740dc6c8e..5f1b24257 100644 --- a/cibuildwheel/resources/build-platforms.toml +++ b/cibuildwheel/resources/build-platforms.toml @@ -28,6 +28,31 @@ python_configurations = [ { identifier = "cp310-manylinux_s390x", version = "3.10", path_str = "/opt/python/cp310-cp310" }, { identifier = "pp37-manylinux_aarch64", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" }, { identifier = "pp37-manylinux_i686", version = "3.7", path_str = "/opt/python/pp37-pypy37_pp73" }, + { identifier = "cp36-musllinux_x86_64", version = "3.6", path_str = "/opt/python/cp36-cp36m" }, + { identifier = "cp37-musllinux_x86_64", version = "3.7", path_str = "/opt/python/cp37-cp37m" }, + { identifier = "cp38-musllinux_x86_64", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-musllinux_x86_64", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-musllinux_x86_64", version = "3.10", path_str = "/opt/python/cp310-cp310" }, + { identifier = "cp36-musllinux_i686", version = "3.6", path_str = "/opt/python/cp36-cp36m" }, + { identifier = "cp37-musllinux_i686", version = "3.7", path_str = "/opt/python/cp37-cp37m" }, + { identifier = "cp38-musllinux_i686", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-musllinux_i686", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-musllinux_i686", version = "3.10", path_str = "/opt/python/cp310-cp310" }, + { identifier = "cp36-musllinux_aarch64", version = "3.6", path_str = "/opt/python/cp36-cp36m" }, + { identifier = "cp37-musllinux_aarch64", version = "3.7", path_str = "/opt/python/cp37-cp37m" }, + { identifier = "cp38-musllinux_aarch64", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-musllinux_aarch64", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-musllinux_aarch64", version = "3.10", path_str = "/opt/python/cp310-cp310" }, + { identifier = "cp36-musllinux_ppc64le", version = "3.6", path_str = "/opt/python/cp36-cp36m" }, + { identifier = "cp37-musllinux_ppc64le", version = "3.7", path_str = "/opt/python/cp37-cp37m" }, + { identifier = "cp38-musllinux_ppc64le", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-musllinux_ppc64le", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-musllinux_ppc64le", version = "3.10", path_str = "/opt/python/cp310-cp310" }, + { identifier = "cp36-musllinux_s390x", version = "3.6", path_str = "/opt/python/cp36-cp36m" }, + { identifier = "cp37-musllinux_s390x", version = "3.7", path_str = "/opt/python/cp37-cp37m" }, + { identifier = "cp38-musllinux_s390x", version = "3.8", path_str = "/opt/python/cp38-cp38" }, + { identifier = "cp39-musllinux_s390x", version = "3.9", path_str = "/opt/python/cp39-cp39" }, + { identifier = "cp310-musllinux_s390x", version = "3.10", path_str = "/opt/python/cp310-cp310" }, ] [macos] diff --git a/cibuildwheel/resources/defaults.toml b/cibuildwheel/resources/defaults.toml index 5bf179c89..3c7d3583a 100644 --- a/cibuildwheel/resources/defaults.toml +++ b/cibuildwheel/resources/defaults.toml @@ -27,6 +27,12 @@ manylinux-pypy_x86_64-image = "manylinux2010" manylinux-pypy_i686-image = "manylinux2010" manylinux-pypy_aarch64-image = "manylinux2014" +musllinux-x86_64-image = "musllinux_1_1" +musllinux-i686-image = "musllinux_1_1" +musllinux-aarch64-image = "musllinux_1_1" +musllinux-ppc64le-image = "musllinux_1_1" +musllinux-s390x-image = "musllinux_1_1" + [tool.cibuildwheel.linux] repair-wheel-command = "auditwheel repair -w {dest_dir} {wheel}" diff --git a/cibuildwheel/resources/pinned_docker_images.cfg b/cibuildwheel/resources/pinned_docker_images.cfg index 20b564f92..5d3ac3124 100644 --- a/cibuildwheel/resources/pinned_docker_images.cfg +++ b/cibuildwheel/resources/pinned_docker_images.cfg @@ -1,38 +1,43 @@ [x86_64] manylinux1 = quay.io/pypa/manylinux1_x86_64:2021-09-18-65abb78 -manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-09-18-c1afc21 -manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-09-18-c1afc21 +manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-09-18-f12faf3 +manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-09-18-f12faf3 +musllinux_1_1 = quay.io/pypa/musllinux_1_1_x86_64:2021-09-18-f12faf3 [i686] manylinux1 = quay.io/pypa/manylinux1_i686:2021-09-18-65abb78 -manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-09-18-c1afc21 -manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-09-18-c1afc21 +manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-09-18-f12faf3 +manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-09-18-f12faf3 +musllinux_1_1 = quay.io/pypa/musllinux_1_1_i686:2021-09-18-f12faf3 [pypy_x86_64] -manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-09-18-c1afc21 -manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-09-18-c1afc21 +manylinux2010 = quay.io/pypa/manylinux2010_x86_64:2021-09-18-f12faf3 +manylinux2014 = quay.io/pypa/manylinux2014_x86_64:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_x86_64:2021-09-18-f12faf3 [pypy_i686] -manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-09-18-c1afc21 -manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-09-18-c1afc21 +manylinux2010 = quay.io/pypa/manylinux2010_i686:2021-09-18-f12faf3 +manylinux2014 = quay.io/pypa/manylinux2014_i686:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_i686:2021-09-18-f12faf3 [aarch64] -manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2021-09-18-c1afc21 +manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2021-09-18-f12faf3 +musllinux_1_1 = quay.io/pypa/musllinux_1_1_aarch64:2021-09-18-f12faf3 [ppc64le] -manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2021-09-18-c1afc21 +manylinux2014 = quay.io/pypa/manylinux2014_ppc64le:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_ppc64le:2021-09-18-f12faf3 +musllinux_1_1 = quay.io/pypa/musllinux_1_1_ppc64le:2021-09-18-f12faf3 [s390x] -manylinux2014 = quay.io/pypa/manylinux2014_s390x:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2021-09-18-c1afc21 +manylinux2014 = quay.io/pypa/manylinux2014_s390x:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_s390x:2021-09-18-f12faf3 +musllinux_1_1 = quay.io/pypa/musllinux_1_1_s390x:2021-09-18-f12faf3 [pypy_aarch64] -manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-09-18-c1afc21 -manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2021-09-18-c1afc21 +manylinux2014 = quay.io/pypa/manylinux2014_aarch64:2021-09-18-f12faf3 +manylinux_2_24 = quay.io/pypa/manylinux_2_24_aarch64:2021-09-18-f12faf3 diff --git a/cibuildwheel/util.py b/cibuildwheel/util.py index 581799cf8..3d9eb1be6 100644 --- a/cibuildwheel/util.py +++ b/cibuildwheel/util.py @@ -215,6 +215,7 @@ class BuildOptions(NamedTuple): before_build: Optional[str] repair_command: str manylinux_images: Optional[Dict[str, str]] + musllinux_images: Optional[Dict[str, str]] dependency_constraints: Optional[DependencyConstraints] test_command: Optional[str] test_selector: TestSelector diff --git a/test/test_0_basic.py b/test/test_0_basic.py index 8f2cd4bfb..ec72483a3 100644 --- a/test/test_0_basic.py +++ b/test/test_0_basic.py @@ -56,4 +56,6 @@ def test_build_identifiers(tmp_path): build_identifiers = utils.cibuildwheel_get_build_identifiers( project_dir, prerelease_pythons=True ) - assert len(expected_wheels) == len(build_identifiers) + assert len(expected_wheels) == len( + build_identifiers + ), f"{expected_wheels} vs {build_identifiers}" diff --git a/test/test_docker_images.py b/test/test_docker_images.py index 260c74142..015f40696 100644 --- a/test/test_docker_images.py +++ b/test/test_docker_images.py @@ -37,14 +37,14 @@ def test(tmp_path): add_env={ "CIBW_MANYLINUX_X86_64_IMAGE": "dockcross/manylinux2010-x64", "CIBW_MANYLINUX_I686_IMAGE": "dockcross/manylinux2010-x86", - "CIBW_BUILD": "cp3{6,7,8,9}-*", + "CIBW_BUILD": "cp3{6,7,8,9}-manylinux*", }, ) # also check that we got the right wheels built expected_wheels = [ w - for w in utils.expected_wheels("spam", "0.1.0") + for w in utils.expected_wheels("spam", "0.1.0", musllinux_versions=[]) if "-cp36-" in w or "-cp37-" in w or "-cp38-" in w or "-cp39-" in w ] assert set(actual_wheels) == set(expected_wheels) diff --git a/test/test_manylinuxXXXX_only.py b/test/test_manylinuxXXXX_only.py index c4b88b7cb..f7c533d49 100644 --- a/test/test_manylinuxXXXX_only.py +++ b/test/test_manylinuxXXXX_only.py @@ -57,6 +57,7 @@ def test(manylinux_image, tmp_path): # CFLAGS environment variable is necessary to fail on 'malloc_info' (on manylinux1) during compilation/linking, # rather than when dynamically loading the Python add_env = { + "CIBW_BUILD": "*-manylinux*", "CIBW_ENVIRONMENT": 'CFLAGS="$CFLAGS -O0 -Werror=implicit-function-declaration"', "CIBW_MANYLINUX_X86_64_IMAGE": manylinux_image, "CIBW_MANYLINUX_I686_IMAGE": manylinux_image, @@ -79,7 +80,10 @@ def test(manylinux_image, tmp_path): "manylinux2014": ["manylinux_2_17", "manylinux2014"], } expected_wheels = utils.expected_wheels( - "spam", "0.1.0", manylinux_versions=platform_tag_map.get(manylinux_image, [manylinux_image]) + "spam", + "0.1.0", + manylinux_versions=platform_tag_map.get(manylinux_image, [manylinux_image]), + musllinux_versions=[], ) if manylinux_image in {"manylinux1"}: # remove PyPy & CPython 3.10 and above diff --git a/test/utils.py b/test/utils.py index c1baf4d93..524f77473 100644 --- a/test/utils.py +++ b/test/utils.py @@ -103,6 +103,7 @@ def expected_wheels( package_name, package_version, manylinux_versions=None, + musllinux_versions=None, macosx_deployment_target="10.9", machine_arch=None, ): @@ -123,6 +124,9 @@ def expected_wheels( else: manylinux_versions = ["manylinux_2_17", "manylinux2014"] + if musllinux_versions is None: + musllinux_versions = ["musllinux_1_1"] + python_abi_tags = ["cp36-cp36m", "cp37-cp37m", "cp38-cp38", "cp39-cp39", "cp310-cp310"] if machine_arch in ["x86_64", "AMD64", "x86", "aarch64"]: @@ -155,6 +159,16 @@ def expected_wheels( ) for architecture in architectures ] + if len(musllinux_versions) > 0 and not python_abi_tag.startswith("pp"): + platform_tags.extend( + [ + ".".join( + f"{musllinux_version}_{architecture}" + for musllinux_version in musllinux_versions + ) + for architecture in architectures + ] + ) elif platform == "windows": if python_abi_tag.startswith("cp"): From a4241ce4d223276d379277ebba11416b0538d67b Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 19 Sep 2021 11:10:24 +0200 Subject: [PATCH 2/6] feat: add musllinux support (PEP 656) doc --- README.md | 21 +++++++++++---------- docs/faq.md | 6 +++--- docs/options.md | 45 ++++++++++++++++++++++++++++++++------------- 3 files changed, 46 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index f43b05f04..26171c1d2 100644 --- a/README.md +++ b/README.md @@ -22,17 +22,17 @@ Python wheels are great. Building them across **Mac, Linux, Windows**, on **mult What does it do? ---------------- -| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux i686 | manylinux aarch64 | manylinux ppc64le | manylinux s390x | -|---------------|----|-----|-----|-----|----|-----|----|-----|-----| -| CPython 3.6 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.7 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| PyPy 3.7 v7.3 | ✅ | N/A | ✅ | N/A | ✅ | ✅ | ✅ | N/A | N/A | +| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux i686 | manylinux aarch64 | manylinux ppc64le | manylinux s390x | musllinux x86_64 | musllinux i686 | musllinux aarch64 | musllinux ppc64le | musllinux s390x | +|---------------|----|-----|-----|-----|----|-----|----|-----|-----|----|-----|----|-----|-----| +| CPython 3.6 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.7 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| PyPy 3.7 v7.3 | ✅ | N/A | ✅ | N/A | ✅ | ✅ | ✅ | N/A | N/A | N/A | N/A | N/A | N/A | N/A | -- Builds manylinux, macOS 10.9+, and Windows wheels for CPython and PyPy +- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy - Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI - Bundles shared library dependencies on Linux and macOS through [auditwheel](https://github.com/pypa/auditwheel) and [delocate](https://github.com/matthew-brett/delocate) - Runs your library's tests against the wheel-installed version of your library @@ -62,7 +62,7 @@ Usage Example setup ------------- -To build manylinux, macOS, and Windows wheels on GitHub Actions, you could use this `.github/workflows/wheels.yml`: +To build manylinux, musllinux, macOS, and Windows wheels on GitHub Actions, you could use this `.github/workflows/wheels.yml`: ```yaml name: Build @@ -115,6 +115,7 @@ Options | | [`CIBW_BEFORE_BUILD`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build | | | [`CIBW_REPAIR_WHEEL_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each (non-pure Python) built wheel | | | [`CIBW_MANYLINUX_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) | Specify alternative manylinux Docker images | +| | [`CIBW_MUSLLINUX_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#musllinux-image) | Specify alternative musllinux Docker images | | | [`CIBW_DEPENDENCY_VERSIONS`](https://cibuildwheel.readthedocs.io/en/stable/options/#dependency-versions) | Specify how cibuildwheel controls the versions of the tools it uses | | **Testing** | [`CIBW_TEST_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#test-command) | Execute a shell command to test each built wheel | | | [`CIBW_BEFORE_TEST`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-test) | Execute a shell command before testing each wheel | diff --git a/docs/faq.md b/docs/faq.md index dedcf19b9..132935477 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -6,15 +6,15 @@ title: Tips and tricks ### Linux builds on Docker -Linux wheels are built in the [`manylinux` docker images](https://github.com/pypa/manylinux) to provide binary compatible wheels on Linux, according to [PEP 571](https://www.python.org/dev/peps/pep-0571/). Because of this, when building with `cibuildwheel` on Linux, a few things should be taken into account: +Linux wheels are built in the [`manylinux`/`musllinux` docker images](https://github.com/pypa/manylinux) to provide binary compatible wheels on Linux, according to [PEP 600](https://www.python.org/dev/peps/pep-0600/) / [PEP 656](https://www.python.org/dev/peps/pep-0656/). Because of this, when building with `cibuildwheel` on Linux, a few things should be taken into account: -- Programs and libraries are not installed on the CI runner host, but rather should be installed inside of the Docker image - using `yum` for `manylinux2010` or `manylinux2014`, and `apt-get` for `manylinux_2_24`, or manually. The same goes for environment variables that are potentially needed to customize the wheel building. +- Programs and libraries are not installed on the CI runner host, but rather should be installed inside of the Docker image - using `yum` for `manylinux2010` or `manylinux2014`, `apt-get` for `manylinux_2_24` and `apk` for `musllinux_1_1`, or manually. The same goes for environment variables that are potentially needed to customize the wheel building. `cibuildwheel` supports this by providing the [`CIBW_ENVIRONMENT`](options.md#environment) and [`CIBW_BEFORE_ALL`](options.md#before-all) options to setup the build environment inside the running Docker image. - The project directory is mounted in the running Docker instance as `/project`, the output directory for the wheels as `/output`. In general, this is handled transparently by `cibuildwheel`. For a more finegrained level of control however, the root of the host file system is mounted as `/host`, allowing for example to access shared files, caches, etc. on the host file system. Note that `/host` is not available on CircleCI due to their Docker policies. -- Alternative Docker images can be specified with the `CIBW_MANYLINUX_*_IMAGE` options to allow for a custom, preconfigured build environment for the Linux builds. See [options](options.md#manylinux-image) for more details. +- Alternative Docker images can be specified with the `CIBW_MANYLINUX_*_IMAGE`/`CIBW_MUSLLINUX_*_IMAGE` options to allow for a custom, preconfigured build environment for the Linux builds. See [options](options.md#manylinux-image) for more details. ### Building macOS wheels for Apple Silicon {: #apple-silicon} diff --git a/docs/options.md b/docs/options.md index 4d1af90db..2e66a445d 100644 --- a/docs/options.md +++ b/docs/options.md @@ -151,15 +151,14 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat
-| | macOS | Windows | Manylinux Intel | Manylinux Other | -|--------------|------------------------------------------------------------------------|----------------------------------|--------------------------------------------------|-------------------------------------------------------------------------------| -| Python 3.6 | cp36-macosx_x86_64 | cp36-win_amd64
cp36-win32 | cp36-manylinux_x86_64
cp36-manylinux_i686 | cp36-manylinux_aarch64
cp36-manylinux_ppc64le
cp36-manylinux_s390x | -| Python 3.7 | cp37-macosx_x86_64 | cp37-win_amd64
cp37-win32 | cp37-manylinux_x86_64
cp37-manylinux_i686 | cp37-manylinux_aarch64
cp37-manylinux_ppc64le
cp37-manylinux_s390x | -| Python 3.8 | cp38-macosx_x86_64
cp38-macosx_universal2
cp38-macosx_arm64 | cp38-win_amd64
cp38-win32 | cp38-manylinux_x86_64
cp38-manylinux_i686 | cp38-manylinux_aarch64
cp38-manylinux_ppc64le
cp38-manylinux_s390x | -| Python 3.9 | cp39-macosx_x86_64
cp39-macosx_universal2
cp39-macosx_arm64 | cp39-win_amd64
cp39-win32 | cp39-manylinux_x86_64
cp39-manylinux_i686 | cp39-manylinux_aarch64
cp39-manylinux_ppc64le
cp39-manylinux_s390x | -| Python 3.10 | cp310-macosx_x86_64
cp310-macosx_universal2
cp310-macosx_arm64 | cp310-win_amd64
cp310-win32 | cp310-manylinux_x86_64
cp310-manylinux_i686 | cp310-manylinux_aarch64
cp310-manylinux_ppc64le
cp310-manylinux_s390x | -| PyPy3.7 v7.3 | pp37-macosx_x86_64 | pp37-win_amd64 | pp37-manylinux_x86_64 | | - +| | macOS | Windows | Manylinux Intel | Manylinux Other | Musllinux Intel | Musllinux Other | +|--------------|------------------------------------------------------------------------|----------------------------------|--------------------------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------|-------------------------------------------------------------------------------| +| Python 3.6 | cp36-macosx_x86_64 | cp36-win_amd64
cp36-win32 | cp36-manylinux_x86_64
cp36-manylinux_i686 | cp36-manylinux_aarch64
cp36-manylinux_ppc64le
cp36-manylinux_s390x | cp36-musllinux_x86_64
cp36-musllinux_i686 | cp36-musllinux_aarch64
cp36-musllinux_ppc64le
cp36-musllinux_s390x | +| Python 3.7 | cp37-macosx_x86_64 | cp37-win_amd64
cp37-win32 | cp37-manylinux_x86_64
cp37-manylinux_i686 | cp37-manylinux_aarch64
cp37-manylinux_ppc64le
cp37-manylinux_s390x | cp37-musllinux_x86_64
cp37-musllinux_i686 | cp37-musllinux_aarch64
cp37-musllinux_ppc64le
cp37-musllinux_s390x | +| Python 3.8 | cp38-macosx_x86_64
cp38-macosx_universal2
cp38-macosx_arm64 | cp38-win_amd64
cp38-win32 | cp38-manylinux_x86_64
cp38-manylinux_i686 | cp38-manylinux_aarch64
cp38-manylinux_ppc64le
cp38-manylinux_s390x | cp38-musllinux_x86_64
cp38-musllinux_i686 | cp38-musllinux_aarch64
cp38-musllinux_ppc64le
cp38-musllinux_s390x | +| Python 3.9 | cp39-macosx_x86_64
cp39-macosx_universal2
cp39-macosx_arm64 | cp39-win_amd64
cp39-win32 | cp39-manylinux_x86_64
cp39-manylinux_i686 | cp39-manylinux_aarch64
cp39-manylinux_ppc64le
cp39-manylinux_s390x | cp39-musllinux_x86_64
cp39-musllinux_i686 | cp39-musllinux_aarch64
cp39-musllinux_ppc64le
cp39-musllinux_s390x | +| Python 3.10 | cp310-macosx_x86_64
cp310-macosx_universal2
cp310-macosx_arm64 | cp310-win_amd64
cp310-win32 | cp310-manylinux_x86_64
cp310-manylinux_i686 | cp310-manylinux_aarch64
cp310-manylinux_ppc64le
cp310-manylinux_s390x | cp310-musllinux_x86_64
cp310-musllinux_i686 | cp310-musllinux_aarch64
cp310-musllinux_ppc64le
cp310-musllinux_s390x | +| PyPy3.7 v7.3 | pp37-macosx_x86_64 | pp37-win_amd64 | pp37-manylinux_x86_64 | | | | The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to cibuildwheel. The format is `python_tag-platform_tag`, with tags similar to those in [PEP 425](https://www.python.org/dev/peps/pep-0425/#details). @@ -863,6 +862,26 @@ Auditwheel detects the version of the manylinux standard in the Docker image thr Like any other option, these can be placed in `[tool.cibuildwheel.linux]` if you prefer; they have no effect on `macos` and `windows`. +### CIBW_MUSLLINUX_*_IMAGE {: #musllinux-image} +> Specify alternative musllinux Docker images + +The available options are: + +- `CIBW_MUSLLINUX_X86_64_IMAGE` +- `CIBW_MUSLLINUX_I686_IMAGE` +- `CIBW_MUSLLINUX_AARCH64_IMAGE` +- `CIBW_MUSLLINUX_PPC64LE_IMAGE` +- `CIBW_MUSLLINUX_S390X_IMAGE` + +Set an alternative Docker image to be used for building [musllinux](https://github.com/pypa/manylinux) wheels. cibuildwheel will then pull these instead of the default images, [`quay.io/pypa/musllinux_1_1_x86_64`](https://quay.io/pypa/musllinux_1_1_x86_64), [`quay.io/pypa/musllinux_1_1_i686`](https://quay.io/pypa/musllinux_1_1_i686), [`quay.io/pypa/musllinux_1_1_aarch64`](https://quay.io/pypa/musllinux_1_1_aarch64), [`quay.io/pypa/musllinux_1_1_ppc64le`](https://quay.io/pypa/musllinux_1_1_ppc64le), and [`quay.io/pypa/musllinux_1_1_s390x`](https://quay.io/pypa/musllinux_1_1_s390x). + +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. +If this option is blank, it will fall though to the next available definition (environment variable -> pyproject.toml -> default). + +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 musllinux_1_1 wheels (see [pypa/manylinux on GitHub](https://github.com/pypa/manylinux) and [PEP 656](https://www.python.org/dev/peps/pep-0656/) for more details). + +Auditwheel detects the version of the 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="musllinux_1_1_$(uname -m)"'`). + ### `CIBW_DEPENDENCY_VERSIONS` {: #dependency-versions} > Specify how cibuildwheel controls the versions of the tools it uses @@ -895,8 +914,8 @@ Platform-specific environment variables are also available:
!!! note This option does not affect the tools used on the Linux build - those versions - are bundled with the manylinux image that cibuildwheel uses. To change - dependency versions on Linux, use the [CIBW_MANYLINUX_*](#manylinux-image) + are bundled with the manylinux/musllinux image that cibuildwheel uses. To change + dependency versions on Linux, use the [CIBW_MANYLINUX_*](#manylinux-image) / [CIBW_MUSLLINUX_*](#musllinux-image) options. #### Examples @@ -1140,7 +1159,7 @@ With macOS `universal2` wheels, you can also skip the individual archs inside th ```yaml # Will avoid testing on emulated architectures - CIBW_TEST_SKIP: "*-manylinux_{aarch64,ppc64le,s390x}" + CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x}" # Skip trying to test arm64 builds on Intel Macs CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64" @@ -1151,7 +1170,7 @@ With macOS `universal2` wheels, you can also skip the individual archs inside th ```toml [tool.cibuildwheel] # Will avoid testing on emulated architectures - test-skip = "*-manylinux_{aarch64,ppc64le,s390x}" + test-skip = "*-*linux_{aarch64,ppc64le,s390x}" # Skip trying to test arm64 builds on Intel Macs test-skip = "*-macosx_arm64 *-macosx_universal2:arm64" From 0140bbc15b51582d4d6cd8efaf4b29f9d6a20463 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 19 Sep 2021 17:47:46 +0200 Subject: [PATCH 3/6] doc: combine `CIBW_MANYLINUX_*_IMAGE` & `CIBW_MUSLLINUX_*_IMAGE` options --- README.md | 3 +- docs/changelog.md | 6 ++-- docs/faq.md | 2 +- docs/options.md | 79 ++++++++++++++++++++--------------------------- 4 files changed, 39 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 26171c1d2..14aac912e 100644 --- a/README.md +++ b/README.md @@ -114,8 +114,7 @@ Options | | [`CIBW_BEFORE_ALL`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-all) | Execute a shell command on the build system before any wheels are built. | | | [`CIBW_BEFORE_BUILD`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-build) | Execute a shell command preparing each wheel's build | | | [`CIBW_REPAIR_WHEEL_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#repair-wheel-command) | Execute a shell command to repair each (non-pure Python) built wheel | -| | [`CIBW_MANYLINUX_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) | Specify alternative manylinux Docker images | -| | [`CIBW_MUSLLINUX_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#musllinux-image) | Specify alternative musllinux Docker images | +| | [`CIBW_MANYLINUX_*_IMAGE`
`CIBW_MUSLLINUX_*_IMAGE`](https://cibuildwheel.readthedocs.io/en/stable/options/#linux-image) | Specify alternative manylinux / musllinux Docker images | | | [`CIBW_DEPENDENCY_VERSIONS`](https://cibuildwheel.readthedocs.io/en/stable/options/#dependency-versions) | Specify how cibuildwheel controls the versions of the tools it uses | | **Testing** | [`CIBW_TEST_COMMAND`](https://cibuildwheel.readthedocs.io/en/stable/options/#test-command) | Execute a shell command to test each built wheel | | | [`CIBW_BEFORE_TEST`](https://cibuildwheel.readthedocs.io/en/stable/options/#before-test) | Execute a shell command before testing each wheel | diff --git a/docs/changelog.md b/docs/changelog.md index ec91947a2..38c93b109 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -66,7 +66,7 @@ _1 May 2021_ _22 Feb 2021_ - ✨ Added `manylinux_2_24` support. To use these new Debian-based manylinux - images, set your [manylinux image](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) + images, set your [manylinux image](https://cibuildwheel.readthedocs.io/en/stable/options/#linux-image) options to `manylinux_2_24`. - 🛠 On macOS, we now set `MACOSX_DEPLOYMENT_TARGET` in before running `CIBW_BEFORE_ALL`. This is useful when using `CIBW_BEFORE_ALL` to build a @@ -321,7 +321,7 @@ _2 May 2020_ Studio can still effect things. This can be controlled using the [CIBW_DEPENDENCY_VERSIONS](https://cibuildwheel.readthedocs.io/en/stable/options/#dependency-versions) - and [manylinux image](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) + and [manylinux image](https://cibuildwheel.readthedocs.io/en/stable/options/#linux-image) options - if you always want to use the latest toolchain, you can still do that, or you can specify your own pip constraints file and manylinux image. (#256) @@ -396,7 +396,7 @@ _10 November 2019_ build using the manylinux2010 images by default. If your project is still manylinux1 compatible, you should get both manylinux1 and manylinux2010 wheels - you can upload both to PyPI. If you always require manylinux1 wheels, you can - build using the old manylinux1 image using the [manylinux image](https://cibuildwheel.readthedocs.io/en/stable/options/#manylinux-image) option. + build using the old manylinux1 image using the [manylinux image](https://cibuildwheel.readthedocs.io/en/stable/options/#linux-image) option. (#155) - 📚 Documentation is now on its [own mini-site](https://cibuildwheel.readthedocs.io), rather than on the README (#169) diff --git a/docs/faq.md b/docs/faq.md index 132935477..b82f92850 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -14,7 +14,7 @@ Linux wheels are built in the [`manylinux`/`musllinux` docker images](https://gi - The project directory is mounted in the running Docker instance as `/project`, the output directory for the wheels as `/output`. In general, this is handled transparently by `cibuildwheel`. For a more finegrained level of control however, the root of the host file system is mounted as `/host`, allowing for example to access shared files, caches, etc. on the host file system. Note that `/host` is not available on CircleCI due to their Docker policies. -- Alternative Docker images can be specified with the `CIBW_MANYLINUX_*_IMAGE`/`CIBW_MUSLLINUX_*_IMAGE` options to allow for a custom, preconfigured build environment for the Linux builds. See [options](options.md#manylinux-image) for more details. +- Alternative Docker images can be specified with the `CIBW_MANYLINUX_*_IMAGE`/`CIBW_MUSLLINUX_*_IMAGE` options to allow for a custom, preconfigured build environment for the Linux builds. See [options](options.md#linux-image) for more details. ### Building macOS wheels for Apple Silicon {: #apple-silicon} diff --git a/docs/options.md b/docs/options.md index 2e66a445d..36573ada3 100644 --- a/docs/options.md +++ b/docs/options.md @@ -151,14 +151,14 @@ When setting the options, you can use shell-style globbing syntax, as per [fnmat
-| | macOS | Windows | Manylinux Intel | Manylinux Other | Musllinux Intel | Musllinux Other | -|--------------|------------------------------------------------------------------------|----------------------------------|--------------------------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------|-------------------------------------------------------------------------------| -| Python 3.6 | cp36-macosx_x86_64 | cp36-win_amd64
cp36-win32 | cp36-manylinux_x86_64
cp36-manylinux_i686 | cp36-manylinux_aarch64
cp36-manylinux_ppc64le
cp36-manylinux_s390x | cp36-musllinux_x86_64
cp36-musllinux_i686 | cp36-musllinux_aarch64
cp36-musllinux_ppc64le
cp36-musllinux_s390x | -| Python 3.7 | cp37-macosx_x86_64 | cp37-win_amd64
cp37-win32 | cp37-manylinux_x86_64
cp37-manylinux_i686 | cp37-manylinux_aarch64
cp37-manylinux_ppc64le
cp37-manylinux_s390x | cp37-musllinux_x86_64
cp37-musllinux_i686 | cp37-musllinux_aarch64
cp37-musllinux_ppc64le
cp37-musllinux_s390x | -| Python 3.8 | cp38-macosx_x86_64
cp38-macosx_universal2
cp38-macosx_arm64 | cp38-win_amd64
cp38-win32 | cp38-manylinux_x86_64
cp38-manylinux_i686 | cp38-manylinux_aarch64
cp38-manylinux_ppc64le
cp38-manylinux_s390x | cp38-musllinux_x86_64
cp38-musllinux_i686 | cp38-musllinux_aarch64
cp38-musllinux_ppc64le
cp38-musllinux_s390x | -| Python 3.9 | cp39-macosx_x86_64
cp39-macosx_universal2
cp39-macosx_arm64 | cp39-win_amd64
cp39-win32 | cp39-manylinux_x86_64
cp39-manylinux_i686 | cp39-manylinux_aarch64
cp39-manylinux_ppc64le
cp39-manylinux_s390x | cp39-musllinux_x86_64
cp39-musllinux_i686 | cp39-musllinux_aarch64
cp39-musllinux_ppc64le
cp39-musllinux_s390x | -| Python 3.10 | cp310-macosx_x86_64
cp310-macosx_universal2
cp310-macosx_arm64 | cp310-win_amd64
cp310-win32 | cp310-manylinux_x86_64
cp310-manylinux_i686 | cp310-manylinux_aarch64
cp310-manylinux_ppc64le
cp310-manylinux_s390x | cp310-musllinux_x86_64
cp310-musllinux_i686 | cp310-musllinux_aarch64
cp310-musllinux_ppc64le
cp310-musllinux_s390x | -| PyPy3.7 v7.3 | pp37-macosx_x86_64 | pp37-win_amd64 | pp37-manylinux_x86_64 | | | | +| | macOS | Windows | Linux Intel | Linux Other | +|--------------|------------------------------------------------------------------------|----------------------------------|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Python 3.6 | cp36-macosx_x86_64 | cp36-win_amd64
cp36-win32 | cp36-manylinux_x86_64
cp36-manylinux_i686
cp36-musllinux_x86_64
cp36-musllinux_i686 | cp36-manylinux_aarch64
cp36-manylinux_ppc64le
cp36-manylinux_s390x
cp36-musllinux_aarch64
cp36-musllinux_ppc64le
cp36-musllinux_s390x | +| Python 3.7 | cp37-macosx_x86_64 | cp37-win_amd64
cp37-win32 | cp37-manylinux_x86_64
cp37-manylinux_i686
cp37-musllinux_x86_64
cp37-musllinux_i686 | cp37-manylinux_aarch64
cp37-manylinux_ppc64le
cp37-manylinux_s390x
cp37-musllinux_aarch64
cp37-musllinux_ppc64le
cp37-musllinux_s390x | +| Python 3.8 | cp38-macosx_x86_64
cp38-macosx_universal2
cp38-macosx_arm64 | cp38-win_amd64
cp38-win32 | cp38-manylinux_x86_64
cp38-manylinux_i686
cp38-musllinux_x86_64
cp38-musllinux_i686 | cp38-manylinux_aarch64
cp38-manylinux_ppc64le
cp38-manylinux_s390x
cp38-musllinux_aarch64
cp38-musllinux_ppc64le
cp38-musllinux_s390x | +| Python 3.9 | cp39-macosx_x86_64
cp39-macosx_universal2
cp39-macosx_arm64 | cp39-win_amd64
cp39-win32 | cp39-manylinux_x86_64
cp39-manylinux_i686
cp39-musllinux_x86_64
cp39-musllinux_i686 | cp39-manylinux_aarch64
cp39-manylinux_ppc64le
cp39-manylinux_s390x
cp39-musllinux_aarch64
cp39-musllinux_ppc64le
cp39-musllinux_s390x | +| Python 3.10 | cp310-macosx_x86_64
cp310-macosx_universal2
cp310-macosx_arm64 | cp310-win_amd64
cp310-win32 | cp310-manylinux_x86_64
cp310-manylinux_i686
cp310-musllinux_x86_64
cp310-musllinux_i686 | cp310-manylinux_aarch64
cp310-manylinux_ppc64le
cp310-manylinux_s390x
cp310-musllinux_aarch64
cp310-musllinux_ppc64le
cp310-musllinux_s390x | +| PyPy3.7 v7.3 | pp37-macosx_x86_64 | pp37-win_amd64 | pp37-manylinux_x86_64 | | The list of supported and currently selected build identifiers can also be retrieved by passing the `--print-build-identifiers` flag to cibuildwheel. The format is `python_tag-platform_tag`, with tags similar to those in [PEP 425](https://www.python.org/dev/peps/pep-0425/#details). @@ -780,28 +780,37 @@ Platform-specific environment variables are also available:
In configuration mode, you can use an inline array, and the items will be joined with `&&`. -### CIBW_MANYLINUX_*_IMAGE {: #manylinux-image} -> Specify alternative manylinux Docker images +### CIBW_MANYLINUX_*_IMAGE / CIBW_MUSLLINUX_*_IMAGE {: #linux-image} +> Specify alternative manylinux / musllinux Docker images -The available options are: +The available options are (default value): -- `CIBW_MANYLINUX_X86_64_IMAGE` -- `CIBW_MANYLINUX_I686_IMAGE` -- `CIBW_MANYLINUX_PYPY_X86_64_IMAGE` -- `CIBW_MANYLINUX_AARCH64_IMAGE` -- `CIBW_MANYLINUX_PPC64LE_IMAGE` -- `CIBW_MANYLINUX_S390X_IMAGE` -- `CIBW_MANYLINUX_PYPY_AARCH64_IMAGE` -- `CIBW_MANYLINUX_PYPY_I686_IMAGE` +- `CIBW_MANYLINUX_X86_64_IMAGE` ([`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64)) +- `CIBW_MANYLINUX_I686_IMAGE` ([`quay.io/pypa/manylinux2010_i686`](https://quay.io/pypa/manylinux2010_i686)) +- `CIBW_MANYLINUX_PYPY_X86_64_IMAGE` ([`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_x86_64)) +- `CIBW_MANYLINUX_AARCH64_IMAGE` ([`quay.io/pypa/manylinux2014_aarch64`](https://quay.io/pypa/manylinux2014_aarch64)) +- `CIBW_MANYLINUX_PPC64LE_IMAGE` ([`quay.io/pypa/manylinux2014_ppc64le`](https://quay.io/pypa/manylinux2014_ppc64le)) +- `CIBW_MANYLINUX_S390X_IMAGE` ([`quay.io/pypa/manylinux2014_s390x`](https://quay.io/pypa/manylinux2010_s390x)) +- `CIBW_MANYLINUX_PYPY_AARCH64_IMAGE` ([`quay.io/pypa/manylinux2014_aarch64`](https://quay.io/pypa/manylinux2014_aarch64)) +- `CIBW_MANYLINUX_PYPY_I686_IMAGE` ([`quay.io/pypa/manylinux2010_i686`](https://quay.io/pypa/manylinux2010_i686)) +- `CIBW_MUSLLINUX_X86_64_IMAGE` ([`quay.io/pypa/musllinux_1_1_x86_64`](https://quay.io/pypa/musllinux_1_1_x86_64)) +- `CIBW_MUSLLINUX_I686_IMAGE` ([`quay.io/pypa/musllinux_1_1_i686`](https://quay.io/pypa/musllinux_1_1_i686)) +- `CIBW_MUSLLINUX_AARCH64_IMAGE` ([`quay.io/pypa/musllinux_1_1_aarch64`](https://quay.io/pypa/musllinux_1_1_aarch64)) +- `CIBW_MUSLLINUX_PPC64LE_IMAGE` ([`quay.io/pypa/musllinux_1_1_ppc64le`](https://quay.io/pypa/musllinux_1_1_ppc64le)) +- `CIBW_MUSLLINUX_S390X_IMAGE` ([`quay.io/pypa/musllinux_1_1_s390x`](https://quay.io/pypa/musllinux_1_1_s390x)) -Set 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), [`quay.io/pypa/manylinux2010_x86_64`](https://quay.io/pypa/manylinux2010_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). +Set an alternative Docker image to be used for building [manylinux / musllinux](https://github.com/pypa/manylinux) wheels. -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 -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`. If this option is blank, it will fall though to the next available definition (environment variable -> pyproject.toml -> default). +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 +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`. -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 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). +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. -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)"'`). +If this option is blank, it will fall though to the next available definition (environment variable -> pyproject.toml -> default). + +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). + +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)"'`). #### Examples @@ -862,26 +871,6 @@ Auditwheel detects the version of the manylinux standard in the Docker image thr Like any other option, these can be placed in `[tool.cibuildwheel.linux]` if you prefer; they have no effect on `macos` and `windows`. -### CIBW_MUSLLINUX_*_IMAGE {: #musllinux-image} -> Specify alternative musllinux Docker images - -The available options are: - -- `CIBW_MUSLLINUX_X86_64_IMAGE` -- `CIBW_MUSLLINUX_I686_IMAGE` -- `CIBW_MUSLLINUX_AARCH64_IMAGE` -- `CIBW_MUSLLINUX_PPC64LE_IMAGE` -- `CIBW_MUSLLINUX_S390X_IMAGE` - -Set an alternative Docker image to be used for building [musllinux](https://github.com/pypa/manylinux) wheels. cibuildwheel will then pull these instead of the default images, [`quay.io/pypa/musllinux_1_1_x86_64`](https://quay.io/pypa/musllinux_1_1_x86_64), [`quay.io/pypa/musllinux_1_1_i686`](https://quay.io/pypa/musllinux_1_1_i686), [`quay.io/pypa/musllinux_1_1_aarch64`](https://quay.io/pypa/musllinux_1_1_aarch64), [`quay.io/pypa/musllinux_1_1_ppc64le`](https://quay.io/pypa/musllinux_1_1_ppc64le), and [`quay.io/pypa/musllinux_1_1_s390x`](https://quay.io/pypa/musllinux_1_1_s390x). - -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. -If this option is blank, it will fall though to the next available definition (environment variable -> pyproject.toml -> default). - -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 musllinux_1_1 wheels (see [pypa/manylinux on GitHub](https://github.com/pypa/manylinux) and [PEP 656](https://www.python.org/dev/peps/pep-0656/) for more details). - -Auditwheel detects the version of the 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="musllinux_1_1_$(uname -m)"'`). - ### `CIBW_DEPENDENCY_VERSIONS` {: #dependency-versions} > Specify how cibuildwheel controls the versions of the tools it uses @@ -915,7 +904,7 @@ Platform-specific environment variables are also available:
!!! note This option does not affect the tools used on the Linux build - those versions are bundled with the manylinux/musllinux image that cibuildwheel uses. To change - dependency versions on Linux, use the [CIBW_MANYLINUX_*](#manylinux-image) / [CIBW_MUSLLINUX_*](#musllinux-image) + dependency versions on Linux, use the [CIBW_MANYLINUX_* / CIBW_MUSLLINUX_*](#linux-image) options. #### Examples From 0dfad5ca2499aee0b7c5b71759d93283246ddeb7 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 19 Sep 2021 17:56:46 +0200 Subject: [PATCH 4/6] fix: doc to be squashed --- docs/options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/options.md b/docs/options.md index 36573ada3..2c68e6042 100644 --- a/docs/options.md +++ b/docs/options.md @@ -780,7 +780,7 @@ Platform-specific environment variables are also available:
In configuration mode, you can use an inline array, and the items will be joined with `&&`. -### CIBW_MANYLINUX_*_IMAGE / CIBW_MUSLLINUX_*_IMAGE {: #linux-image} +### `CIBW_MANYLINUX_*_IMAGE`, `CIBW_MUSLLINUX_*_IMAGE` {: #linux-image} > Specify alternative manylinux / musllinux Docker images The available options are (default value): From 1fb85800f1e1737e8dbc8bdffa6d597b7b78b203 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 19 Sep 2021 18:04:24 +0200 Subject: [PATCH 5/6] doc: combine manylinux /musllinux in README --- README.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 14aac912e..3ed591ea8 100644 --- a/README.md +++ b/README.md @@ -22,15 +22,16 @@ Python wheels are great. Building them across **Mac, Linux, Windows**, on **mult What does it do? ---------------- -| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | manylinux x86_64 | manylinux i686 | manylinux aarch64 | manylinux ppc64le | manylinux s390x | musllinux x86_64 | musllinux i686 | musllinux aarch64 | musllinux ppc64le | musllinux s390x | -|---------------|----|-----|-----|-----|----|-----|----|-----|-----|----|-----|----|-----|-----| -| CPython 3.6 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.7 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | -| PyPy 3.7 v7.3 | ✅ | N/A | ✅ | N/A | ✅ | ✅ | ✅ | N/A | N/A | N/A | N/A | N/A | N/A | N/A | - +| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | manylinux
musllinux x86_64 | manylinux
musllinux i686 | manylinux
musllinux aarch64 | manylinux
musllinux ppc64le | manylinux
musllinux s390x | +|---------------|----|-----|-----|-----|----|-----|----|-----|-----| +| CPython 3.6 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.7 | ✅ | N/A | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| CPython 3.10 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | +| PyPy 3.7 v7.3 | ✅ | N/A | ✅ | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | + +¹ PyPy is only supported for manylinux wheels.
- Builds manylinux, musllinux, macOS 10.9+, and Windows wheels for CPython and PyPy - Works on GitHub Actions, Azure Pipelines, Travis CI, AppVeyor, CircleCI, and GitLab CI From 6c28426e2fac1c588579e39bfb48e9afda92de42 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Sun, 19 Sep 2021 19:24:46 +0200 Subject: [PATCH 6/6] Update docs/options.md Co-authored-by: Joe Rickerby --- docs/options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/options.md b/docs/options.md index 2c68e6042..7afd1c260 100644 --- a/docs/options.md +++ b/docs/options.md @@ -780,6 +780,8 @@ Platform-specific environment variables are also available:
In configuration mode, you can use an inline array, and the items will be joined with `&&`. + + ### `CIBW_MANYLINUX_*_IMAGE`, `CIBW_MUSLLINUX_*_IMAGE` {: #linux-image} > Specify alternative manylinux / musllinux Docker images