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

fix(darwin): do not use zig for darwin2darwin #285

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions lib/rust/mkAttrs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,21 @@ with self.lib.rust.targets;
# Removing vendor references here invalidates the signature, which is required on aarch64-darwin
doNotRemoveReferencesToVendorDir = true;
}
# Use `rust-lld` linker and Zig C compiler for Darwin targets
// optionalAttrs pkgsCross.stdenv.hostPlatform.isDarwin {
preBuild = ''
export SDKROOT="${macos-sdk}"
'';

# Use `rust-lld` linker for Darwin targets
"CARGO_TARGET_${toUpper (kebab2snake target)}_LINKER" = "rust-lld";
}
// (
if pkgsCross.stdenv.hostPlatform.isDarwin
if final.stdenv.buildPlatform.isDarwin && pkgsCross.stdenv.hostPlatform.isDarwin
then {
# use defaults for Darwin-to-Darwin builds
}
# Use Zig C compiler and `rust-lld` linker for Darwin targets on non-Darwin platforms
else if pkgsCross.stdenv.hostPlatform.isDarwin
then {
depsBuildBuild = [
crossZigCC
Expand Down
Loading