From 30e4a28714ec202df546942a668bb7ed66133bb4 Mon Sep 17 00:00:00 2001 From: "Ryan M. Richard" Date: Fri, 11 Sep 2026 15:04:16 -0500 Subject: [PATCH] Quote SKBUILD_CMAKE_DEFINE so cibuildwheel can parse it 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 --- .github/actions/build_pypi_dist/action.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/actions/build_pypi_dist/action.yml b/.github/actions/build_pypi_dist/action.yml index b8e9155..e852104 100644 --- a/.github/actions/build_pypi_dist/action.yml +++ b/.github/actions/build_pypi_dist/action.yml @@ -328,8 +328,23 @@ runs: # cmake.define.*, ";"-separated KEY=VALUE) rather than # SKBUILD_CMAKE_ARGS, which needs_openmp already claims on macOS -- # a second assignment to it there would clobber the OpenMP hints. - env_linux+=("SKBUILD_CMAKE_DEFINE=ENABLE_XHOST=OFF") - env_macos+=("SKBUILD_CMAKE_DEFINE=ENABLE_XHOST=OFF") + # + # The inner quotes around ENABLE_XHOST=OFF are load-bearing, for the + # same class of reason as CMAKE_PREFIX_PATH above. 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. An unquoted value of ENABLE_XHOST=OFF is itself + # a syntactically valid bash assignment, and bashlex_eval.evaluate_node + # has no handler for that node kind, so the whole build dies before + # before_all even runs, with + # + # ValueError: Unsupported bash construct: 'assignment' + # + # Quoting makes it a plain word; the quotes are stripped during + # evaluation, so CMake still sees ENABLE_XHOST=OFF. This bites any + # value containing "=", on every platform -- not just macOS. + env_linux+=('SKBUILD_CMAKE_DEFINE="ENABLE_XHOST=OFF"') + env_macos+=('SKBUILD_CMAKE_DEFINE="ENABLE_XHOST=OFF"') join_and() { local out="" item