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

Add tool for combining macOS builds into universal build #208

Merged
merged 2 commits into from
Dec 23, 2023

Conversation

bgilbert
Copy link
Member

Apple clang supports building for multiple architectures at once, e.g. -arch arm64 -arch x86_64. However, some projects make configuration decisions based on the Meson host CPU type, and thus need to build separately for arm64 and x86_64. We'll handle this by configuring and building twice, and then combining the two bdist artifacts outside of Meson.

Add a tool that walks multiple bdist archives, runs lipo to combine Mach-O binaries, adds all architecture-specific relocation files, verifies that all other files are identical between builds, and produces a new tarball. Filesystem metadata for duplicated items is taken from the first input specified on the command line.

Update the Direct workflow to emit Meson-produced bdist archives, including a universal archive on macOS. Include both architectures in the latter's filename for clarity, since toolchain support for deprecated architectures historically hasn't lasted forever.

Apple clang supports building for multiple architectures at once, e.g.
`-arch arm64 -arch x86_64`.  However, some projects make configuration
decisions based on the Meson host CPU type, and thus need to build
separately for arm64 and x86_64.  We'll handle this by configuring and
building twice, and then combining the two bdist artifacts outside of
Meson.

Add a tool that walks multiple bdist archives, runs `lipo` to combine
Mach-O binaries, adds all architecture-specific relocation files, verifies
that all other files are identical between builds, and produces a new
tarball.  Filesystem metadata for duplicated items is taken from the
first input specified on the command line.

Signed-off-by: Benjamin Gilbert <[email protected]>
Create a universal archive on macOS.  Include both architectures in the
filename for clarity, since toolchain support for deprecated architectures
historically hasn't lasted forever.

Drop compression from the artifact Zips, since those now just wrap an
inner compressed artifact.

Signed-off-by: Benjamin Gilbert <[email protected]>
@openslide-bot
Copy link
Contributor

DCO signed off ✔️

All commits have been signed off. You have certified to the terms of the Developer Certificate of Origin, version 1.1. In particular, you certify that this contribution has not been developed using information obtained under a non-disclosure agreement or other license terms that forbid you from contributing it under the GNU Lesser General Public License, version 2.1.

@bgilbert bgilbert merged commit bbc7ef8 into openslide:main Dec 23, 2023
12 checks passed
@bgilbert bgilbert deleted the direct branch December 23, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants