From ea706f9895e46129746c9309d8bda2dbb4330ced Mon Sep 17 00:00:00 2001 From: Niklas Korz Date: Sat, 15 Feb 2025 00:06:57 +0100 Subject: [PATCH] rustc: fix combining no_std targets with other targets --- pkgs/development/compilers/rust/1_84.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/development/compilers/rust/1_84.nix b/pkgs/development/compilers/rust/1_84.nix index 5a076c84c88c..149d43e99ef7 100644 --- a/pkgs/development/compilers/rust/1_84.nix +++ b/pkgs/development/compilers/rust/1_84.nix @@ -28,6 +28,7 @@ llvm_19, wrapCCWith, overrideCC, + fetchpatch, }@args: let llvmSharedFor = @@ -50,6 +51,16 @@ import ./default.nix rustcVersion = "1.84.1"; rustcSha256 = "Xi+11JYopUn3Zxssz5hVqzef1EKDGnwq8W4M3MMbs3U="; + rustcPatches = [ + # Fix for including no_std targets by default, shipping in Rust 1.87 + # https://github.com/rust-lang/rust/pull/137073 + (fetchpatch { + name = "bootstrap-skip-nostd-docs"; + url = "https://github.com/rust-lang/rust/commit/97962d7643300b91c102496ba3ab6d9279d2c536.patch"; + hash = "sha256-DKl9PWqJP3mX4B1pFeRLQ8/sO6mx1JhbmVLTOOMLZI4="; + }) + ]; + llvmSharedForBuild = llvmSharedFor pkgsBuildBuild; llvmSharedForHost = llvmSharedFor pkgsBuildHost; llvmSharedForTarget = llvmSharedFor pkgsBuildTarget; @@ -135,5 +146,6 @@ import ./default.nix "wrapCCWith" "overrideCC" "pkgsHostTarget" + "fetchpatch" ] )