Merge pull request #99335 from obsidiansystems/make-rust-platform-separate

makeRustPlatform: Put back in it's own file.
This commit is contained in:
John Ericson 2020-10-13 22:15:47 -04:00 committed by GitHub
commit f3db41d730
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 19 deletions

View file

@ -13,6 +13,7 @@
, CoreFoundation, Security
, llvmPackages_5
, pkgsBuildTarget, pkgsBuildBuild
, makeRustPlatform
} @ args:
import ./default.nix {

View file

@ -13,6 +13,7 @@
, CoreFoundation, Security
, llvmPackages_5
, pkgsBuildTarget, pkgsBuildBuild
, makeRustPlatform
} @ args:
import ./default.nix {

View file

@ -12,6 +12,7 @@
, CoreFoundation, Security
, llvmPackages_5
, pkgsBuildTarget, pkgsBuildBuild
, makeRustPlatform
}: rec {
# https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch
toTargetArch = platform:
@ -33,24 +34,6 @@
in platform.rustc.config
or "${cpu_}-${vendor.name}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
makeRustPlatform = { rustc, cargo, ... }: rec {
rust = {
inherit rustc cargo;
};
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetchCargoTarball.nix {
inherit cargo;
};
buildRustPackage = callPackage ../../../build-support/rust {
inherit rustc cargo fetchCargoTarball;
};
rustcSrc = callPackage ./rust-src.nix {
inherit rustc;
};
};
# This just contains tools for now. But it would conceivably contain
# libraries too, say if we picked some default/recommended versions from
# `cratesIO` to build by Hydra and/or try to prefer/bias in Cargo.lock for

View file

@ -0,0 +1,21 @@
{ buildPackages, callPackage }:
{ rustc, cargo, ... }:
rec {
rust = {
inherit rustc cargo;
};
fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetchCargoTarball.nix {
inherit cargo;
};
buildRustPackage = callPackage ../../../build-support/rust {
inherit rustc cargo fetchCargoTarball;
};
rustcSrc = callPackage ./rust-src.nix {
inherit rustc;
};
}

View file

@ -9680,7 +9680,8 @@ in
rustPackages = rustPackages_1_45;
inherit (rustPackages) cargo clippy rustc rustPlatform;
inherit (rust) makeRustPlatform;
makeRustPlatform = callPackage ../development/compilers/rust/make-rust-platform.nix {};
buildRustCrate = callPackage ../build-support/rust/build-rust-crate { };
buildRustCrateHelpers = callPackage ../build-support/rust/build-rust-crate/helpers.nix { };