Skip to content

Commit

Permalink
fix(rust-cc): reorder zig cc args
Browse files Browse the repository at this point in the history
reorder args to ensure `target` is correctly overriden for compatibility
with zig

ziglang/zig#4911

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
  • Loading branch information
rvolosatovs committed Mar 25, 2024
1 parent 11b75c2 commit a1a7aed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rust/mkAttrs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ with self.lib.rust.targets;
# https://actually.fyi/posts/zig-makes-rust-cross-compilation-just-work
# https://github.com/rust-cross/cargo-zigbuild
final.writeShellScriptBin "${target}-zigcc" ''
${final.zig}/bin/zig cc -target ${target'} ${optionalString pkgsCross.stdenv.buildPlatform.isDarwin ''--sysroot="$SDKROOT" -I"$SDKROOT/usr/include" -L"$SDKROOT/usr/lib" -F"$SDKROOT/System/Library/Frameworks"''} $@
${final.zig}/bin/zig cc ${optionalString pkgsCross.stdenv.buildPlatform.isDarwin ''--sysroot="$SDKROOT" -I"$SDKROOT/usr/include" -L"$SDKROOT/usr/lib" -F"$SDKROOT/System/Library/Frameworks"''} $@ -target ${target'}
'';

targetArgs =
Expand Down

0 comments on commit a1a7aed

Please sign in to comment.