Skip to content

Conversation

@nmburgan
Copy link
Member

@nmburgan nmburgan commented Aug 31, 2025

This makes several changes that enable us to build for all supported MacOS versions on any kind of MacOS host running the latest version. It sets some flags to tell clang to generate binaries compatible with everything since MacOS 13. This also adds an osx-15-x86_64 platform, and tweaks the build task to make sure you are running in a shell for the architecture you are trying to build for. By using the 'arch' command to open a shell for x86_64 before invoking the build rake task, we use Rosetta 2 to allow us to build for x86_64 on an arm64 host just like we would if we were building on an x86_64 host. This allows us to avoid any of the many workarounds needed for cross compiling. While this method is rather slow, it easier and potentially safer than all of the workarounds needed for cross-compilation.

This also uses a platform string of macos-all-<arch> since we are now able to build for all supported MacOS versions in one binary. This also modifies the build action to allow overriding the vanagon branch and shared-actions branch for easier testing.

@nmburgan nmburgan force-pushed the macos_in_gha branch 3 times, most recently from 3645a26 to f10effc Compare August 31, 2025 03:13
@nmburgan
Copy link
Member Author

nmburgan commented Aug 31, 2025

Will remove the test commit before merging. Unfortunately, this is really the only way to test it before it gets merged.

@nmburgan nmburgan force-pushed the macos_in_gha branch 3 times, most recently from 75cf71a to c0f3fec Compare August 31, 2025 21:54
This makes several changes that enable us to build for all supported
MacOS versions on any kind of MacOS host running the latest version. It
sets some flags to tell clang to generate binaries compatible with
everything since MacOS 13. This also adds an osx-15-x86_64 platform, and
tweaks the build task to make sure you are running in a shell for the
architecture you are trying to build for. By using the 'arch' command to
open a shell for x86_64 before invoking the build rake task, we use
Rosetta 2 to allow us to build for x86_64 on an arm64 host just like we
would if we were building on an x86_64 host. This allows us to avoid any
of the many workarounds needed for cross compiling. While this method is
rather slow, it easier and potentially safer than all of the workarounds
needed for cross-compilation.

This also uses a platform string of macos-all-<arch> since we are now
able to build for all supported MacOS versions in one binary. This also
modifies the build action to allow overriding the vanagon branch and
to be able to use a "dev" branch of shared-actions for testing.
Unfortunately, the 'uses' parameter has to be a static string, which is
why we are limited to a specific branch named 'dev'.
@nmburgan nmburgan merged commit 6528053 into main Sep 1, 2025
5 checks passed
@nmburgan nmburgan deleted the macos_in_gha branch September 1, 2025 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants