add nix flake#481
Open
caniko wants to merge 11 commits into
Open
Conversation
- Complete toolchain: cctools-port, ld64, TAPI, XAR, wrappers - SDK auto-detection, multi-arch support, configurable options - Rust helpers: crane integration, universal binaries, env setup - Minimal shell scripting, pure Nix data structures
The toolchain installs cctools only under arch-prefixed names
(<arch>-apple-<target>-codesign_allocate). Tools that ad-hoc sign Mach-O
binaries -- e.g. sigtool's `codesign` -- spawn `codesign_allocate` by bare
name via PATH and abort ("Failed to spawn codesign_allocate") unless the
caller sets $CODESIGN_ALLOCATE by hand. macOS itself ships it unprefixed at
/usr/bin/codesign_allocate.
Add an unprefixed `codesign_allocate` symlink to the primary arch's binary
(all arch variants are the same binary), so PATH-based spawning works out of
the box with no extra wiring.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a comprehensive Nix flake that enables building the OSXCross macOS cross-compilation toolchain in a reproducible, declarative way. The flake provides first-class integration with the Nix ecosystem including Rust cross-compilation helpers for use with rust-overlay and crane.
Alternatively, I can also maintain the flake downstream if you don't want to support
nix.Features
Core Toolchain
Rust Integration
mkCrossBuilderwraps crane for easy cross-buildsmkUniversalBinarycreates fat binaries from arm64 + x86_64 buildscargoEnvFor,mkCargoConfig,mkDevShellHookBuild Quality
Usage
Files Added
flake.nixmkOsxcross,mkRustHelpers, overlaynix/lib.nixnix/osxcross.nixnix/cctools-port.nixnix/wrapper.nixnix/sdk.nixnix/xar.nixnix/apple-libtapi.nixnix/rust.nixnix/README.mdTesting
Commit signature verification
Will sign the commit later.