aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/compilers/rust
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/compilers/rust')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_45.nix1
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_48.nix (renamed from infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_46.nix)21
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix12
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/default.nix12
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix4
-rwxr-xr-xinfra/libkookie/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh1
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-lib-src.nix11
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-src.nix7
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rustc.nix12
9 files changed, 61 insertions, 20 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_45.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_45.nix
index 94c70880dbaa..2b3de4dd38c6 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_45.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_45.nix
@@ -32,6 +32,7 @@ import ./default.nix {
armv7-unknown-linux-gnueabihf = "d44294732cf268ea84908f1135f574ab9489132a332eaa9d5bda547374b15d54";
aarch64-unknown-linux-gnu = "a2d74ebeec0b6778026b6c37814cdc91d14db3b0d8b6d69d036216f4d9cf7e49";
x86_64-apple-darwin = "a5464e7bcbce9647607904a4afa8362382f1fc55d39e7bbaf4483ac00eb5d56a";
+ powerpc64le-unknown-linux-gnu = "22deeca259459db31065af7c862fcab7fbfb623200520c65002ed2ba93d87ad2";
};
selectRustPackage = pkgs: pkgs.rust_1_45;
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_46.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_48.nix
index c999b346ee6f..b3a512e58bdc 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_46.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/1_48.nix
@@ -19,24 +19,25 @@
} @ args:
import ./default.nix {
- rustcVersion = "1.46.0";
- rustcSha256 = "0a17jby2pd050s24cy4dfc0gzvgcl585v3vvyfilniyvjrqknsid";
+ rustcVersion = "1.48.0";
+ rustcSha256 = "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf";
# Note: the version MUST be one version prior to the version we're
# building
- bootstrapVersion = "1.45.2";
+ bootstrapVersion = "1.47.0";
# fetch hashes by running `print-hashes.sh 1.45.2`
bootstrapHashes = {
- i686-unknown-linux-gnu = "5b2050dde23152750de89f7e59acaab6bf088d0beb5854c69c9a545fd254b936";
- x86_64-unknown-linux-gnu = "860feed955726a4d96ffe40758a110053326b9ae11c9e1ee059e9c6222f25643";
- arm-unknown-linux-gnueabihf = "ddb5f59bbdef84e0b7c83049461e003ed031dd881a4622365c3d475102535c60";
- armv7-unknown-linux-gnueabihf = "7a556581f87602705f9c89b04cce621cfbba9050b6fbe478166e91d164567531";
- aarch64-unknown-linux-gnu = "151fad66442d28a4e4786753d1afb559c4a3d359081c64769273a31c2f0f4d30";
- x86_64-apple-darwin = "6e8067624ede10aa23081d62e0086c6f42f7228cc0d00fb5ff24d4dac65249d6";
+ i686-unknown-linux-gnu = "84bf092130ea5216fc701871e633563fc1c01b6528f60cb0767e96cd8eec30bf";
+ x86_64-unknown-linux-gnu = "d0e11e1756a072e8e246b05d54593402813d047d12e44df281fbabda91035d96";
+ arm-unknown-linux-gnueabihf = "82e12affb47596b68d0ca64045f4eb698c10ff15406afca604e12cdd07e17b26";
+ armv7-unknown-linux-gnueabihf = "19d0fe3892a8e98f99c5aa84f4d6f260853147650cb71f2bae985c91de6c29af";
+ aarch64-unknown-linux-gnu = "753c905e89a714ab9bce6fe1397b721f29c0760c32f09d2f328af3d39919c8e6";
+ x86_64-apple-darwin = "84e5be6c5c78734deba911dcf80316be1e4c7da2c59413124d039ad96620612f";
+ powerpc64le-unknown-linux-gnu = "5760c3b1897ea70791320c2565f3eef700a3d54059027b84bbe6b8d6157f81c8";
};
- selectRustPackage = pkgs: pkgs.rust_1_46;
+ selectRustPackage = pkgs: pkgs.rust_1_48;
rustcPatches = [
];
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
index 9ae7e51e5fef..b84e390e0b0d 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/binary.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, bash, curl, darwin
+{ stdenv, makeWrapper, bash, curl, darwin, zlib
, version
, src
, platform
@@ -42,17 +42,23 @@ rec {
./install.sh --prefix=$out \
--components=${installComponents}
- ${optionalString (stdenv.isLinux && bootstrapping) ''
+ ${optionalString (stdenv.isLinux && bootstrapping) (''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustc"
+ '' + optionalString (stdenv.lib.versionAtLeast version "1.46")
+ # rustc bootstrap needs libz starting from 1.46
+ ''
+ ln -s ${zlib}/lib/libz.so.1 $out/lib/libz.so.1
+ ln -s ${zlib}/lib/libz.so $out/lib/libz.so
+ '' + ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustdoc"
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
- ''}
+ '')}
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
# (or similar) here. It causes strange effects where rustc loads
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/default.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/default.nix
index 74c076c204b4..25876cc63803 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/default.nix
@@ -24,9 +24,10 @@
if platform.isDarwin then "macos"
else platform.parsed.kernel.name;
- # Target triple. Rust has slightly different naming conventions than we use.
+ # Returns the name of the rust target, even if it is custom. Adjustments are
+ # because rust has slightly different naming conventions than we do.
toRustTarget = platform: with platform.parsed; let
- cpu_ = platform.rustc.arch or {
+ cpu_ = platform.rustc.platform.arch or {
"armv7a" = "armv7";
"armv7l" = "armv7";
"armv6l" = "arm";
@@ -34,6 +35,13 @@
in platform.rustc.config
or "${cpu_}-${vendor.name}-${kernel.name}${lib.optionalString (abi.name != "unknown") "-${abi.name}"}";
+ # Returns the name of the rust target if it is standard, or the json file
+ # containing the custom target spec.
+ toRustTargetSpec = platform:
+ if (platform.rustc or {}) ? platform
+ then builtins.toFile (toRustTarget platform + ".json") (builtins.toJSON platform.rustc.platform)
+ else toRustTarget platform;
+
# 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
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix
index 6a827cff9a15..4b1f572bebb8 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/make-rust-platform.nix
@@ -18,4 +18,8 @@ rec {
rustcSrc = callPackage ./rust-src.nix {
inherit rustc;
};
+
+ rustLibSrc = callPackage ./rust-lib-src.nix {
+ inherit rustc;
+ };
}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh
index 957011fad376..9180ccb67d91 100755
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh
@@ -14,6 +14,7 @@ PLATFORMS=(
armv7-unknown-linux-gnueabihf
aarch64-unknown-linux-gnu
x86_64-apple-darwin
+ powerpc64le-unknown-linux-gnu
)
BASEURL=https://static.rust-lang.org/dist
VERSION=${1:-}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-lib-src.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-lib-src.nix
new file mode 100644
index 000000000000..67a7fa3641ad
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-lib-src.nix
@@ -0,0 +1,11 @@
+{ stdenv, rustc }:
+
+stdenv.mkDerivation {
+ name = "rust-lib-src";
+ src = rustc.src;
+ phases = [ "unpackPhase" "installPhase" ];
+
+ installPhase = ''
+ mv library $out
+ '';
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-src.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-src.nix
index 8977fb84caf7..489795ecec47 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-src.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rust-src.nix
@@ -1,4 +1,4 @@
-{ stdenv, rustc }:
+{ stdenv, rustc, minimalContent ? true }:
stdenv.mkDerivation {
name = "rust-src";
@@ -6,6 +6,9 @@ stdenv.mkDerivation {
phases = [ "unpackPhase" "installPhase" ];
installPhase = ''
mv src $out
- rm -rf $out/{ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,tools,vendor,stdarch}
+ rm -rf $out/{${if minimalContent
+ then "ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,tools,vendor,stdarch"
+ else "ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,vendor"
+ }}
'';
}
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rustc.nix b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rustc.nix
index 65d8920c4a4c..dab1f2a6bd81 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rustc.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/rust/rustc.nix
@@ -70,9 +70,9 @@ in stdenv.mkDerivation rec {
"--set=build.cargo=${rustPlatform.rust.cargo}/bin/cargo"
"--enable-rpath"
"--enable-vendor"
- "--build=${rust.toRustTarget stdenv.buildPlatform}"
- "--host=${rust.toRustTarget stdenv.hostPlatform}"
- "--target=${rust.toRustTarget stdenv.targetPlatform}"
+ "--build=${rust.toRustTargetSpec stdenv.buildPlatform}"
+ "--host=${rust.toRustTargetSpec stdenv.hostPlatform}"
+ "--target=${rust.toRustTargetSpec stdenv.targetPlatform}"
"${setBuild}.cc=${ccForBuild}"
"${setHost}.cc=${ccForHost}"
@@ -92,6 +92,12 @@ in stdenv.mkDerivation rec {
"${setTarget}.llvm-config=${llvmSharedForTarget}/bin/llvm-config"
] ++ optionals (stdenv.isLinux && !stdenv.targetPlatform.isRedox) [
"--enable-profiler" # build libprofiler_builtins
+ ] ++ optionals stdenv.buildPlatform.isMusl [
+ "${setBuild}.musl-root=${pkgsBuildBuild.targetPackages.stdenv.cc.libc}"
+ ] ++ optionals stdenv.hostPlatform.isMusl [
+ "${setHost}.musl-root=${pkgsBuildHost.targetPackages.stdenv.cc.libc}"
+ ] ++ optionals stdenv.targetPlatform.isMusl [
+ "${setTarget}.musl-root=${pkgsBuildTarget.targetPackages.stdenv.cc.libc}"
];
# The bootstrap.py will generated a Makefile that then executes the build.