From 57e73d23bb6cc89a25293e5cfb26787438b4efba Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 24 Apr 2023 17:35:35 +0000 Subject: [PATCH] rustc,rustPlatform.buildRustPackage: broaden platforms rustc supports way more platforms than Linux and Darwin. We might not be able to build it for every platform at the moment, but that's what meta.broken is for. There are other platforms that rustc can produce binaries for, but can't run on itself, so those are listed in the defaults for buildRustPackage. --- .../rust/build-rust-package/default.nix | 11 ++++++++++- pkgs/development/compilers/rust/rustc.nix | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index 2cd30af56b72..73a3f12b20c8 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -158,6 +158,15 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "carg meta = { # default to Rust's platforms - platforms = rustc.meta.platforms; + platforms = rustc.meta.platforms ++ [ + # Platforms without host tools from + # https://doc.rust-lang.org/nightly/rustc/platform-support.html + "armv7a-darwin" + "armv5tel-linux" "armv6l-linux" "armv7a-linux" "m68k-linux" + "riscv32-linux" + "armv6l-netbsd" + "x86_64-redox" + "wasm32-wasi" + ]; } // meta; }) diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix index a1c618979934..75e8a451105c 100644 --- a/pkgs/development/compilers/rust/rustc.nix +++ b/pkgs/development/compilers/rust/rustc.nix @@ -232,6 +232,19 @@ in stdenv.mkDerivation rec { description = "A safe, concurrent, practical language"; maintainers = with maintainers; [ cstrahan globin havvy ] ++ teams.rust.members; license = [ licenses.mit licenses.asl20 ]; - platforms = platforms.linux ++ platforms.darwin; + platforms = [ + # Platforms with host tools from + # https://doc.rust-lang.org/nightly/rustc/platform-support.html + "x86_64-darwin" "i686-darwin" "aarch64-darwin" + "i686-freebsd13" "x86_64-freebsd13" + "x86_64-solaris" + "aarch64-linux" "armv7l-linux" "i686-linux" "mipsel-linux" + "mips64el-linux" "powerpc64-linux" "powerpc64le-linux" + "riscv64-linux" "s390x-linux" "x86_64-linux" + "aarch64-netbsd" "armv7l-netbsd" "i686-netbsd" "powerpc-netbsd" + "x86_64-netbsd" + "i686-openbsd" "x86_64-openbsd" + "i686-windows" "x86_64-windows" + ]; }; }