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

Fix multiarch macOS build by removing brewed liblzma #1207

Closed jmarshall closed 1 year ago

jmarshall commented 1 year ago

Python 3.11 is now the first actions/setup-python Python built to target universal2 (i.e., x86_64/arm64 multiarch) on macOS. (I think in the past 3.9 and 3.10 were also built to target universal2 for a while — at least, ISTR seeing multiarch builds on earlier Python versions — but this was later reverted; see actions/python-versions#114.)

Brewed packages such as xz (which provides liblzma.dylib and liblzma.a) are built for only a single native architecture. This led to build and configure failures when the native-only liblzma.dylib was linked against by a multiarch compilation.

Work around this by unlinking the xz package so that this brewed library is not found by the linker, failing back to the system .tbd file instead. If later build steps use brewed commands that need this library, we may need to brew link it again later, but for now we get away without it.

This enables us to reinstate the Python 3.11 build on macOS. Fixes #1205.