Skip to content

Commit

Permalink
rust 1.41: Fix build with no_std only target
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Feb 22, 2020
1 parent c1a1650 commit 0b0e691
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkgs/development/compilers/rust/1_41_0.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
# request review, in case platforms cannot be covered.
# 2. The LLVM version used for building should match with rust upstream.
# 3. Firefox and Thunderbird should still build on x86_64-linux.

{ stdenv, lib
, buildPackages
, newScope, callPackage
, CoreFoundation, Security
, llvmPackages_5
, pkgsBuildTarget, pkgsBuildBuild
, fetchpatch
} @ args:

import ./default.nix {
rustcVersion = "1.41.0";
rustcSha256 = "0jypz2mrzac41sj0zh07yd1z36g2s2rvgsb8g624sk4l14n84ijm";
Expand All @@ -26,4 +36,13 @@ import ./default.nix {
};

selectRustPackage = pkgs: pkgs.rust_1_41_0;

rustcPatches = [
(fetchpatch {
url = "https://github.com/QuiltOS/rust/commit/f1803452b9e95bfdbc3b8763138b9f92c7d12b46.diff";
sha256 = "1mzxaj46bq7ll617wg0mqnbnwr1da3hd4pbap8bjwhs3kfqnr7kk";
})
];
}

(builtins.removeAttrs args [ "fetchpatch" ])
3 changes: 3 additions & 0 deletions pkgs/development/compilers/rust/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
, bootstrapVersion
, bootstrapHashes
, selectRustPackage
, rustcPatches ? []
}:
{ stdenv, lib
, buildPackages
Expand Down Expand Up @@ -73,6 +74,8 @@
sha256 = rustcSha256;
inherit enableRustcDev;

patches = rustcPatches;

# Use boot package set to break cycle
rustPlatform = bootRustPlatform;
} // lib.optionalAttrs (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) {
Expand Down
3 changes: 3 additions & 0 deletions pkgs/development/compilers/rust/rustc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
, enableRustcDev ? true
, version
, sha256
, patches ? []
}:

let
Expand Down Expand Up @@ -104,6 +105,8 @@ in stdenv.mkDerivation rec {
# the rust build system complains that nix alters the checksums
dontFixLibtool = true;

inherit patches;

postPatch = ''
patchShebangs src/etc
Expand Down

0 comments on commit 0b0e691

Please sign in to comment.