Skip to content

fix: only shim bin wheels during auditwheel repair - #3197

Merged
messense merged 1 commit into
PyO3:mainfrom
messense:codex/bin-shim-repair-only
May 23, 2026
Merged

messense merged 1 commit into
PyO3:mainfrom
messense:codex/bin-shim-repair-only

Conversation

@messense

Copy link
Copy Markdown
Member

Summary

  • only enable the bin-wheel shim layout when auditwheel=repair will bundle external libraries
  • keep auditwheel=warn, check, skip, no-library, and WASI builds on the normal .data/scripts/ layout
  • add a focused unit test for the shim decision matrix

Rationale

Maturin 1.13.2 started moving bin artifacts into {dist}.scripts/ whenever external libraries were detected. On macOS and Windows, the default auditwheel mode is warn, which reports external libraries but does not graft them into the wheel. That produced shim-only wheel layouts without bundled .dylibs/.libs, which changed wheel contents unexpectedly for consumers such as astral-sh/uv#19468.

The shim is only needed when repair mode copies libraries into platlib and the binary needs a predictable relative path to those bundled libraries.

Checks

  • cargo fmt --all
  • cargo test --lib build_orchestrator::tests::test_should_use_bin_shim_only_for_repair_with_external_libs -- --nocapture
  • cargo test --lib
  • cargo clippy --tests --all-features -- -D warnings
  • git diff --check
  • pre-commit commit hooks (cargo fmt, cargo deny, general hooks)

`auditwheel=warn` detects external libraries but does not graft them into the wheel. Keep bin artifacts in `.data/scripts/` unless `auditwheel=repair` will copy libraries, avoiding shim-only wheel layout changes on macOS and Windows warn builds.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refines when maturin uses the “bin wheel shim” layout for binary wheels so that wheel contents only change when auditwheel=repair will actually bundle external libraries, avoiding unexpected layout changes in warn/check/skip modes (notably on macOS/Windows where default is warn).

Changes:

  • Gate bin-wheel shim layout behind a new should_use_bin_shim(...) helper that requires AuditWheelMode::Repair, non-WASI target, and detected external libraries.
  • Keep non-repair auditwheel modes (and WASI) on the standard .data/scripts/ layout even if external libraries are detected.
  • Add a focused unit test covering the shim decision matrix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@messense
messense marked this pull request as ready for review May 23, 2026 07:25
@messense
messense merged commit f29b4a3 into PyO3:main May 23, 2026
45 checks passed
@messense
messense deleted the codex/bin-shim-repair-only branch May 23, 2026 07:25
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jun 23, 2026
## 1.14.1

