pysam-developers / pysam

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.
https://pysam.readthedocs.io/en/latest/
MIT License
774 stars 274 forks source link

Our make-based libhts.a build produces incorrect results when cross-compiling #1231

Open jmarshall opened 11 months ago

jmarshall commented 11 months ago

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 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.