Fix multiarch macOS build by removing brewed liblzma #1207
Merged
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.
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.