Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0cdd824bd5f7
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4d8a4bcc3dad
Choose a head ref
  • 3 commits
  • 9 files changed
  • 2 contributors

Commits on Jun 12, 2018

  1. Backport rust 1.26 from master.

    As of afad998.
    shlevy committed Jun 12, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    shlevy Shea Levy
    Copy the full SHA
    1d2c750 View commit details

Commits on Jun 13, 2018

  1. Verified

    This commit was signed with the committer’s verified signature.
    shlevy Shea Levy
    Copy the full SHA
    2bbb168 View commit details
  2. Merge #41921: texlive: Fix 'match-parens' ruby dependency

    (cherry picked from commit 606ff95)
    vcunat committed Jun 13, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    vcunat Vladimír Čunát
    Copy the full SHA
    4d8a4bc View commit details
118 changes: 118 additions & 0 deletions pkgs/development/compilers/rust/1.26/binaryBuild.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{ stdenv, fetchurl, makeWrapper, bash, cacert, zlib, buildRustPackage, curl, darwin
, version
, src
, platform
, versionType
}:

let
inherit (stdenv.lib) getLib optionalString;
inherit (darwin) libiconv;
inherit (darwin.apple_sdk.frameworks) Security;

bootstrapping = versionType == "bootstrap";

installComponents
= "rustc,rust-std-${platform}"
+ (optionalString bootstrapping ",cargo")
;
in

rec {
inherit buildRustPackage;

rustc = stdenv.mkDerivation rec {
name = "rustc-${versionType}-${version}";

inherit version;
inherit src;

meta = with stdenv.lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ qknight ];
license = [ licenses.mit licenses.asl20 ];
};

buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;

postPatch = ''
patchShebangs .
'';

installPhase = ''
./install.sh --prefix=$out \
--components=${installComponents}
${optionalString (stdenv.isLinux && bootstrapping) ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/rustc"
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"
''}
${optionalString (stdenv.isDarwin && bootstrapping) ''
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustc"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustdoc"
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
for f in $out/lib/lib*.dylib; do
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$f"
done
''}
# Do NOT, I repeat, DO NOT use `wrapProgram` on $out/bin/rustc
# (or similar) here. It causes strange effects where rustc loads
# the wrong libraries in a bootstrap-build causing failures that
# are very hard to track down. For details, see
# https://github.com/rust-lang/rust/issues/34722#issuecomment-232164943
'';
};

cargo = stdenv.mkDerivation rec {
name = "cargo-${versionType}-${version}";

inherit version;
inherit src;

meta = with stdenv.lib; {
homepage = http://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ qknight ];
license = [ licenses.mit licenses.asl20 ];
};

buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;

postPatch = ''
patchShebangs .
'';

installPhase = ''
patchShebangs ./install.sh
./install.sh --prefix=$out \
--components=cargo
${optionalString (stdenv.isLinux && bootstrapping) ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
"$out/bin/cargo"
''}
${optionalString (stdenv.isDarwin && bootstrapping) ''
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
''}
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin"
'';
};
}
42 changes: 42 additions & 0 deletions pkgs/development/compilers/rust/1.26/bootstrap.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{ stdenv, fetchurl, callPackage }:

let
# Note: the version MUST be one version prior to the version we're
# building
version = "1.26.1";

# fetch hashes by running `print-hashes.sh 1.24.1`
hashes = {
i686-unknown-linux-gnu = "d704ba5cbaaf93c5e2112d211630db0e460d5dc819a43464ba91581e5c821df3";
x86_64-unknown-linux-gnu = "b7e964bace1286696d511c287b945f3ece476ba77a231f0c31f1867dfa5080e0";
armv7-unknown-linux-gnueabihf = "34fbcebc8e60b6496f1ce7998cf0b50cd618770f039da529b65110fff1f25fa0";
aarch64-unknown-linux-gnu = "d4a369053c2dfd5f457de6853557dab563944579fa4bb55bc919bacf259bff6d";
i686-apple-darwin = "047c31a872161ebb1d21ef616f7658190403769a8734f84364a3cf15838b4708";
x86_64-apple-darwin = "ebf898b9fa7e2aafc53682a41f18af5ca6660ebe82dd78f28cd9799fe4dc189a";
};

platform =
if stdenv.system == "i686-linux"
then "i686-unknown-linux-gnu"
else if stdenv.system == "x86_64-linux"
then "x86_64-unknown-linux-gnu"
else if stdenv.system == "armv7l-linux"
then "armv7-unknown-linux-gnueabihf"
else if stdenv.system == "aarch64-linux"
then "aarch64-unknown-linux-gnu"
else if stdenv.system == "i686-darwin"
then "i686-apple-darwin"
else if stdenv.system == "x86_64-darwin"
then "x86_64-apple-darwin"
else throw "missing bootstrap url for platform ${stdenv.system}";

