Skip to content

Commit 8a36136

Browse files
committed
fix: repair linux wheels with auditwheel
1 parent 8a241e4 commit 8a36136

9 files changed

Lines changed: 12 additions & 48 deletions

File tree

.github/workflows/_wheel-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ jobs:
3434
CPPLLVM_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/${{ inputs.package_name }}-downloads
3535
CIBW_ARCHS: ${{ inputs.cibw_archs }}
3636
MACOSX_DEPLOYMENT_TARGET: ${{ inputs.macos_deployment_target }}
37-
CIBW_REPAIR_WHEEL_COMMAND: ""
37+
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}"
38+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
39+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
3840
steps:
3941
- uses: actions/checkout@v4
4042
- uses: actions/setup-python@v5

.github/workflows/release-cformat.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
CPPLLVM_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/cformat-downloads
4141
CIBW_ARCHS: ${{ matrix.cibw_archs }}
4242
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_deployment_target }}
43-
CIBW_REPAIR_WHEEL_COMMAND: ""
43+
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}"
44+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
45+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
4446
steps:
4547
- uses: actions/checkout@v4
4648
- uses: actions/setup-python@v5

.github/workflows/release-ctidy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
CPPLLVM_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/ctidy-downloads
4141
CIBW_ARCHS: ${{ matrix.cibw_archs }}
4242
MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macos_deployment_target }}
43-
CIBW_REPAIR_WHEEL_COMMAND: ""
43+
CIBW_REPAIR_WHEEL_COMMAND_LINUX: "auditwheel repair -w {dest_dir} {wheel}"
44+
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ""
45+
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: ""
4446
steps:
4547
- uses: actions/checkout@v4
4648
- uses: actions/setup-python@v5

cppllvm_build.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
("Windows", "amd64"): ("windows-amd64", ".exe"),
3535
}
3636

37-
LINUX_WHEEL_PLATFORM_TAG = "manylinux_2_17_x86_64.manylinux2014_x86_64"
38-
3937

4038
@dataclass(frozen=True)
4139
class PackageBuildConfig:
@@ -122,14 +120,6 @@ def checksum_asset_name(config: PackageBuildConfig, stem: str) -> str:
122120
return f"{stem}-{llvm_major_version(config)}_{platform_name}.sha512sum"
123121

124122

125-
def wheel_platform_tag(default_platform_tag: str) -> str:
126-
host_system = system()
127-
host_machine = machine().lower()
128-
if host_system == "Linux" and host_machine in {"x86_64", "amd64"}:
129-
return LINUX_WHEEL_PLATFORM_TAG
130-
return default_platform_tag
131-
132-
133123
def cached_download(url: str, destination: Path, *, package_name: str) -> Path:
134124
if destination.exists() and destination.stat().st_size > 0:
135125
return destination
@@ -272,6 +262,6 @@ def finalize_options(self) -> None:
272262

273263
def get_tag(self) -> tuple[str, str, str]:
274264
_, _, platform_tag = super().get_tag()
275-
return "py3", "none", wheel_platform_tag(platform_tag)
265+
return "py3", "none", platform_tag
276266

277267
return build_py, bdist_wheel

packages/cformat/cppllvm_build.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
("Windows", "amd64"): ("windows-amd64", ".exe"),
3535
}
3636

37-
LINUX_WHEEL_PLATFORM_TAG = "manylinux_2_17_x86_64.manylinux2014_x86_64"
38-
3937

4038
@dataclass(frozen=True)
4139
class PackageBuildConfig:
@@ -122,14 +120,6 @@ def checksum_asset_name(config: PackageBuildConfig, stem: str) -> str:
122120
return f"{stem}-{llvm_major_version(config)}_{platform_name}.sha512sum"
123121

124122

125-
def wheel_platform_tag(default_platform_tag: str) -> str:
126-
host_system = system()
127-
host_machine = machine().lower()
128-
if host_system == "Linux" and host_machine in {"x86_64", "amd64"}:
129-
return LINUX_WHEEL_PLATFORM_TAG
130-
return default_platform_tag
131-
132-
133123
def cached_download(url: str, destination: Path, *, package_name: str) -> Path:
134124
if destination.exists() and destination.stat().st_size > 0:
135125
return destination
@@ -272,6 +262,6 @@ def finalize_options(self) -> None:
272262

