Skip to content

Commit

Permalink
rust: preliminary cross compilation support
Browse files Browse the repository at this point in the history
Moves some things to native build inputs in rust infrastructure to get
things working. rustPlatform has to get rust from buildPackages in
order to get the proper version.
  • Loading branch information
matthewbauer committed Sep 26, 2018
1 parent 6eef893 commit c66e3de
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkgs/build-support/rust/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ in stdenv.mkDerivation (args // {

patchRegistryDeps = ./patch-registry-deps;

buildInputs = [ cacert git rust.cargo rust.rustc ] ++ buildInputs;
nativeBuildInputs = [ cacert git rust.cargo rust.rustc ];
inherit buildInputs;

patches = cargoPatches ++ patches;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/rust/rustc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ stdenv.mkDerivation {
++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
++ [ "--enable-vendor" ]
# ++ [ "--jemalloc-root=${jemalloc}/lib"
++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
++ [ "--default-linker=${stdenv.cc}/bin/cc" ]
++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
++ optional (targets != []) "--target=${target}"
++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7229,7 +7229,7 @@ with pkgs;

defaultCrateOverrides = callPackage ../build-support/rust/default-crate-overrides.nix { };

rustPlatform = recurseIntoAttrs (makeRustPlatform rust);
rustPlatform = recurseIntoAttrs (makeRustPlatform buildPackages.rust);

makeRustPlatform = rust: lib.fix (self:
let
Expand Down

0 comments on commit c66e3de

Please sign in to comment.