Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GHA: create macOS universal binary with homebrew libraries #5953

Merged
merged 3 commits into from
Feb 4, 2023

Conversation

dyfer
Copy link
Member

@dyfer dyfer commented Jan 22, 2023

Purpose and Motivation

This PR replaces a partial script for manual creation of universal libraries for homebrew packages with a 3rd-party script which I wrote, that achieves this more reliably.

A little history how we got here:
GHA does not offer arm64 macOS runners, so in order to provide an arm64 build (or a universal one), we need to cross-compile. This requires all dependencies to be available as universal binaries, so at first we used vcpkg to create arm64 binaries of libsndfile and fftw, and created a script that manually created universal binaries of readline, qt5 and its dependencies. This script was fairly specific, didn't handle some packages well, was able to use caching in a limited way etc. Also, libsndfile in homebrew was not supporting mpeg at that time, so libsndfile was installed from vcpkg. Unfortunately, it wasn't possible to create a universal binary of libsndfile (because of the build issue with LAME library, I believe), only a single architecture arm64.

Libsndfile in homebrew now offers mpeg support, so we're coming full circle, again using homebrew dependencies in the main supercollider build, but this time as a universal binary.

I opted to download the script from my gist, as opposed to including it in this repo, as I believe it doesn't really belong here - it's a medium-term solution and rather circumstantial to SC itself. Eventually, I think we can stop using this method and use 1) official qt installer to get the universal binary of Qt6 (once we move to Qt6) and 2) use vcpkg to build universal binary of libsndfile (once the build issue is fixed). For now, this solution offers a universal binary and appears to support the same range of OS versions as the regular build (I tried running the universal build on macOS 10.14, which is currently the oldest supported OS for the regular build, and it seems to work fine).

One outstanding question is whether we pull it into develop for the next release, or do we want to release 3.13.1 with this, or maybe even 3.13.0-rcX so that it lands in 3.13.0?

Types of changes

  • New feature

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation (N/A)
  • This PR is ready for review

@dyfer dyfer added the comp: CI/CD continuous integration and deployment (github actions, etc.) label Jan 22, 2023
@dyfer dyfer marked this pull request as ready for review January 29, 2023 22:04
dyfer added 3 commits February 2, 2023 12:24
- use external script to manually create universal binaries
- use homebrew libraries in arm64 build
and remove x64 and arm64 builds
@dyfer dyfer force-pushed the gha-brew-universal branch from ae541ab to 8e989f3 Compare February 2, 2023 20:27
@dyfer
Copy link
Member Author

dyfer commented Feb 2, 2023

After conversation with @joshpar we will include this in 3.13.0-rc2. This PR now includes update to the changelogs regarding macos universal binary build.

@dyfer dyfer merged commit 61b163a into supercollider:3.13 Feb 4, 2023
@dyfer dyfer deleted the gha-brew-universal branch March 9, 2023 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: CI/CD continuous integration and deployment (github actions, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants