Conversation
Build riscv64 wheels for healpy, the Cython wrapper around the bundled/vendored cfitsio and HEALPix C++ (incl. libsharp) libraries. Upstream publishes no riscv64 wheel anywhere. Mirrors upstream's cibuildwheel.yml, narrowed to Linux/riscv64.
luhenry
added a commit
that referenced
this pull request
Sep 28, 2026
Contributor
|
The cp314 leg of PR #2430 (run 36393265628, job 108833715006) segfaulted inside libgomp during test_sphtfunc.py::test_map2alm_pol ("Fatal Python error: Segmentation fault", exit 139), with the C stack trace going healpy._sphtools -> libgomp -> libsharp -> libgomp -> libc. cp313 on the same commit built and tested clean. That signature matches gotcha 166 (riscv64 runners' libgomp faulting on dynamic/guided OpenMP schedules) exactly. cextern/healpix vendors libsharp, whose SHT execution path (sharp.c's map2phase/phase2map/ sharp_execute_job) and Gauss-Legendre root finder (sharp_legendre_roots.c) all use schedule(dynamic,*); sharp_mpi.c's own instance is dead code here (behind #ifdef USE_MPI, never defined by this build). Patch 0002 moves those four loops to schedule(static), mirroring the existing lightgbm/4.7.0/0002 patch for the same defect, tagged Upstream-Status: Inappropriate with the tracking issue (#617).
CI's cp313 leg segfaulted in test_dist2holes_no_hole_filter (PR #2430, run 36412601673) on hp.dist2holes(mask), a different crash than the one 0002 already fixes. The C++ dist2holes() (mask_tools.cc) and the swap_scheme() it calls on RING masks (healpix_map.h) each contain OpenMP loops using dynamic scheduling, matching gotcha 166's libgomp signature again, this time in HEALPix C++ rather than libsharp.
The OpenMP fix patches are applied with a plain `git apply`, which leaves the checkout dirty at the 1.20.0 tag. setuptools_scm then reports the dirty tree as a post-release dev version (1.20.1.dev0+g<sha>.d<date>) instead of 1.20.0, which the publish step correctly rejects since it doesn't match docs/packages/healpy.yaml. Set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_HEALPY in CIBW_ENVIRONMENT, matching the established pattern used by every other package in this repo that patches a setuptools_scm checkout (gotcha 31).
luhenry
marked this pull request as ready for review
September 28, 2026 21:59
luhenry
added a commit
that referenced
this pull request
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
healpy1.20.0Builds cfitsio, HEALPix C++ (with libsharp) and the Cython extensions healpy wraps them with; libsharp's SIMD paths already fall back to portable scalar code off x86. Upstream publishes no riscv64 wheel.
Mirrors upstream's
cibuildwheel.yml.Differs from upstream
Matrix: cp312/cp313/cp314 - upstream builds no cp314t either, and astropy (a hard runtime dependency) has no wheel for it anywhere
Testing
License: Wheel bundles cfitsio (NASA, permissive) and HEALPix C++/libsharp (GPL-2.0) plus libsharp's bundled pocketfft (BSD-3-Clause); upstream ships no licence text for any of them, so the build adds it.
Patches
0001-Ship-the-licences-of-the-vendored-cfitsio-HEALPix-C.patch- Upstream-Status: To upstream. Adds LICENSE. files at the project root for setuptools' default glob to pick up. Reproduces on any architecture, not riscv64-only.