-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github: cross-compile arm64 macOS asset (#796)
Continue the recent `zig cc` work [1], such that the next configlet release will have two new release assets: configlet_4.0.0-beta.14_macos_arm64.tar.gz configlet_4.0.0-beta.14_macos_arm64.tar.gz.minisig where the archive contains the executable: $ file ./configlet configlet: Mach-O 64-bit arm64 executable, flags:<NOUNDEFS|DYLDLINK|TWOLEVEL|PIE|HAS_TLV_DESCRIPTORS> `configlet uuid` now uses [2] `std/sysrand`, which on macOS uses [3] the Security Framework. So to produce the macOS arm64 configlet, it's easiest to cross-compile from macOS x86_64, where the macOSX SDK is already available. Make the cross-compile and install-zig scripts support macOS, and add a build job for it. It looks like the macos-12 GitHub runner has SDK versions 12.3 and 13.1 installed. Use the latest one. The new executable is about 1.09 MiB, which is notably larger than the 655 KiB macOS x86_64 executable. Possible ways to reduce the size in the future: - Enable LTO when `zig ld` supports it [4]. - Compile it natively, when GitHub begins to provide a hosted arm64 macOS runner [5]. - Compile it natively, using a non-GitHub arm64 macOS runner. Refs: #24 Refs: #122 Refs: #764 [1] 0e8d665, ".github, config: use Zig to cross-compile arm64 Linux asset", 2023-08-13 [2] 53a75a2, "nimble, uuid: generate UUIDs via std/sysrand, not pragmagic/uuids", 2023-08-07 [3] https://github.com/nim-lang/Nim/blob/v2.0.0/lib/std/sysrand.nim#L235-L256 [4] https://www.github.com/ziglang/zig/issues/8680 [5] https://www.github.com/github/roadmap/issues/528
- Loading branch information
Showing
3 changed files
with
69 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters