From eb98fefe240aedc9a82898923c1260d9d2408fa1 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Tue, 23 Aug 2022 00:16:51 -0700 Subject: [PATCH] build-rust-crate: handle ILP32 platforms correctly This commit corrects the value of `CARGO_CFG_TARGET_POINTER_WIDTH` for ILP32 machines like the Apple Watch and mips64n32. --- pkgs/build-support/rust/build-rust-crate/configure-crate.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix index 1c946764c758..5168eb6ab759 100644 --- a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix @@ -130,7 +130,7 @@ in '' export CARGO_CFG_UNIX=1 export CARGO_CFG_TARGET_ENV="gnu" export CARGO_CFG_TARGET_ENDIAN=${if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"} - export CARGO_CFG_TARGET_POINTER_WIDTH=${toString stdenv.hostPlatform.parsed.cpu.bits} + export CARGO_CFG_TARGET_POINTER_WIDTH=${with stdenv.hostPlatform; toString (if isILP32 then 32 else parsed.cpu.bits)} export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name} export CARGO_MANIFEST_DIR=$(pwd)