Skip to content

Commit d902841

Browse files
committed
feature: add musllinux armv7l
1 parent 1327af5 commit d902841

16 files changed

+97
-55
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ Python wheels are great. Building them across **Mac, Linux, Windows**, on **mult
2222
What does it do?
2323
----------------
2424

25-
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | Pyodide |
26-
|----------------|----|-----|-----|-----|-----|----|-----|----|-----|-----|-----|
27-
| CPython 3.6 || N/A ||| N/A |||||| N/A |
28-
| CPython 3.7 || N/A ||| N/A |||||| N/A |
29-
| CPython 3.8 ||||| N/A |||||| N/A |
30-
| CPython 3.9 ||||| ✅² |||||| N/A |
31-
| CPython 3.10 ||||| ✅² |||||| N/A |
32-
| CPython 3.11 ||||| ✅² |||||| N/A |
33-
| CPython 3.12 ||||| ✅² |||||| ✅⁴ |
34-
| CPython 3.13³ ||||| ✅² |||||| N/A |
35-
| PyPy 3.7 v7.3 || N/A || N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A |
36-
| PyPy 3.8 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A |
37-
| PyPy 3.9 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A |
38-
| PyPy 3.10 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A |
25+
| | macOS Intel | macOS Apple Silicon | Windows 64bit | Windows 32bit | Windows Arm64 | manylinux<br/>musllinux x86_64 | manylinux<br/>musllinux i686 | manylinux<br/>musllinux aarch64 | manylinux<br/>musllinux ppc64le | manylinux<br/>musllinux s390x | musllinux armv7l | Pyodide |
26+
|----------------|----|-----|-----|-----|-----|----|-----|----|-----|-----|---|-----|
27+
| CPython 3.6 || N/A ||| N/A |||||| | N/A |
28+
| CPython 3.7 || N/A ||| N/A |||||| | N/A |
29+
| CPython 3.8 ||||| N/A |||||| | N/A |
30+
| CPython 3.9 ||||| ✅² |||||| | N/A |
31+
| CPython 3.10 ||||| ✅² |||||| | N/A |
32+
| CPython 3.11 ||||| ✅² |||||| | N/A |
33+
| CPython 3.12 ||||| ✅² |||||| ||
34+
| CPython 3.13³ ||||| ✅² |||||| | N/A |
35+
| PyPy 3.7 v7.3 || N/A || N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
36+
| PyPy 3.8 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
37+
| PyPy 3.9 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
38+
| PyPy 3.10 v7.3 |||| N/A | N/A | ✅¹ | ✅¹ | ✅¹ | N/A | N/A | N/A | N/A |
3939

4040
<sup>¹ PyPy is only supported for manylinux wheels.</sup><br>
4141
<sup>² Windows arm64 support is experimental.</sup><br>

bin/generate_schema.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@
137137
musllinux-aarch64-image:
138138
type: string
139139
description: Specify alternative manylinux / musllinux container images
140+
musllinux-armv7l-image:
141+
type: string
142+
description: Specify alternative manylinux / musllinux container images
140143
musllinux-i686-image:
141144
type: string
142145
description: Specify alternative manylinux / musllinux container images

bin/update_docker.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class Image:
6565
Image("musllinux_1_2", "aarch64", "quay.io/pypa/musllinux_1_2_aarch64", None),
6666
Image("musllinux_1_2", "ppc64le", "quay.io/pypa/musllinux_1_2_ppc64le", None),
6767
Image("musllinux_1_2", "s390x", "quay.io/pypa/musllinux_1_2_s390x", None),
68+
Image("musllinux_1_2", "armv7l", "quay.io/pypa/musllinux_1_2_armv7l", None),
6869
]
6970

7071
config = configparser.ConfigParser()

cibuildwheel/architecture.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ class Architecture(Enum):
3737
aarch64 = "aarch64"
3838
ppc64le = "ppc64le"
3939
s390x = "s390x"
40+
armv7l = "armv7l"
4041

4142
# mac archs
4243
universal2 = "universal2"
@@ -132,6 +133,7 @@ def all_archs(platform: PlatformName) -> set[Architecture]:
132133
Architecture.aarch64,
133134
Architecture.ppc64le,
134135
Architecture.s390x,
136+
Architecture.armv7l,
135137
},
136138
"macos": {Architecture.x86_64, Architecture.arm64, Architecture.universal2},
137139
"windows": {Architecture.x86, Architecture.AMD64, Architecture.ARM64},
@@ -140,17 +142,15 @@ def all_archs(platform: PlatformName) -> set[Architecture]:
140142
return all_archs_map[platform]
141143

142144
@staticmethod
143-
# pylint: disable-next=inconsistent-return-statements
144145
def bitness_archs(platform: PlatformName, bitness: Literal["64", "32"]) -> set[Architecture]:
145-
archs_32 = {Architecture.i686, Architecture.x86}
146+
archs_32 = {Architecture.i686, Architecture.x86, Architecture.armv7l}
146147
auto_archs = Architecture.auto_archs(platform)
147148

148149
if bitness == "64":
149150
return auto_archs - archs_32
150-
elif bitness == "32":
151+
if bitness == "32":
151152
return auto_archs & archs_32
152-
else:
153-
assert_never(bitness)
153+
assert_never(bitness)
154154

155155

156156
def allowed_architectures_check(

cibuildwheel/linux.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
Architecture.aarch64: OCIPlatform.ARM64,
3636
Architecture.ppc64le: OCIPlatform.PPC64LE,
3737
Architecture.s390x: OCIPlatform.S390X,
38+
Architecture.armv7l: OCIPlatform.ARMV7,
3839
}
3940

4041

cibuildwheel/logger.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"musllinux_i686": "musllinux i686",
2828
"musllinux_aarch64": "musllinux aarch64",
2929
"musllinux_ppc64le": "musllinux ppc64le",
30-
"musllinux_s390x": "manylinux s390x",
30+
"musllinux_s390x": "musllinux s390x",
31+
"musllinux_armv7l": "musllinux armv7l",
3132
"win32": "Windows 32bit",
3233
"win_amd64": "Windows 64bit",
3334
"win_arm64": "Windows on ARM 64bit",

cibuildwheel/oci_container.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
class OCIPlatform(Enum):
3939
i386 = "linux/386"
4040
AMD64 = "linux/amd64"
41+
ARMV7 = "linux/arm/v7"
4142
ARM64 = "linux/arm64"
4243
PPC64LE = "linux/ppc64le"
4344
S390X = "linux/s390x"
@@ -215,7 +216,7 @@ def __enter__(self) -> Self:
215216
platform_args = self._get_platform_args()
216217

217218
simulate_32_bit = False
218-
if self.oci_platform == OCIPlatform.i386:
219+
if self.oci_platform in {OCIPlatform.i386, OCIPlatform.ARMV7}:
219220
# If the architecture running the image is already the right one
220221
# or the image entrypoint takes care of enforcing this, then we don't need to
221222
# simulate this
@@ -226,13 +227,14 @@ def __enter__(self) -> Self:
226227
*run_cmd, *platform_args, self.image, *ctr_cmd, capture_stdout=True
227228
).strip()
228229
except subprocess.CalledProcessError:
229-
# The image might have been built with amd64 architecture
230-
# Let's try that
231-
platform_args = self._get_platform_args(oci_platform=OCIPlatform.AMD64)
232-
container_machine = call(
233-
*run_cmd, *platform_args, self.image, *ctr_cmd, capture_stdout=True
234-
).strip()
235-
simulate_32_bit = container_machine != "i686"
230+
if self.oci_platform == OCIPlatform.i386:
231+
# The image might have been built with amd64 architecture
232+
# Let's try that
233+
platform_args = self._get_platform_args(oci_platform=OCIPlatform.AMD64)
234+
container_machine = call(
235+
*run_cmd, *platform_args, self.image, *ctr_cmd, capture_stdout=True
236+
).strip()
237+
simulate_32_bit = container_machine not in {"i686", "armv7l", "armv8l"}
236238

