fix(wheel): auto-discover manylinux platform tag via auditwheel repair#888
Merged
fix(wheel): auto-discover manylinux platform tag via auditwheel repair#888
Conversation
…wheel manylinux1 (glibc 2.5 / CentOS 5) is deprecated and inconsistent with the aarch64 and ppc64le builds which already use manylinux2014. Kitmaker K2 wheel validation may reject a manylinux1-tagged wheel built in a modern Ubuntu container. Align x86_64 with the other architectures.
…4.04 build host Wheels built on Ubuntu 24.04 (glibc 2.39) cannot honestly claim manylinux1 or manylinux2014 compatibility; auditwheel/K2 validation will reject them. Use manylinux_2_39_x86_64 (PEP 600 style) which accurately reflects the minimum glibc required by a Ubuntu 24.04 build. aarch64/ppc64le tags left as-is pending confirmation of their build host OS. TODO: add auditwheel repair step to auto-detect actual minimum glibc per arch.
Replace the hard-coded per-arch manylinux tags with auditwheel repair,
which introspects the wheel's native extensions and emits the correct
manylinux_2_X_{arch} tag based on actual glibc symbol requirements.
Build flow for --linux:
1. python setup.py bdist_wheel --plat-name linux_{arch}
(bare tag — honest but not pip-installable as-is)
2. auditwheel repair → manylinux_2_X_{arch} wheel in dest-dir
(scans .so files, determines minimum glibc, bundles non-system libs)
This handles x86_64, aarch64, and ppc64le uniformly without manual
version pinning and adapts automatically when the build host OS changes.
Requires: pip install auditwheel (add to SDK image or CI job setup)
auditwheel repair raises NonPlatformWheel and exits non-zero when the wheel contains no .so files. Guard with auditwheel show first; if the wheel is pure-Python, copy it directly without retagging.
The --linux wheel always contains native extensions (shared memory, gRPC, HTTP); the NonPlatformWheel fallback is unnecessary and masks real build errors. Call auditwheel repair directly.
auditwheel repair fails when the wheel has no native ELF extensions. tritonclient is pure Python, so repair exits with "no ELF executable or shared library file found". Fall back to auditwheel addtag, which stamps the correct manylinux platform tag without requiring .so files.
auditwheel's logging goes to stderr (Python logging module default), not stdout. The previous check `"no ELF" in r.stdout` never matched, so the addtag fallback was never triggered and the build failed.
auditwheel repair fails on pure Python wheels (no ELF). Two bugs fixed: 1. Check r.stderr (not r.stdout) for the "no ELF" sentinel — auditwheel logs via Python's logging module which writes to stderr. 2. Use `python -m wheel tags --remove` instead of `auditwheel addtag`; the addtag subcommand was removed in auditwheel 6.0. Copy the wheel to dest_dir first, then retag in-place so the output lands in the right location. Local reproducer confirms mypkg-1.0-py3-none-manylinux_2_28_x86_64.whl is produced correctly.
…thon wheel After PR #797 removed libcshm.so (C shared memory shim), tritonclient has no native extensions. shared_memory is pure Python (mmap/ctypes) and cuda_shared_memory uses cuda.bindings (pure Python package). A single py3-none-any wheel is correct and sufficient for all platforms. Remove the --plat-name linux_{arch} / auditwheel repair complexity from the --linux build path. Both --linux and non-linux paths now produce py3-none-any via a simple bdist_wheel invocation.
perf_analyzer is always distributed separately and never bundled into the tritonclient wheel. Remove the --perf-analyzer argument from build_wheel.py, the TRITON_PACKAGE_PERF_ANALYZER guard from CMakeLists.txt, and the dead data_files branch from setup.py.
…ux-client-wheel shared_memory and cuda_shared_memory are pure Python after PR #797 removed libcshm.so. There is no longer a reason to gate them behind --linux. Include them unconditionally in the single generic wheel, guarded only by os.path.isdir so the build still works on platforms where those subdirectories are absent. Remove --linux argument from build_wheel.py and drop the linux-client-wheel cmake target entirely. A single py3-none-any wheel now contains all tritonclient modules.
whoisj
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
triton-inference-server/server#8743
triton-inference-server/model_analyzer#1019
Description
Replace the hard-coded manylinux platform tag in the tritonclient wheel build with
auditwheel repair, which automatically discovers the correctmanylinux_X_Y_{arch}tag from the actual glibc symbol dependencies of the native extensions.Previously
build_wheel.pypassed a static platform tag (e.g.manylinux2014_x86_64) that was incorrect for wheels built on Ubuntu 24.04 (glibc 2.39).auditwheel repairinspects the compiled extensions at build time and emits a correctly-tagged manylinux wheel without requiring manual maintenance.Pure-Python (
any) wheels are unaffected — they follow the existingelsebranch andauditwheelis never invoked.Changes
Affected Files
src/python/library/build_wheel.py