* Bump uraimo/run-on-arch-action to v3 to fix pytest job ([#3221](PyO3/maturin#3221))
* Fix platform tag logic to generate the same as cpython on AIX ([#3220](PyO3/maturin#3220))
* Bump pyo3-introspection ([#3227](PyO3/maturin#3227))
* Upgrade cargo-zigbuild & cargo-xwin ([#3228](PyO3/maturin#3228))
* Fix issues around crates enabling abi3 and abi3t features ([#3226](PyO3/maturin#3226))
* Add PEP 740 publish attestations to PyPI releases ([#3230](PyO3/maturin#3230))
* Set PYO3_PYTHON to run scripts for stable ABI builds ([#3233](PyO3/maturin#3233))
* Fix shell quoting in CI scripts ([#3231](PyO3/maturin#3231))

## 1.14.0

* Support parent-relative pyproject metadata in sdists ([#3182](PyO3/maturin#3182))
* Update PyPI platform tag validation ([#3187](PyO3/maturin#3187))
* Maint: update setup emsdk action in generate-ci ([#3194](PyO3/maturin#3194))
* Fix: only shim bin wheels during auditwheel repair ([#3197](PyO3/maturin#3197))
* Fix: avoid editable ELF truncation from stale hardlinks ([#3199](PyO3/maturin#3199))
* Fix Pyodide Emscripten platform tags ([#3191](PyO3/maturin#3191))
* Use pax instead of GNU headers for tar ([#3203](PyO3/maturin#3203))
* Feat: add default exclude `__pycache__` and `*.pyc` files ([#3202](PyO3/maturin#3202))
* Add support for finding free-threaded interpreters for `--find-interpreters` ([#3206](PyO3/maturin#3206))
* Stubs: also generate them for mixed PyO3 projects ([#3211](PyO3/maturin#3211))
* Don't depend on CFFI on PyPy ([#3213](PyO3/maturin#3213))
* Support pyo3 abi3t features on Python3.15 and PyO3 0.29 ([#3113](PyO3/maturin#3113))
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
maturin 1.14.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed

* Support parent-relative pyproject metadata in sdists by @Copilot in PyO3/maturin#3182
* Update PyPI platform tag validation by @messense in PyO3/maturin#3187
* maint: update setup emsdk action in generate-ci by @ManonMarchand in PyO3/maturin#3194
* fix: only shim bin wheels during auditwheel repair by @messense in PyO3/maturin#3197
* fix: avoid editable ELF truncation from stale hardlinks by @messense in PyO3/maturin#3199
* Fix Pyodide Emscripten platform tags by @messense in PyO3/maturin#3191
* build(deps): bump openssl from 0.10.79 to 0.10.80 by @dependabot[bot] in PyO3/maturin#3200
* Use pax instead of GNU headers for tar by @konstin in PyO3/maturin#3203
* feat: add default exclude __pycache__ and *.pyc files by @GuYeying in PyO3/maturin#3202
* Documentation: fix the update_readme script by @ManonMarchand in PyO3/maturin#3186
* Fix python versions used in integration_pyo3_mixed_conda by @ngoldbaum in PyO3/maturin#3208
* Add support for finding free-threaded interpreters for --find-interpreters by @ngoldbaum in PyO3/maturin#3206
* build(deps): bump tar from 0.4.45 to 0.4.46 by @dependabot[bot] in PyO3/maturin#3209
* Stubs: also generate them for mixed PyO3 projects by @Tpt in PyO3/maturin#3211
* Don't depend on CFFI on PyPy by @ngoldbaum in PyO3/maturin#3213
* resolve_platform_tags: remove a redundant case by @Tpt in PyO3/maturin#3214
* GeneratorOutput::additional_files remove Option by @Tpt in PyO3/maturin#3215
* Support pyo3 abi3t features on Python3.15 and PyO3 0.29 by @ngoldbaum in PyO3/maturin#3113

## New Contributors
* @GuYeying made their first contribution in PyO3/maturin#3202

**Full Changelog**: https://github.com/PyO3/maturin/compare/v1.13.3...v1.14.0</pre>
  <p>View the full release notes at <a href="https://github.com/PyO3/maturin/releases/tag/v1.14.0">https://github.com/PyO3/maturin/releases/tag/v1.14.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!11404
tsutsui pushed a commit to tsutsui/pkgsrc that referenced this pull request Oct 17, 2026
## 1.14.1

* Bump uraimo/run-on-arch-action to v3 to fix pytest job ([#3221](PyO3/maturin#3221))
* Fix platform tag logic to generate the same as cpython on AIX ([#3220](PyO3/maturin#3220))
* Bump pyo3-introspection ([#3227](PyO3/maturin#3227))
* Upgrade cargo-zigbuild & cargo-xwin ([#3228](PyO3/maturin#3228))
* Fix issues around crates enabling abi3 and abi3t features ([#3226](PyO3/maturin#3226))
* Add PEP 740 publish attestations to PyPI releases ([#3230](PyO3/maturin#3230))
* Set PYO3_PYTHON to run scripts for stable ABI builds ([#3233](PyO3/maturin#3233))
* Fix shell quoting in CI scripts ([#3231](PyO3/maturin#3231))

## 1.14.0

* Support parent-relative pyproject metadata in sdists ([#3182](PyO3/maturin#3182))
* Update PyPI platform tag validation ([#3187](PyO3/maturin#3187))
* Maint: update setup emsdk action in generate-ci ([#3194](PyO3/maturin#3194))
* Fix: only shim bin wheels during auditwheel repair ([#3197](PyO3/maturin#3197))
* Fix: avoid editable ELF truncation from stale hardlinks ([#3199](PyO3/maturin#3199))
* Fix Pyodide Emscripten platform tags ([#3191](PyO3/maturin#3191))
* Use pax instead of GNU headers for tar ([#3203](PyO3/maturin#3203))
* Feat: add default exclude `__pycache__` and `*.pyc` files ([#3202](PyO3/maturin#3202))
* Add support for finding free-threaded interpreters for `--find-interpreters` ([#3206](PyO3/maturin#3206))
* Stubs: also generate them for mixed PyO3 projects ([#3211](PyO3/maturin#3211))
* Don't depend on CFFI on PyPy ([#3213](PyO3/maturin#3213))
* Support pyo3 abi3t features on Python3.15 and PyO3 0.29 ([#3113](PyO3/maturin#3113))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants