Skip to content

Universal builds for macOS#1820

Merged
mosteo merged 4 commits into
alire-project:masterfrom
simonjwright:universal-build
Jan 14, 2025
Merged

Universal builds for macOS#1820
mosteo merged 4 commits into
alire-project:masterfrom
simonjwright:universal-build

Conversation

@simonjwright

Copy link
Copy Markdown
Contributor

For macOS (Darwin), some users are running on Intel silicon (x86_64), some on Apple silicon (aarch64). The purpose of this PR is to generate universal binaries of alr for macOS, so that users won't need to specify which version they need -- the loader will select the appropriate binary.

To do this, in both the nightly.yml and the ci-macos.yml workflows a new job build-macos-universal runs after the build job has completed (which implies completion of its runs on macos-13 (x86_64) and macos-14 or macos-latest (aarch64)).

This job dowloads & unpacks the x86_64 build to x86_64/, and the aarch64 build to aarch64/. It then runs lipo to create the universal binary alr. The new binary has to be marked as executable, don't know why.

alr-<release>-bin-universal-macos.zip is created and uploaded to the release directory.

Notes:

  • All three binaries (aarch64, x86_64 and universal are created, mainly because I didn’t know how otherwise to preserve the outputs of the two parallel build matrix runs. This could cause confusion, which should be minimised when we update the ada-lang-io and alire.ada.dev sites
  • I didn’t know how to get the metadata for a build (RELEASE.dat etc), so I copied it from the aarch64 build.

For macOS (Darwin), some users are running on Intel silicon (x86_64),
some on Apple silicon (aarch64). The purpose of this commit is to
generate a universal binary of alr for macOS, so that users won't need
to specify which version they need -- the loader will select the
appropriate binary.

To do this, a new job 'build-macos-universal' runs after the 'build'
job has completed (which implies completion of its runs on macos-13
(x86_64) and macos-14 (aarch64)).

This job dowloads & unpacks the x86_64 build to x86_64/, and the
aarch64 build to aarch64/. It then copies aarch64/ to universal/ (so
as to include the additional information, and runs lipo to create the
universal binary in universal/bin/alr. The new binary has to be marked
as executable, don't know why.

alr-nightly-bin-universal-macos.zip is created and uploaded to the
release directory.

  * .github/workflows/nightly.yml (build-macos-universal): new.
For macOS (Darwin), some users are running on Intel silicon (x86_64),
some on Apple silicon (aarch64). The purpose of this commit is to
generate a universal binary of alr for macOS, so that users won't need
to specify which version they need -- the loader will select the
appropriate binary.

To do this, a new job 'build-macos-universal' runs after the 'build'
job has completed (which implies completion of its runs on macos-13
(x86_64) and macos-latest (aarch64)).

This job dowloads & unpacks the latest prerelease x86_64 build to
x86_64/, and the latest prerelease aarch64 build to aarch64/. It then
runs lipo to create the universal binary in ./bin/alr. The new binary
has to be marked as executable, don't know why.

alr-<release]-bin-universal-macos.zip is created and uploaded to the
release directory.

  * .github/workflows/ci-macos.yml (build-macos-universal): new.
@simonjwright

Copy link
Copy Markdown
Contributor Author

Updated from master branch.

@simonjwright

Copy link
Copy Markdown
Contributor Author

The purpose of this PR is to generate universal binaries of alr for macOS, so that users won't need to specify which version they need -- the loader will select the appropriate binary.

Badly phrased, I think - "the loader will select the appropriate architecture from the single binary executable" might be clearer

Comment thread .github/workflows/nightly.yml Outdated
Comment thread .github/workflows/nightly.yml Outdated
Comment thread .github/workflows/ci-macos.yml
Remove two steps that were inserted to check that no
com.apple.quarantine attributes were applied when the individual
architecture builds were downloaded (none were applied).

  * .github/workflows/nightly.yml (build-macos-universal):
      (check x86_64 attributes): remove.
      (check aarch64 attributes): remove.
@mosteo mosteo merged commit 3d280a5 into alire-project:master Jan 14, 2025
@simonjwright simonjwright deleted the universal-build branch January 14, 2025 14:33
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