From 05e707ddd2684dbace5ec19e48e11181f9960c52 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 24 Jul 2023 21:41:22 -0700 Subject: [PATCH 1/2] buildRustCrate: add isMips64n32 to badPlatforms Rust is not yet able to target the n32 ABI on mips64. Let's add `isMips64n32` to the `meta.badPlatforms` of all derivations created by buildRustCrate. I use this to automatically detect which packages on my system can be built for n32 (almost all of them) and build those using n32, and the few packages (mainly those that depend on boost or rust) that can't for n64. --- pkgs/build-support/rust/build-rust-crate/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index f6079b7316d61..4a08d17113fb3 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -362,6 +362,10 @@ crate_: lib.makeOverridable meta = { mainProgram = crateName; + badPlatforms = [ + # Rust is currently unable to target the n32 ABI + lib.systems.inspect.patterns.isMips64n32 + ]; }; } // extraDerivationAttrs ) From a38579ea862666b4727c2686e5a66ae1bf1d41fc Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 24 Jul 2023 21:48:48 -0700 Subject: [PATCH 2/2] buildRustPackage: add isMips64n32 to badPlatforms Rust is not yet able to target the n32 ABI on mips64. Let's add `isMips64n32` to the `meta.badPlatforms` of all derivations created by buildRustPackage. I use this to automatically detect which packages on my system can be built for n32 (almost all of them) and build those using n32, and the few packages (mainly those that depend on boost or rust) that can't for n64. --- pkgs/build-support/rust/build-rust-package/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 9b2e62fc240a6..754a3926226cf 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -167,5 +167,9 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "carg "x86_64-redox" "wasm32-wasi" ]; + badPlatforms = [ + # Rust is currently unable to target the n32 ABI + lib.systems.inspect.patterns.isMips64n32 + ]; } // meta; })