2020-09-01 09:07:15 +02: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.
|
|
|
|
# Check the version number in the src/llvm-project git submodule in:
|
|
|
|
# https://github.com/rust-lang/rust/blob/<version-tag>/.gitmodules
|
|
|
|
# 3. Firefox and Thunderbird should still build on x86_64-linux.
|
|
|
|
|
|
|
|
{ stdenv, lib
|
|
|
|
, buildPackages
|
|
|
|
, newScope, callPackage
|
|
|
|
, CoreFoundation, Security
|
2020-12-14 09:40:37 +01:00
|
|
|
, pkgsBuildTarget, pkgsBuildBuild, pkgsBuildHost
|
2020-10-14 11:32:49 +02:00
|
|
|
, makeRustPlatform
|
2021-03-18 05:01:44 +01:00
|
|
|
, llvmPackages_11, llvm_11
|
2020-09-01 09:07:15 +02:00
|
|
|
} @ args:
|
|
|
|
|
|
|
|
import ./default.nix {
|
2021-03-25 19:03:40 +01:00
|
|
|
rustcVersion = "1.51.0";
|
|
|
|
rustcSha256 = "0ixqkqglv3isxbvl4ldr4byrkx692wghsz3fasy1pn5kr2prnsvs";
|
2020-09-01 09:07:15 +02: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 10:23:57 +02:00
|
|
|
llvmSharedForBuild = pkgsBuildBuild.llvmPackages_11.libllvm.override { enableSharedLibraries = true; };
|
|
|
|
llvmSharedForHost = pkgsBuildHost.llvmPackages_11.libllvm.override { enableSharedLibraries = true; };
|
|
|
|
llvmSharedForTarget = pkgsBuildTarget.llvmPackages_11.libllvm.override { enableSharedLibraries = true; };
|
2020-12-14 09:40:37 +01:00
|
|
|
|
2021-03-18 05:01:44 +01:00
|
|
|
llvmBootstrapForDarwin = llvmPackages_11;
|
2020-12-14 09:40:37 +01:00
|
|
|
|
|
|
|
# For use at runtime
|
|
|
|
llvmShared = llvm_11.override { enableSharedLibraries = true; };
|
|
|
|
|
2020-09-01 09:07:15 +02:00
|
|
|
# Note: the version MUST be one version prior to the version we're
|
|
|
|
# building
|
2021-03-25 19:03:40 +01:00
|
|
|
bootstrapVersion = "1.50.0";
|
2020-09-01 09:07:15 +02:00
|
|
|
|
2021-01-08 14:38:42 +01:00
|
|
|
# fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
|
2020-09-01 09:07:15 +02:00
|
|
|
bootstrapHashes = {
|
2021-03-25 19:03:40 +01:00
|
|
|
i686-unknown-linux-gnu = "dee56dc425ed5d8e8112f26fba3060fd324c49f1261e0b7e8e29f7d9b852b09a";
|
|
|
|
x86_64-unknown-linux-gnu = "fa889b53918980aea2dea42bfae4e858dcb2104c6fdca6e4fe359f3a49767701";
|
|
|
|
x86_64-unknown-linux-musl = "867cbfb35f5dc9b43e230132ea9e7bfa98d471a9248e41b08ced2266e5ccd00f";
|
|
|
|
arm-unknown-linux-gnueabihf = "1b72979244450e4047ab536448d6720699e1fae0ab1c4ade114099a3037e274b";
|
|
|
|
armv7-unknown-linux-gnueabihf = "f1dde566c4e6ca2e1133c84170e46e566765a21894e1038e1cdc32745d7274ef";
|
|
|
|
aarch64-unknown-linux-gnu = "1db7a4fbddc68cd29eb9bca9fa7d0d2d9e3d59ede7ddaad66222fb4336a6bacf";
|
|
|
|
aarch64-unknown-linux-musl = "adcc6c76a8967bacb6687b565d3cf739e35fde066b03edb745b05b52fa8b5b36";
|
|
|
|
x86_64-apple-darwin = "1bf5a7ecf6468ce1bf9fe49c8083b3f648b40c16fbfb7539d106fe28eb0e792e";
|
2021-04-09 13:22:35 +02:00
|
|
|
aarch64-apple-darwin = "1ed91a867e7b86cc4bc84c0838240f1c25acd007100ec9f7a14c4873e4b56561";
|
2021-03-25 19:03:40 +01:00
|
|
|
powerpc64le-unknown-linux-gnu = "e0472589d3f9ba7ebf27f033af320e0d5cfb70222955bd8ed73ce2c9a70ae535";
|
2020-09-01 09:07:15 +02:00
|
|
|
};
|
|
|
|
|
2021-03-25 19:03:40 +01:00
|
|
|
selectRustPackage = pkgs: pkgs.rust_1_51;
|
2020-09-01 09:07:15 +02:00
|
|
|
|
|
|
|
rustcPatches = [
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2021-03-18 05:01:44 +01:00
|
|
|
(builtins.removeAttrs args [ "fetchpatch" "pkgsBuildHost" "llvmPackages_11" "llvm_11"])
|