src = fetchurl {
url = "https://static.rust-lang.org/dist/rust-${version}-${platform}.tar.gz";
sha256 = hashes."${platform}";
};

in callPackage ./binaryBuild.nix
{ inherit version src platform;
buildRustPackage = null;
versionType = "bootstrap";
}
46 changes: 46 additions & 0 deletions pkgs/development/compilers/rust/1.26/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{ stdenv, callPackage, recurseIntoAttrs, makeRustPlatform, llvm, fetchurl
, targets ? []
, targetToolchains ? []
, targetPatches ? []
}:

let
rustPlatform = recurseIntoAttrs (makeRustPlatform (callPackage ./bootstrap.nix {}));
version = "1.26.2";
cargoVersion = "1.26.2";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
sha256 = "0047ais0fvmqvngqkdsxgrzhb0kljg8wy85b01kbbjc88hqcz7pv";
};
in rec {
rustc = callPackage ./rustc.nix {
inherit stdenv llvm targets targetPatches targetToolchains rustPlatform version src;

patches = [
./patches/net-tcp-disable-tests.patch
./patches/stdsimd-disable-doctest.patch
# Fails on hydra - not locally; the exact reason is unknown.
# Comments in the test suggest that some non-reproducible environment
# variables such $RANDOM can make it fail.
./patches/disable-test-inherit-env.patch
];

forceBundledLLVM = true;

configureFlags = [ "--release-channel=stable" ];

# 1. Upstream is not running tests on aarch64:
# see https://github.com/rust-lang/rust/issues/49807#issuecomment-380860567
# So we do the same.
# 2. Tests run out of memory for i686
doCheck = !stdenv.isAarch64 && !stdenv.isi686;
};

cargo = callPackage ../cargo.nix rec {
version = cargoVersion;
inherit src;
inherit stdenv;
inherit rustc; # the rustc that will be wrapped by cargo
inherit rustPlatform; # used to build cargo
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- rustc-1.26.2-src.org/src/libstd/process.rs 2018-06-01 21:40:11.000000000 +0100
+++ rustc-1.26.2-src/src/libstd/process.rs 2018-06-08 07:50:23.023828658 +0100
@@ -1745,6 +1745,7 @@
}

#[test]
+ #[ignore]
fn test_inherit_env() {
use env;

Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs
index 0f60b5b3e..9b08415e7 100644
--- a/src/libstd/net/tcp.rs
+++ b/src/libstd/net/tcp.rs
@@ -962,6 +962,7 @@ mod tests {
}
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn listen_localhost() {
let socket_addr = next_test_ip4();
@@ -1020,6 +1021,7 @@ mod tests {
})
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn read_eof() {
each_ip(&mut |addr| {
@@ -1039,6 +1041,7 @@ mod tests {
})
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn write_close() {
each_ip(&mut |addr| {
@@ -1065,6 +1068,7 @@ mod tests {
})
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn multiple_connect_serial() {
each_ip(&mut |addr| {
@@ -1087,6 +1091,7 @@ mod tests {
})
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn multiple_connect_interleaved_greedy_schedule() {
const MAX: usize = 10;
@@ -1123,6 +1128,7 @@ mod tests {
}

#[test]
+ #[cfg_attr(target_os = "macos", ignore)]
fn multiple_connect_interleaved_lazy_schedule() {
const MAX: usize = 10;
each_ip(&mut |addr| {
@@ -1401,6 +1407,7 @@ mod tests {
}

#[test]
+ #[cfg_attr(target_os = "macos", ignore)]
fn clone_while_reading() {
each_ip(&mut |addr| {
let accept = t!(TcpListener::bind(&addr));
@@ -1421,7 +1422,10 @@ mod tests {

// FIXME: re-enabled bitrig/openbsd tests once their socket timeout code
// no longer has rounding errors.
- #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
+ #[cfg_attr(any(target_os = "bitrig",
+ target_os = "netbsd",
+ target_os = "openbsd",
+ target_os = "macos"), ignore)]
#[test]
fn timeouts() {
let addr = next_test_ip4();
@@ -1596,6 +1603,7 @@ mod tests {
drop(listener);
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn nodelay() {
let addr = next_test_ip4();
@@ -1610,6 +1618,7 @@ mod tests {
assert_eq!(false, t!(stream.nodelay()));
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn ttl() {
let ttl = 100;
@@ -1647,6 +1656,7 @@ mod tests {
}
}

+ #[cfg_attr(target_os = "macos", ignore)]
#[test]
fn peek() {
each_ip(&mut |addr| {
@@ -1679,6 +1689,7 @@ mod tests {
}

#[test]
+ #[cfg_attr(any(target_os = "linux", target_os = "macos"), ignore)]
fn connect_timeout_unroutable() {
// this IP is unroutable, so connections should always time out,
// provided the network is reachable to begin with.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/src/stdsimd/coresimd/x86/mod.rs b/src/stdsimd/coresimd/x86/mod.rs
index 32915c332..7cb54f31e 100644
--- a/src/stdsimd/coresimd/x86/mod.rs
+++ b/src/stdsimd/coresimd/x86/mod.rs
@@ -279,7 +279,6 @@ types! {
///
/// # Examples
///
- /// ```
/// # #![feature(cfg_target_feature, target_feature, stdsimd)]
/// # #![cfg_attr(not(dox), no_std)]
/// # #[cfg(not(dox))]
@@ -301,7 +300,6 @@ types! {
/// # }
/// # if is_x86_feature_detected!("sse") { unsafe { foo() } }
/// # }
- /// ```
pub struct __m256(f32, f32, f32, f32, f32, f32, f32, f32);

/// 256-bit wide set of four `f64` types, x86-specific
180 changes: 180 additions & 0 deletions pkgs/development/compilers/rust/1.26/rustc.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{ stdenv, targetPackages
, fetchurl, fetchgit, fetchzip, file, python2, tzdata, procps
, llvm, jemalloc, ncurses, darwin, rustPlatform, git, cmake, curl
, which, libffi, gdb
, version
, forceBundledLLVM ? false
, src
, configureFlags ? []
, patches
, targets
, targetPatches
, targetToolchains
, doCheck ? true
, broken ? false
, buildPlatform, hostPlatform
} @ args:

let
inherit (stdenv.lib) optional optionalString;
inherit (darwin.apple_sdk.frameworks) Security;

procps = if stdenv.isDarwin then darwin.ps else args.procps;

llvmShared = llvm.override { enableSharedLibraries = true; };

target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
in

stdenv.mkDerivation {
name = "rustc-${version}";
inherit version;

inherit src;

__darwinAllowLocalNetworking = true;

# The build will fail at the very end on AArch64 without this.
dontUpdateAutotoolsGnuConfigScripts = if stdenv.isAarch64 then true else null;

# Running the default `strip -S` command on Darwin corrupts the
# .rlib files in "lib/".
#
# See https://github.com/NixOS/nixpkgs/pull/34227
stripDebugList = if stdenv.isDarwin then [ "bin" ] else null;

NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${llvmShared}/lib";

# Enable nightly features in stable compiles (used for
# bootstrapping, see https://github.com/rust-lang/rust/pull/37265).
# This loosens the hard restrictions on bootstrapping-compiler
# versions.
RUSTC_BOOTSTRAP = "1";

# Increase codegen units to introduce parallelism within the compiler.
RUSTFLAGS = "-Ccodegen-units=10";

# We need rust to build rust. If we don't provide it, configure will try to download it.
# Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py
configureFlags = configureFlags
++ [ "--enable-local-rust" "--local-rust-root=${rustPlatform.rust.rustc}" "--enable-rpath" ]
++ [ "--enable-vendor" ]
# ++ [ "--jemalloc-root=${jemalloc}/lib"
++ [ "--default-linker=${targetPackages.stdenv.cc}/bin/cc" ]
++ optional (!forceBundledLLVM) [ "--enable-llvm-link-shared" ]
++ optional (targets != []) "--target=${target}"
++ optional (!forceBundledLLVM) "--llvm-root=${llvmShared}";

# The boostrap.py will generated a Makefile that then executes the build.
# The BOOTSTRAP_ARGS used by this Makefile must include all flags to pass
# to the bootstrap builder.
postConfigure = ''
substituteInPlace Makefile --replace 'BOOTSTRAP_ARGS :=' 'BOOTSTRAP_ARGS := --jobs $(NIX_BUILD_CORES)'
'';

patches = patches ++ targetPatches;

# the rust build system complains that nix alters the checksums
dontFixLibtool = true;

passthru.target = target;

postPatch = ''
patchShebangs src/etc
# Fix dynamic linking against llvm
#${optionalString (!forceBundledLLVM) ''sed -i 's/, kind = \\"static\\"//g' src/etc/mklldeps.py''}
# Fix the configure script to not require curl as we won't use it
sed -i configure \
-e '/probe_need CFG_CURL curl/d'
# Fix the use of jemalloc prefixes which our jemalloc doesn't have
# TODO: reenable if we can figure out how to get our jemalloc to work
#[ -f src/liballoc_jemalloc/lib.rs ] && sed -i 's,je_,,g' src/liballoc_jemalloc/lib.rs
#[ -f src/liballoc/heap.rs ] && sed -i 's,je_,,g' src/liballoc/heap.rs # Remove for 1.4.0+
# Disable fragile tests.
rm -vr src/test/run-make/linker-output-non-utf8 || true
rm -vr src/test/run-make/issue-26092 || true
# Remove test targeted at LLVM 3.9 - https://github.com/rust-lang/rust/issues/36835
rm -vr src/test/run-pass/issue-36023.rs || true
# Disable test getting stuck on hydra - possible fix:
# https://reviews.llvm.org/rL281650
rm -vr src/test/run-pass/issue-36474.rs || true
# On Hydra: `TcpListener::bind(&addr)`: Address already in use (os error 98)'
sed '/^ *fn fast_rebind()/i#[ignore]' -i src/libstd/net/tcp.rs
# Useful debugging parameter
# export VERBOSE=1
'' + optionalString stdenv.isDarwin ''
# Disable all lldb tests.
# error: Can't run LLDB test because LLDB's python path is not set
rm -vr src/test/debuginfo/*
rm -v src/test/run-pass/backtrace-debuginfo.rs
# error: No such file or directory
rm -v src/test/run-pass/issue-45731.rs
# Disable tests that fail when sandboxing is enabled.
substituteInPlace src/libstd/sys/unix/ext/net.rs \
--replace '#[test]' '#[test] #[ignore]'
substituteInPlace src/test/run-pass/env-home-dir.rs \
--replace 'home_dir().is_some()' true
rm -v src/test/run-pass/fds-are-cloexec.rs # FIXME: pipes?
rm -v src/test/run-pass/sync-send-in-std.rs # FIXME: ???
'';

# rustc unfortunately need cmake for compiling llvm-rt but doesn't
# use it for the normal build. This disables cmake in Nix.
dontUseCmakeConfigure = true;

# ps is needed for one of the test cases
nativeBuildInputs =
[ file python2 procps rustPlatform.rust.rustc git cmake
which libffi
]
# Only needed for the debuginfo tests
++ optional (!stdenv.isDarwin) gdb;

buildInputs = [ ncurses ] ++ targetToolchains
++ optional stdenv.isDarwin Security
++ optional (!forceBundledLLVM) llvmShared;

outputs = [ "out" "man" "doc" ];
setOutputFlags = false;

# Disable codegen units and hardening for the tests.
preCheck = ''
export RUSTFLAGS=
export TZDIR=${tzdata}/share/zoneinfo
export hardeningDisable=all
'' +
# Ensure TMPDIR is set, and disable a test that removing the HOME
# variable from the environment falls back to another home
# directory.
optionalString stdenv.isDarwin ''
export TMPDIR=/tmp
sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
'';

inherit doCheck;

configurePlatforms = [];

# https://github.com/NixOS/nixpkgs/pull/21742#issuecomment-272305764
# https://github.com/rust-lang/rust/issues/30181
# enableParallelBuilding = false;

meta = with stdenv.lib; {
homepage = https://www.rust-lang.org/;
description = "A safe, concurrent, practical language";
maintainers = with maintainers; [ madjar cstrahan wizeman globin havvy wkennington ];
license = [ licenses.mit licenses.asl20 ];
platforms = platforms.linux ++ platforms.darwin;
broken = broken;
};
}
2 changes: 1 addition & 1 deletion pkgs/tools/typesetting/tex/texlive/combine.nix
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ let
pkgNeedsRuby = pkg: pkg.tlType == "run" && pkg.pname == "match-parens";
extraInputs =
lib.optional (lib.any pkgNeedsPython splitBin.wrong) python
++ lib.optional (lib.any pkgNeedsPython splitBin.wrong) ruby;
++ lib.optional (lib.any pkgNeedsRuby splitBin.wrong) ruby;
};

mkUniquePkgs = pkgs: fastUnique (a: b: a < b) # highlighting hack: >
5 changes: 5 additions & 0 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
@@ -6718,6 +6718,11 @@ with pkgs;
});
inherit (rust) cargo rustc;

rust_1_26 = callPackage ../development/compilers/rust/1.26
(stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
});

buildRustCrate = callPackage ../build-support/rust/build-rust-crate.nix { };

cargo-vendor = callPackage ../build-support/rust/cargo-vendor {};