Skip to content

[CI] Reformat the macOS repair-wheel-command as a multiline script#19664

Merged
tlopex merged 1 commit into
apache:mainfrom
tlopex:wheel-macos-repair-multiline
Jun 3, 2026
Merged

[CI] Reformat the macOS repair-wheel-command as a multiline script#19664
tlopex merged 1 commit into
apache:mainfrom
tlopex:wheel-macos-repair-multiline

Conversation

@tlopex

@tlopex tlopex commented Jun 3, 2026

Copy link
Copy Markdown
Member

The single-line 'bash -c' form is hard to read and edit; rewrite it as a readable multiline command. Functionally equivalent to the previous inline version: delocate the wheel, then ad-hoc re-sign every bundled Mach-O and repack.

The re-sign step is required because delocate's edits invalidate the ad-hoc signature of tvm/lib/libtvm_runtime.dylib (it LC_LOADs the excluded rpath/libtvm_ffi.dylib, which ships in the separate apache-tvm-ffi package), and arm64 dyld SIGKILLs an invalidly-signed Mach-O on import. 'wheel' is installed explicitly since it is absent from cibuildwheel's repair venv, and the delocated wheel is located by glob since delocate may retag it.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request refactors the macOS repair-wheel-command in pyproject.toml into a multi-line script to improve readability and handle re-signing of Mach-O binaries after delocation. A critical issue was identified where using {dest_dir} for intermediate steps and globbing/deleting wheel files could cause build failures or delete other wheels in a shared environment. It is recommended to use a separate temporary directory for intermediate delocated wheels as suggested.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pyproject.toml
@tlopex tlopex force-pushed the wheel-macos-repair-multiline branch from 6a94913 to 93b9f59 Compare June 3, 2026 18:32
@tlopex

tlopex commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

@tvm-bot rerun

The single-line 'bash -c' form is hard to read and edit; rewrite it as a readable multiline command. Functionally equivalent to the previous inline version: delocate the wheel, then ad-hoc re-sign every bundled Mach-O and repack.

The re-sign step is required because delocate's edits invalidate the ad-hoc signature of tvm/lib/libtvm_runtime.dylib (which links the excluded libtvm_ffi.dylib, shipped in the separate apache-tvm-ffi package), and arm64 dyld SIGKILLs an invalidly-signed Mach-O on import. 'wheel' is installed explicitly since it is absent from cibuildwheel's repair venv, and the delocated wheel is located by glob since delocate may retag it.
@tlopex tlopex force-pushed the wheel-macos-repair-multiline branch from 93b9f59 to 6a72fce Compare June 3, 2026 20:44
@tlopex tlopex merged commit 9d68a1d into apache:main Jun 3, 2026
10 checks passed
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