rust: 1.22.1 -> 1.24.0

This commit is contained in:
Jörg Thalheim 2018-02-20 09:59:26 +00:00 committed by GitHub
parent e46553bc72
commit f61e8d98ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 64 additions and 64 deletions

View File

@ -4,7 +4,7 @@ let
inherit stdenv cacert git rust cargo-vendor; inherit stdenv cacert git rust cargo-vendor;
}; };
in in
{ name, cargoSha256 { name, cargoSha256 ? null
, src ? null , src ? null
, srcs ? null , srcs ? null
, sourceRoot ? null , sourceRoot ? null
@ -13,15 +13,31 @@ in
, cargoUpdateHook ? "" , cargoUpdateHook ? ""
, cargoDepsHook ? "" , cargoDepsHook ? ""
, cargoBuildFlags ? [] , cargoBuildFlags ? []
, cargoVendorDir ? null
, ... } @ args: , ... } @ args:
assert cargoVendorDir == null -> cargoSha256 != null;
let let
lib = stdenv.lib; lib = stdenv.lib;
cargoDeps = fetchcargo { cargoDeps = if cargoVendorDir == null
inherit name src srcs sourceRoot cargoUpdateHook; then fetchcargo {
sha256 = cargoSha256; inherit name src srcs sourceRoot cargoUpdateHook;
}; sha256 = cargoSha256;
}
else null;
setupVendorDir = if cargoVendorDir == null
then ''
unpackFile "$cargoDeps"
cargoDepsCopy=$(stripHash $(basename $cargoDeps))
chmod -R +w "$cargoDepsCopy"
''
else ''
cargoDepsCopy="$sourceRoot/${cargoVendorDir}"
'';
in stdenv.mkDerivation (args // { in stdenv.mkDerivation (args // {
inherit cargoDeps; inherit cargoDeps;
@ -39,9 +55,7 @@ in stdenv.mkDerivation (args // {
postUnpack = '' postUnpack = ''
eval "$cargoDepsHook" eval "$cargoDepsHook"
unpackFile "$cargoDeps" ${setupVendorDir}
cargoDepsCopy=$(stripHash $(basename $cargoDeps))
chmod -R +w "$cargoDepsCopy"
mkdir .cargo mkdir .cargo
cat >.cargo/config <<-EOF cat >.cargo/config <<-EOF

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, makeWrapper, cacert, zlib, buildRustPackage, curl, darwin { stdenv, fetchurl, makeWrapper, bash, cacert, zlib, buildRustPackage, curl, darwin
, version , version
, src , src
, platform , platform
@ -34,9 +34,11 @@ rec {
license = [ licenses.mit licenses.asl20 ]; license = [ licenses.mit licenses.asl20 ];
}; };
phases = ["unpackPhase" "installPhase" "fixupPhase"]; buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
buildInputs = stdenv.lib.optional stdenv.isDarwin Security; postPatch = ''
patchShebangs .
'';
installPhase = '' installPhase = ''
./install.sh --prefix=$out \ ./install.sh --prefix=$out \
@ -86,9 +88,11 @@ rec {
license = [ licenses.mit licenses.asl20 ]; license = [ licenses.mit licenses.asl20 ];
}; };
phases = ["unpackPhase" "installPhase" "fixupPhase"]; buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
buildInputs = [ makeWrapper ] ++ stdenv.lib.optional stdenv.isDarwin Security; postPatch = ''
patchShebangs .
'';
installPhase = '' installPhase = ''
patchShebangs ./install.sh patchShebangs ./install.sh

View File

@ -3,16 +3,16 @@
let let
# Note: the version MUST be one version prior to the version we're # Note: the version MUST be one version prior to the version we're
# building # building
version = "1.21.0"; version = "1.23.0";
# fetch hashes by running `print-hashes.sh 1.21.0` # fetch hashes by running `print-hashes.sh 1.23.0`
hashes = { hashes = {
i686-unknown-linux-gnu = "b7caed0f602cdb8ef22e0bfa9125a65bec411e15c0b8901d937e43303ec7dbee"; i686-unknown-linux-gnu = "dc5bd0ef47e1036c8ca64676d8967102cb86ce4bf50b90a9845951c3e940423f";
x86_64-unknown-linux-gnu = "b41e70e018402bc04d02fde82f91bea24428e6be432f0df12ac400cfb03108e8"; x86_64-unknown-linux-gnu = "9a34b23a82d7f3c91637e10ceefb424539dcfa327c2dcd292ff10c047b1fdc7e";
armv7-unknown-linux-gnueabihf = "416fa6f107ad9e386002e6af1aec495472e2ee489c842183dd429a25b07488d6"; armv7-unknown-linux-gnueabihf = "587027899267f1961520438c2c7f6775fe224160d43ddf07332b9b943a26b08e";
aarch64-unknown-linux-gnu = "491ee6c43cc672006968d665bd34c94cc2219ef3592d93d38097c97eaaa864c3"; aarch64-unknown-linux-gnu = "38379fbd976d2286cb73f21466db40a636a583b9f8a80af5eea73617c7912bc7";
i686-apple-darwin = "c8b0fabeebcde66b683f3a871187e614e07305adda414c2862cb332aecb2b3bf"; i686-apple-darwin = "4709eb1ad2fb871fdaee4b3449569cef366b0d170453cf17484a12286564f2ad";
x86_64-apple-darwin = "75a7f4bd7c72948030bb9e421df27e8a650dea826fb5b836cf59d23d6f985a0d"; x86_64-apple-darwin = "9274e977322bb4b153f092255ac9bd85041142c73eaabf900cb2ef3d3abb2eba";
}; };
platform = platform =

View File

@ -1,7 +1,8 @@
{ stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib { stdenv, fetchFromGitHub, file, curl, pkgconfig, python, openssl, cmake, zlib
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin , makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2, darwin
, version, srcSha, cargoSha256 , version
, patches ? [] }: , patches ? []
, src }:
let let
inherit (darwin.apple_sdk.frameworks) CoreFoundation; inherit (darwin.apple_sdk.frameworks) CoreFoundation;
@ -9,17 +10,12 @@ in
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
name = "cargo-${version}"; name = "cargo-${version}";
inherit version; inherit version src patches;
src = fetchFromGitHub { # the rust source tarball already has all the dependencies vendored, no need to fetch them again
owner = "rust-lang"; cargoVendorDir = "src/vendor";
repo = "cargo"; preBuild = "cd src; pushd tools/cargo";
rev = version; postBuild = "popd";
sha256 = srcSha;
};
inherit cargoSha256;
inherit patches;
passthru.rustc = rustc; passthru.rustc = rustc;

View File

@ -6,21 +6,20 @@
let let
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {})); rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
version = "1.22.1"; version = "1.24.0";
in cargoVersion = "0.24.0";
rec { src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "17v3jpyky8vkkgai5yd2zr8zl87qpgj6dx99gx27x1sf0kv7d0mv";
};
in rec {
rustc = callPackage ./rustc.nix { rustc = callPackage ./rustc.nix {
inherit llvm targets targetPatches targetToolchains rustPlatform version; inherit llvm targets targetPatches targetToolchains rustPlatform version src;
forceBundledLLVM = true; forceBundledLLVM = true;
configureFlags = [ "--release-channel=stable" ]; configureFlags = [ "--release-channel=stable" ];
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "1lrzzp0nh7s61wgfs2h6ilaqi6iq89f1pd1yaf65l87bssyl4ylb";
};
patches = [ patches = [
./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch ./patches/0001-Disable-fragile-tests-libstd-net-tcp-on-Darwin-Linux.patch
] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch
@ -30,10 +29,8 @@ rec {
}; };
cargo = callPackage ./cargo.nix rec { cargo = callPackage ./cargo.nix rec {
version = "0.23.0"; version = cargoVersion;
srcSha = "14b2n1msxma19ydchj54hd7f2zdsr524fg133dkmdn7j65f1x6aj"; inherit src;
cargoSha256 = "1sj59z0w172qvjwg1ma5fr5am9dgw27086xwdnrvlrk4hffcr7y7";
inherit rustc; # the rustc that will be wrapped by cargo inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo inherit rustPlatform; # used to build cargo
}; };

View File

@ -1,7 +1,7 @@
diff --git a/src/librustc_back/dynamic_lib.rs b/src/librustc_back/dynamic_lib.rs diff --git a/src/librustc_metadata/dynamic_lib.rs b/src/librustc_metadata/dynamic_lib.rs
index 1b42fa0..92256dc 100644 index 1b42fa0..92256dc 100644
--- a/src/librustc_back/dynamic_lib.rs --- a/src/librustc_metadata/dynamic_lib.rs
+++ b/src/librustc_back/dynamic_lib.rs +++ b/src/librustc_metadata/dynamic_lib.rs
@@ -80,6 +80,7 @@ mod tests { @@ -80,6 +80,7 @@ mod tests {
use std::mem; use std::mem;

View File

@ -57,9 +57,9 @@ stdenv.mkDerivation {
# We need rust to build rust. If we don't provide it, configure will try to download it. # We need rust to build rust. If we don't provide it, configure will try to download it.
configureFlags = configureFlags configureFlags = configureFlags
++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ] ++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
++ [ "--enable-vendor" "--disable-locked-deps" ] ++ [ "--enable-vendor" ]
# ++ [ "--jemalloc-root=${jemalloc}/lib" # ++ [ "--jemalloc-root=${jemalloc}/lib"
++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" "--default-ar=${targetPackages.stdenv.cc.bintools}/bin/ar" ] ++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ] ++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
++ optional (targets != []) "--target=${target}" ++ optional (targets != []) "--target=${target}"
++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}"; ++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";
@ -72,6 +72,8 @@ stdenv.mkDerivation {
passthru.target = target; passthru.target = target;
postPatch = '' postPatch = ''
patchShebangs src/etc
# Fix dynamic linking against llvm # Fix dynamic linking against llvm
#${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''} #${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
@ -98,19 +100,6 @@ stdenv.mkDerivation {
# On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)' # On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)'
sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs
# Disable some failing gdb tests. Try re-enabling these when gdb
# is updated past version 7.12.
rm src/test/debuginfo/basic-types-globals.rs
rm src/test/debuginfo/basic-types-mut-globals.rs
rm src/test/debuginfo/c-style-enum.rs
rm src/test/debuginfo/lexical-scopes-in-block-expression.rs
rm src/test/debuginfo/limited-debuginfo.rs
rm src/test/debuginfo/simple-struct.rs
rm src/test/debuginfo/simple-tuple.rs
rm src/test/debuginfo/union-smoke.rs
rm src/test/debuginfo/vec-slices.rs
rm src/test/debuginfo/vec.rs
# Useful debugging parameter # Useful debugging parameter
# export VERBOSE=1 # export VERBOSE=1
'' ''