237239
shell_args = ["linux32", "/bin/bash"] if simulate_32_bit else ["/bin/bash"]
238240

cibuildwheel/resources/build-platforms.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ python_configurations = [
102102
{ identifier = "cp312-musllinux_s390x", version = "3.12", path_str = "/opt/python/cp312-cp312" },
103103
{ identifier = "cp313-musllinux_s390x", version = "3.13", path_str = "/opt/python/cp313-cp313" },
104104
{ identifier = "cp313t-musllinux_s390x", version = "3.13", path_str = "/opt/python/cp313-cp313t" },
105+
{ identifier = "cp36-musllinux_armv7l", version = "3.6", path_str = "/opt/python/cp36-cp36m" },
106+
{ identifier = "cp37-musllinux_armv7l", version = "3.7", path_str = "/opt/python/cp37-cp37m" },
107+
{ identifier = "cp38-musllinux_armv7l", version = "3.8", path_str = "/opt/python/cp38-cp38" },
108+
{ identifier = "cp39-musllinux_armv7l", version = "3.9", path_str = "/opt/python/cp39-cp39" },
109+
{ identifier = "cp310-musllinux_armv7l", version = "3.10", path_str = "/opt/python/cp310-cp310" },
110+
{ identifier = "cp311-musllinux_armv7l", version = "3.11", path_str = "/opt/python/cp311-cp311" },
111+
{ identifier = "cp312-musllinux_armv7l", version = "3.12", path_str = "/opt/python/cp312-cp312" },
112+
{ identifier = "cp313-musllinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313" },
113+
{ identifier = "cp313t-musllinux_armv7l", version = "3.13", path_str = "/opt/python/cp313-cp313t" },
105114
]
106115

107116
[macos]

cibuildwheel/resources/cibuildwheel.schema.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@
312312
"description": "Specify alternative manylinux / musllinux container images",
313313
"title": "CIBW_MUSLLINUX_AARCH64_IMAGE"
314314
},
315+
"musllinux-armv7l-image": {
316+
"type": "string",
317+
"description": "Specify alternative manylinux / musllinux container images",
318+
"title": "CIBW_MUSLLINUX_ARMV7L_IMAGE"
319+
},
315320
"musllinux-i686-image": {
316321
"type": "string",
317322
"description": "Specify alternative manylinux / musllinux container images",
@@ -542,6 +547,9 @@
542547
"musllinux-aarch64-image": {
543548
"$ref": "#/properties/musllinux-aarch64-image"
544549
},
550+
"musllinux-armv7l-image": {
551+
"$ref": "#/properties/musllinux-armv7l-image"
552+
},
545553
"musllinux-i686-image": {
546554
"$ref": "#/properties/musllinux-i686-image"
547555
},
@@ -630,6 +638,9 @@
630638
"musllinux-aarch64-image": {
631639
"$ref": "#/properties/musllinux-aarch64-image"
632640
},
641+
"musllinux-armv7l-image": {
642+
"$ref": "#/properties/musllinux-armv7l-image"
643+
},
633644
"musllinux-i686-image": {
634645
"$ref": "#/properties/musllinux-i686-image"
635646
},

cibuildwheel/resources/defaults.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ musllinux-i686-image = "musllinux_1_2"
3737
musllinux-aarch64-image = "musllinux_1_2"
3838
musllinux-ppc64le-image = "musllinux_1_2"
3939
musllinux-s390x-image = "musllinux_1_2"
40+
musllinux-armv7l-image = "musllinux_1_2"
4041

4142

4243
[tool.cibuildwheel.linux]

0 commit comments

Comments
 (0)