Pysam is a Python package for reading, manipulating, and writing genomics data such as SAM/BAM/CRAM and VCF/BCF files. It's a lightweight wrapper of the HTSlib API, the same one that powers samtools, bcftools, and tabix.
Since #1140, we incorporate HTSlib by building libhts.a using HTSlib's own Makefile. CFLAGS, LDFLAGS, etc are computed for running ./configure and this make by consulting environment variables and the host Python's sysconfig.
Especially the latter is insufficient when cross-compiling, and we end up trying to link cross-built Cython extensions against a nativelibhts.a.
This was exhibited by the release.yaml GH action running on x86_64 macOS invoking cibuildwheel to cross-build an ARM macOS wheel. This succeeded but produced a non-importable wheel because it had linked against an x86_64 libhts.a.
Since #1140, we incorporate HTSlib by building libhts.a using HTSlib's own Makefile. CFLAGS, LDFLAGS, etc are computed for running
./configure
and thismake
by consulting environment variables and the host Python'ssysconfig
.Especially the latter is insufficient when cross-compiling, and we end up trying to link cross-built Cython extensions against a native libhts.a.
This was exhibited by the release.yaml GH action running on x86_64 macOS invoking cibuildwheel to cross-build an ARM macOS wheel. This succeeded but produced a non-importable wheel because it had linked against an x86_64 libhts.a.