Skip to content

Quote SKBUILD_CMAKE_DEFINE so cibuildwheel can parse it - #192

Merged
ryanmrichard merged 1 commit into
masterfrom
macos_wheel_fixes
Sep 14, 2026
Merged

ryanmrichard merged 1 commit into
masterfrom
macos_wheel_fixes

Conversation

@ryanmrichard

Copy link
Copy Markdown
Member

Summary

build_pypi_dist has been unable to build a wheel on any platform, in any repo since 65681cd. This restores it.

cibuildwheel does not hand CIBW_ENVIRONMENT to a shell. It splits it into KEY=VALUE assignments itself and evaluates each value with bashlex, its vendored mini-bash. The value ENABLE_XHOST=OFF is itself a syntactically valid bash assignment, and bashlex_eval.evaluate_node has no handler for that node kind, so every build died before before_all even ran:

ValueError: Unsupported bash construct: 'assignment'
  cibuildwheel/bashlex_eval.py:62

Reproduction

Against cibuildwheel 2.22.0's own parser, in isolation:

input result
SKBUILD_CMAKE_DEFINE=ENABLE_XHOST=OFF ValueError: Unsupported bash construct: 'assignment'
SKBUILD_CMAKE_DEFINE="ENABLE_XHOST=OFF" {'SKBUILD_CMAKE_DEFINE': 'ENABLE_XHOST=OFF'}

Quoting makes the value a plain word; bashlex strips the quotes during evaluation, so CMake still sees ENABLE_XHOST=OFF.

Scope

env_linux carried the identical defect — this is not macOS-specific.

It was latent rather than observed. The line landed 2026-09-10, and the most recent merge-to-master across all ten sibling repos is SimDE on 2026-09-08, so no release leg had ever run with it. The next merge to master in any of the ~11 repos would have failed its wheel build, and on a merge that also skips deploy_to_pypi — taking the Linux release down with it.

I audited every other env_* entry in the action: SKBUILD_CMAKE_DEFINE was the only value containing an unquoted =. Lines 297 and 310 were already quoted for a closely related reason.

Verification

Found by the first dry run of SCF's macOS wheel (34641892205, failed in 18s). With this fix, SCF's macOS leg builds, repairs, and verifies end to end (34644965231):

nwchemex_scf-0.0.61.dev6+gfbd960ac2-cp312-cp312-macosx_14_0_arm64.whl
twine check: PASSED with warnings
Imported 7 module(s) from nwchemex_scf cleanly

🤖 Generated with Claude Code

build_pypi_dist has been unable to build a wheel on any platform since
65681cd. cibuildwheel does not hand CIBW_ENVIRONMENT to a shell: it splits it
into KEY=VALUE assignments itself and evaluates each VALUE with bashlex, its
vendored mini-bash. The value ENABLE_XHOST=OFF is itself a syntactically valid
bash assignment, and bashlex_eval.evaluate_node has no handler for that node
kind, so every build died before before_all with

  ValueError: Unsupported bash construct: 'assignment'

Reproduced in isolation against cibuildwheel 2.22.0's own parser:

  parse_environment('SKBUILD_CMAKE_DEFINE=ENABLE_XHOST=OFF').as_dictionary({})
    -> ValueError: Unsupported bash construct: 'assignment'
  parse_environment('SKBUILD_CMAKE_DEFINE="ENABLE_XHOST=OFF"').as_dictionary({})
    -> {'SKBUILD_CMAKE_DEFINE': 'ENABLE_XHOST=OFF'}

Quoting makes the value a plain word; bashlex strips the quotes during
evaluation, so CMake still sees ENABLE_XHOST=OFF.

This was latent rather than observed: the line landed 2026-09-10 and no repo
in the ecosystem has merged to master since, so no release leg had run with
it. It was found by the first dry run of SCF's macOS wheel, but it is not
macOS-specific -- env_linux carried the identical defect.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ryanmrichard
ryanmrichard merged commit 0973559 into master Sep 14, 2026
2 checks passed
@ryanmrichard
ryanmrichard deleted the macos_wheel_fixes branch September 14, 2026 14:10
@github-actions

Copy link
Copy Markdown
Contributor

🚀 [bumpr] Bumped!
New version:v0.3.91
Changes:v0.3.90...v0.3.91

ryanmrichard added a commit that referenced this pull request Sep 14, 2026
The Linux leg's import check has never been able to pass for an MPI-linked
wheel:

  ImportError: libmpi.so.40: cannot open shared object file

By design the Linux wheel does not vendor MPI --
CIBW_REPAIR_WHEEL_COMMAND_LINUX excludes libmpi/libopen-rte/libopen-pal so it
links against the runtime system's OpenMPI, because vendoring is a dead end
(auditwheel bundles shared libraries but never the bin/orted that OpenMPI's
singleton startup needs). The other half of that contract is that something
must supply MPI wherever the wheel is imported, and nothing did:
CIBW_BEFORE_ALL_LINUX builds OpenMPI into /usr/local/openmpi inside the
manylinux *container*, while "Verify Wheel Installs" runs on the runner host.

Installing libopenmpi-dev/openmpi-bin there makes the host resemble the end
user's machine the wheel already documents as a requirement. Same packages
setup_nwx_dev_env uses, so the ABI matches what CIBW_BEFORE_ALL_LINUX compiled
against.

macOS is unaffected -- delocate vendors MPI into the wheel there -- which is
why the ParallelZone release that surfaced this passed on macos-14 and failed
only on Linux.

This was masked rather than new: import_check.py arrived in 65681cd, the same
commit that introduced the SKBUILD_CMAKE_DEFINE quoting defect fixed in #192.
Every build died before reaching verification, so the check had never actually
run on Linux. Found by NWChemEx/ParallelZone#161.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
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.

1 participant