Skip to content

Reenables building MacOS PyPI package - #73

Merged
ryanmrichard merged 8 commits into
masterfrom
get_macos_on_pypi
Sep 15, 2026
Merged

ryanmrichard merged 8 commits into
masterfrom
get_macos_on_pypi

Conversation

@ryanmrichard

@ryanmrichard ryanmrichard commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Summary

Publishes a macOS wheel for nwchemex-scf, the only compiled repo in the ecosystem without one (0.0.60 ships manylinux + sdist only, while ten siblings all publish macosx_*_arm64).

⚠️ Merge NWChemEx/.github#192 first. This branch's macOS leg cannot succeed without it.

What's here

Three changes, no scaffolding:

  1. .github/workflows/merge.yaml — drop filter_release_matrix, which stripped macos-14 out of release_matrix. It was added for a macOS pybind11 segfault that was fixed in Fix macOS pybind11 module segfault: Python_FIND_STRATEGY=LOCATION .github#189; verified below that it does not recur in the wheel path.
  2. cxx/src/scf/xc/grid_from_integratorxx.cpp — don't capture a structured binding in the dispatch lambda. AppleClang rejects it.
  3. .licenserc.yaml — ignore build*, not just build, matching .gitignore.

The AppleClang bug is worth a second look

grid_from_integratorxx.cpp:217:32: error: reference to local binding 'molecule'
  declared in enclosing function 'scf::xc::GridFromIntegratorXX::run_'

Capturing a structured binding is C++20 (P1091). GCC implements it, AppleClang does not.

No existing job compiles with AppleClang. cibuildwheel builds with /usr/bin/clang++, while the macOS dev matrix uses Homebrew clang-18 and gcc-14 — both of which implement P1091 — and Linux uses gcc-14/clang-18. So this file has been unbuildable on the actual release compiler since #71 while every CI leg stayed green. Of the 20 structured bindings in cxx/src, this is the only file that also contains a capturing lambda.

Worth considering as a follow-up: an AppleClang leg in the macOS dev matrix, so release-compiler breakage surfaces in PR CI instead of at release time.

Verification

Proven on a real macos-14 runner before merging, via a temporary non-publishing dry-run workflow (removed in 959cf4c). Run 34644965231:

nwchemex_scf-0.0.61.dev6+gfbd960ac2-cp312-cp312-macosx_14_0_arm64.whl
twine check: PASSED with warnings
Importing chemist … parallelzone … pluginplay … scf … simde … tensorwrapper … wtf
Imported 7 module(s) from nwchemex_scf cleanly
1 wheel produced in 10 minutes
  • Tag is macosx_14_0_arm64, matching every other needs_mpi sibling. cibuildwheel builds 11_0; delocate retags to 14_0 after vendoring Homebrew's MPI stack, exactly as build_pypi_dist documents.
  • The pybind11 segfault does not recur. import_check.py imported scf.cpython-312-darwin.so cleanly under python.org framework CPython 3.12.
  • Also built and smoke-tested locally on two configurations; pz.runtime.RuntimeView() reaches MPI_Init against the vendored open-mpi and scf.load_modules registers 31 modules, so the Linux MPI-vendoring dead end does not reproduce on macOS.

Knock-on effect

pull_request.yaml:32-43 documents that the absence of a macOS SCF wheel is what forces pip install nwchemex to source-build a stale sdist on macOS. Once this publishes, the allow_macos_failure: "true" masks in pull_request.yaml and nightly.yaml should be re-evaluated — separate PR.

🤖 Generated with Claude Code

@ryanmrichard ryanmrichard self-assigned this Sep 10, 2026
ryanmrichard and others added 7 commits September 11, 2026 14:59
.gitignore already uses `build*/`, so a second tree (build-debug/, build2/,
a renamed one) is invisible to git but still walked by license-eye, which
matched only the literal name `build`. On a configured tree that is gigabytes
of CMake/FetchContent output per commit, and the walk fails outright when a
concurrent build mutates it mid-scan.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
GitHub only exposes a workflow_dispatch workflow once its file exists on the
default branch; dispatching from the branch that adds it answers

  HTTP 404: workflow wheel_dryrun.yaml not found on the default branch

