From bdf031dd4f1d5296689b01415a22b90f5b1fa228 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 28 Dec 2017 09:36:40 -0500 Subject: [PATCH] buildRustCrate: Set target_os to "macos" on darwin The rust compiler uses "macos" as "target_os" conditional on Mac OS[1] [1] https://github.com/rust-lang/rust/blob/8e7a609e635b728eba65d471c985ab462dc4cfc7/src/librustc_back/target/x86_64_apple_darwin.rs#L29 --- pkgs/build-support/rust/build-rust-crate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/build-rust-crate.nix b/pkgs/build-support/rust/build-rust-crate.nix index 8a9a07fd7a8f..4d5fbf1fcbf2 100644 --- a/pkgs/build-support/rust/build-rust-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate.nix @@ -98,7 +98,7 @@ let makeDeps = dependencies: export CARGO_PKG_AUTHORS="${authors}" export CARGO_CFG_TARGET_ARCH=${buildPlatform.parsed.cpu.name} - export CARGO_CFG_TARGET_OS=${buildPlatform.parsed.kernel.name} + export CARGO_CFG_TARGET_OS=${if buildPlatform.isDarwin then "macos" else buildPlatform.parsed.kernel.name} export CARGO_CFG_TARGET_FAMILY="unix" export CARGO_CFG_UNIX=1 export CARGO_CFG_TARGET_ENV="gnu"