273263
def get_tag(self) -> tuple[str, str, str]:
274264
_, _, platform_tag = super().get_tag()
275-
return "py3", "none", wheel_platform_tag(platform_tag)
265+
return "py3", "none", platform_tag
276266

277267
return build_py, bdist_wheel

packages/cformat/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,4 @@ prebuilt_release_tag = "master-796e77c"
4545

4646
[tool.cibuildwheel]
4747
build-verbosity = 1
48-
repair-wheel-command = ""
4948
test-command = "python -c \"import importlib.resources as resources, os, subprocess; from cformat import __version__; data = resources.files('cformat').joinpath('data'); binary = 'clang-format.exe' if os.name == 'nt' else 'clang-format'; assert data.joinpath('bin', binary).is_file(); subprocess.check_call(['cformat', '--help']); subprocess.check_call(['cformat', '--version'])\""

packages/ctidy/cppllvm_build.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@
3434
("Windows", "amd64"): ("windows-amd64", ".exe"),
3535
}
3636

37-
LINUX_WHEEL_PLATFORM_TAG = "manylinux_2_17_x86_64.manylinux2014_x86_64"
38-
3937

4038
@dataclass(frozen=True)
4139
class PackageBuildConfig:
@@ -122,14 +120,6 @@ def checksum_asset_name(config: PackageBuildConfig, stem: str) -> str:
122120
return f"{stem}-{llvm_major_version(config)}_{platform_name}.sha512sum"
123121

124122

125-
def wheel_platform_tag(default_platform_tag: str) -> str:
126-
host_system = system()
127-
host_machine = machine().lower()
128-
if host_system == "Linux" and host_machine in {"x86_64", "amd64"}:
129-
return LINUX_WHEEL_PLATFORM_TAG
130-
return default_platform_tag
131-
132-
133123
def cached_download(url: str, destination: Path, *, package_name: str) -> Path:
134124
if destination.exists() and destination.stat().st_size > 0:
135125
return destination
@@ -272,6 +262,6 @@ def finalize_options(self) -> None:
272262

273263
def get_tag(self) -> tuple[str, str, str]:
274264
_, _, platform_tag = super().get_tag()
275-
return "py3", "none", wheel_platform_tag(platform_tag)
265+
return "py3", "none", platform_tag
276266

277267
return build_py, bdist_wheel

packages/ctidy/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,4 @@ prebuilt_release_tag = "master-796e77c"
4848

4949
[tool.cibuildwheel]
5050
build-verbosity = 1
51-
repair-wheel-command = ""
5251
test-command = "python -c \"import importlib.resources as resources, os, subprocess; from ctidy import __version__; data = resources.files('ctidy').joinpath('data'); binary = 'clang-tidy.exe' if os.name == 'nt' else 'clang-tidy'; assert data.joinpath('bin', binary).is_file(); assert data.joinpath('bin', 'run-clang-tidy.py').is_file(); assert data.joinpath('lib', 'clang', __version__.split('.', 1)[0], 'include').is_dir(); subprocess.check_call(['ctidy', '--help']); subprocess.check_call(['ctidy', '--version'])\""

tests/test_cppllvm_build.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@
99
from setuptools.errors import SetupError
1010

1111
from cppllvm_build import (
12-
LINUX_WHEEL_PLATFORM_TAG,
1312
PackageBuildConfig,
1413
asset_name,
1514
checksum_asset_name,
1615
current_platform,
17-
wheel_platform_tag,
1816
)
1917

2018

@@ -78,14 +76,6 @@ def test_cformat_asset_name_uses_package_version(self, *_args: object) -> None:
7876
"clang-format-20_windows-amd64.sha512sum",
7977
)
8078

81-
@patch("cppllvm_build.machine", return_value="x86_64")
82-
@patch("cppllvm_build.system", return_value="Linux")
83-
def test_linux_wheel_platform_tag_uses_manylinux(self, *_args: object) -> None:
84-
self.assertEqual(
85-
wheel_platform_tag("linux_x86_64"),
86-
LINUX_WHEEL_PLATFORM_TAG,
87-
)
88-
8979
@patch("cppllvm_build.machine", return_value="arm64")
9080
@patch("cppllvm_build.system", return_value="Linux")
9181
def test_unsupported_platform_raises_clear_error(self, *_args: object) -> None:

0 commit comments

Comments
 (0)