which makes dispatch useless for the one job it was added to do -- prove the
macOS wheel builds *before* anything lands on master. A push trigger scoped to
this branch has no such requirement.

A push event carries no inputs, so inputs.platform defaults to macos, the leg
this exists to exercise.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Temporary. build_pypi_dist@master currently dies before before_all with
"Unsupported bash construct: 'assignment'" -- see the first dry run,
34641892205. Validate the fix here before it lands on .github master, which
every repo in the ecosystem consumes at @master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AppleClang rejects it:

  grid_from_integratorxx.cpp:217:32: error: reference to local binding
  'molecule' declared in enclosing function
  'scf::xc::GridFromIntegratorXX::run_'

Capturing a structured binding is C++20 (P1091). GCC implements it, so the
Linux release wheel and both Linux dev legs compile this fine. AppleClang on
the macos-14 runner does not, and AppleClang is reached only by the wheel
build -- cibuildwheel compiles with /usr/bin/clang++, while the macOS dev
matrix uses Homebrew clang-18 and gcc-14, both of which implement P1091. So
no existing job covers this compiler, and the file has been unbuildable there
since it was added in #71.

Binding the input to an ordinary reference first sidesteps the rule entirely
and compiles under any C++17 compiler. Verified against the failing dry run,
34642262844.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Scaffolding. It did its job: three runs on a real macos-14 runner found the
cibuildwheel SKBUILD_CMAKE_DEFINE quoting defect (which broke wheel builds for
every repo in the ecosystem, on both platforms) and an AppleClang compile error
in grid_from_integratorxx.cpp that no green job was exercising, then produced a
verified macosx_14_0_arm64 wheel.

Dropping it also removes the temporary @macos_wheel_fixes pin, so nothing in
this branch references anything but NWChemEx/.github@master.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The last CI run on this branch predates the ecosystem config-dependency
rollout finishing (NWXCMake 0.2.3 + rebuilt pluginplay/utilities/wtf/
tensorwrapper/chemist/simde). Empty commit, nothing else.
@ryanmrichard

Copy link
Copy Markdown
Member Author

This is stuck in a cycle where the SCF version that comes in from the nwchemex package is broken and won't build, so the current SCF won't build. I'm going to try pushing this through to break the cycle. I'll open a new PR to verify it works.

@ryanmrichard
ryanmrichard merged commit da1272f into master Sep 15, 2026
8 of 12 checks passed
@ryanmrichard
ryanmrichard deleted the get_macos_on_pypi branch September 15, 2026 14:53
@github-actions

Copy link
Copy Markdown
Contributor

🚀 [bumpr] Bumped!
New version:v0.0.61
Changes:v0.0.60...v0.0.61

ryanmrichard added a commit that referenced this pull request Sep 28, 2026
SCF#73's test_cmake_build previously failed on all four legs
(Linux+macOS, both compilers) with "link interface of nwx::simde
contains nwx::chemist but the target was not found" -- not the
config-dependency bug NWXCMake#87/#88 already fixed, but a self-
collision: the integration-testing step's `pip install nwchemex`
transitively floor-pins nwchemex-scf>=0.0.57, pulling in SCF's own
stale, previously-published wheel (0.0.60, predating the rollout).
That stale wheel bundles the old broken two-line simdeConfig.cmake,
and since it installs into the same site-packages/lib/cmake/simde/
path as the freshly-resolved nwchemex-simde 0.0.81, it clobbered the
correct config.

#73 merged anyway: merge.yaml doesn't run test_cmake_build, so the
new release (nwchemex-scf 0.0.61, published 2026-09-15T15:18 UTC) was
built clean from git master, unaffected by the collision, and its own
bundled dependency configs are now correct. This empty commit re-runs
test_cmake_build to confirm that installing the new self-consistent
nwchemex-scf no longer clobbers anything.
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