2020-07-16 21:26:02 +01:00
|
|
|
# New rust versions should first go to staging.
|
|
|
|
# Things to check after updating:
|
|
|
|
# 1. Rustc should produce rust binaries on x86_64-linux, aarch64-linux and x86_64-darwin:
|
|
|
|
# i.e. nix-shell -p fd or @GrahamcOfBorg build fd on github
|
|
|
|
# This testing can be also done by other volunteers as part of the pull
|
|
|
|
# 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
|
2020-12-14 08:40:37 +00:00
|
|
|
, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
|
2020-10-01 22:51:46 +01:00
|
|
|
, makeRustPlatform
|
2020-12-14 08:40:37 +00:00
|
|
|
, llvmPackages_5, llvm_10
|
2020-07-16 21:26:02 +01:00
|
|
|
} @ args:
|
|
|
|
|
|
|
|
import ./default.nix {
|
2020-08-08 11:03:50 +01:00
|
|
|
rustcVersion = "1.45.2";
|
|
|
|
rustcSha256 = "0273a1g3f59plyi1n0azf21qjzwml1yqdnj5z472crz37qggr8xp";
|
2020-07-16 21:26:02 +01:00
|
|
|
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 09:23:57 +01:00
|
|
|
llvmSharedForBuild = pkgsBuildBuild.llvmPackages_10.libllvm.override { enableSharedLibraries = true; };
|
|
|
|
llvmSharedForHost = pkgsBuildHost.llvmPackages_10.libllvm.override { enableSharedLibraries = true; };
|
|
|
|
llvmSharedForTarget = pkgsBuildTarget.llvmPackages_10.libllvm.override { enableSharedLibraries = true; };
|
2020-12-14 08:40:37 +00:00
|
|
|
|
|
|
|
llvmBootstrapForDarwin = llvmPackages_5;
|
|
|
|
|
|
|
|
# For use at runtime
|
|
|
|
llvmShared = llvm_10.override { enableSharedLibraries = true; };
|
|
|
|
|
2020-07-16 21:26:02 +01:00
|
|
|
# Note: the version MUST be one version prior to the version we're
|
|
|
|
# building
|
|
|
|
bootstrapVersion = "1.44.1";
|
|
|
|
|
2021-01-08 13:38:42 +00:00
|
|
|
# fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
|
2020-07-16 21:26:02 +01:00
|
|
|
bootstrapHashes = {
|
|
|
|
i686-unknown-linux-gnu = "e69689b0a1b66599cf83e7dd54f839419007e44376195e93e301a3175da3d854";
|
|
|
|
x86_64-unknown-linux-gnu = "a41df89a461a580536aeb42755e43037556fba2e527dd13a1e1bb0749de28202";
|
2021-01-19 07:26:45 +00:00
|
|
|
x86_64-unknown-linux-musl = "7eeef2b7488ee96015db10bc52c43f6e023debc9a955ccb8efb382522bf35be9";
|
2020-07-16 21:26:02 +01:00
|
|
|
arm-unknown-linux-gnueabihf = "ea18ccdfb62a153c2d43d013fdec56993cc9267f1cdc6f3834df8a2b9b468f08";
|
|
|
|
armv7-unknown-linux-gnueabihf = "d44294732cf268ea84908f1135f574ab9489132a332eaa9d5bda547374b15d54";
|
|
|
|
aarch64-unknown-linux-gnu = "a2d74ebeec0b6778026b6c37814cdc91d14db3b0d8b6d69d036216f4d9cf7e49";
|
|
|
|
x86_64-apple-darwin = "a5464e7bcbce9647607904a4afa8362382f1fc55d39e7bbaf4483ac00eb5d56a";
|
2020-10-21 08:32:00 +01:00
|
|
|
powerpc64le-unknown-linux-gnu = "22deeca259459db31065af7c862fcab7fbfb623200520c65002ed2ba93d87ad2";
|
2020-07-16 21:26:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
selectRustPackage = pkgs: pkgs.rust_1_45;
|
|
|
|
|
|
|
|
rustcPatches = [
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2020-12-14 08:40:37 +00:00
|
|
|
(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_5" "llvm_10" ])
|