about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/compilers/rustc/1.0.0-alpha.nix105
-rw-r--r--pkgs/development/compilers/rustc/1.0.0-alpha2.nix16
-rw-r--r--pkgs/development/compilers/rustc/common.nix35
-rw-r--r--pkgs/development/compilers/rustc/grsec.HEAD.patch16
-rw-r--r--pkgs/development/compilers/rustc/hardcode_paths.patch28
-rw-r--r--pkgs/development/compilers/rustc/head.nix117
-rw-r--r--pkgs/development/compilers/rustc/local_stage0.patch16
-rw-r--r--pkgs/development/compilers/rustc/makeRustcDerivation.nix140
-rw-r--r--pkgs/development/compilers/rustc/patches/alpha2.patch44
-rw-r--r--pkgs/development/compilers/rustc/patches/grsec.patch (renamed from pkgs/development/compilers/rustc/grsec.patch)0
-rw-r--r--pkgs/development/compilers/rustc/patches/hardcode_paths.alpha.patch (renamed from pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch)0
-rw-r--r--pkgs/development/compilers/rustc/patches/head.patch44
-rw-r--r--pkgs/development/compilers/rustc/patches/local_stage0.alpha.patch (renamed from pkgs/development/compilers/rustc/local_stage0.HEAD.patch)0
-rw-r--r--pkgs/development/tools/build-managers/cargo/snapshot.nix12
-rw-r--r--pkgs/development/tools/rust/racer/default.nix6
-rw-r--r--pkgs/top-level/all-packages.nix4
16 files changed, 289 insertions, 294 deletions
diff --git a/pkgs/development/compilers/rustc/1.0.0-alpha.nix b/pkgs/development/compilers/rustc/1.0.0-alpha.nix
index fa80bcb5e02c..7a2e485c9c62 100644
--- a/pkgs/development/compilers/rustc/1.0.0-alpha.nix
+++ b/pkgs/development/compilers/rustc/1.0.0-alpha.nix
@@ -1,90 +1,17 @@
-{stdenv, fetchurl, which, file, perl, curl, python27, makeWrapper
-, tzdata, git, valgrind, procps, coreutils
-}:
-
-assert !stdenv.isFreeBSD;
-
-/* Rust's build process has a few quirks :
-
-- It requires some patched in llvm that haven't landed upstream, so it
-  compiles its own llvm. This might change in the future, so at some
-  point we may be able to switch to nix's llvm.
-
-- The Rust compiler is written is Rust, so it requires a bootstrap
-  compiler, which is downloaded during the build. To make the build
-  pure, we download it ourself before and put it where it is
-  expected. Once the language is stable (1.0) , we might want to
-  switch it to use nix's packaged rust compiler.
-
-*/
-
-with ((import ./common.nix) {inherit stdenv; version = "1.0.0-alpha"; });
-
-let snapshotHash = if stdenv.system == "i686-linux"
-      then "d8b73fc9aa3ad72ce1408a41e35d78dba10eb4d4"
-      else if stdenv.system == "x86_64-linux"
-      then "697880d3640e981bbbf23284363e8e9a158b588d"
-      else if stdenv.system == "i686-darwin"
-      then "a73b1fc03e8cac747aab0aa186292bb4332a7a98"
-      else if stdenv.system == "x86_64-darwin"
-      then "e4ae2670ea4ba5c2e5b4245409c9cab45c9eeb5b"
-      else abort "no-snapshot for platform ${stdenv.system}";
-    snapshotDate = "2015-01-07";
-    snapshotRev = "9e4e524";
-    snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2";
-
-in stdenv.mkDerivation {
-  inherit name;
-  inherit version;
-  inherit meta;
-
-  src = fetchurl {
-    url = "http://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
-    sha256 = "0p62gx3s087n09d2v3l9iyfx5cmsa1x91n4ysixcb7w3drr8a8is";
-  };
-
-  # We need rust to build rust. If we don't provide it, configure will try to download it.
-  snapshot = stdenv.mkDerivation {
-    name = "rust-stage0";
-    src = fetchurl {
-      url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
-      sha1 = snapshotHash;
-    };
-    dontStrip = true;
-    installPhase = ''
-      mkdir -p "$out"
-      cp -r bin "$out/bin"
-    '' + (if stdenv.isLinux then ''
-      patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \
-               --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \
-               "$out/bin/rustc"
-    '' else "");
-  };
-
-  configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ]
-                ++ stdenv.lib.optional (stdenv.cc ? clang) "--enable-clang";
-
-  # The compiler requires cc, so we patch the source to tell it where to find it
-  patches = [ ./hardcode_paths.patch ./local_stage0.patch ]
-            ++ stdenv.lib.optional stdenv.needsPax ./grsec.patch;
-
-  postPatch = ''
-    substituteInPlace src/librustc_trans/back/link.rs \
-      --subst-var-by "ccPath" "${stdenv.cc}/bin/cc"
-    substituteInPlace src/librustc_back/archive.rs \
-      --subst-var-by "arPath" "${stdenv.cc.binutils}/bin/ar"
-
-    substituteInPlace src/rust-installer/gen-install-script.sh \
-      --replace /bin/echo "${coreutils}/bin/echo"
-    substituteInPlace src/rust-installer/gen-installer.sh \
-      --replace /bin/echo "${coreutils}/bin/echo"
-  '';
-
-  buildInputs = [ which file perl curl python27 makeWrapper git valgrind procps ];
-
-  enableParallelBuilding = false; # disabled due to rust-lang/rust#16305
-
-  preCheck = "export TZDIR=${tzdata}/share/zoneinfo";
-
-  doCheck = true;
+{ stdenv, callPackage }:
+callPackage ./makeRustcDerivation.nix {
+  shortVersion = "1.0.0-alpha";
+  isRelease = true;
+  srcSha = "0p62gx3s087n09d2v3l9iyfx5cmsa1x91n4ysixcb7w3drr8a8is";
+  snapshotHashLinux686 = "d8b73fc9aa3ad72ce1408a41e35d78dba10eb4d4";
+  snapshotHashLinux64 = "697880d3640e981bbbf23284363e8e9a158b588d";
+  snapshotHashDarwin686 = "a73b1fc03e8cac747aab0aa186292bb4332a7a98";
+  snapshotHashDarwin64 = "e4ae2670ea4ba5c2e5b4245409c9cab45c9eeb5b";
+  snapshotDate = "2015-01-07";
+  snapshotRev = "9e4e524";
+  patches = [
+    ./patches/hardcode_paths.alpha.patch
+    ./patches/local_stage0.alpha.patch
+    ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
 }
+
diff --git a/pkgs/development/compilers/rustc/1.0.0-alpha2.nix b/pkgs/development/compilers/rustc/1.0.0-alpha2.nix
new file mode 100644
index 000000000000..94bdd995592f
--- /dev/null
+++ b/pkgs/development/compilers/rustc/1.0.0-alpha2.nix
@@ -0,0 +1,16 @@
+{ stdenv, callPackage }:
+callPackage ./makeRustcDerivation.nix {
+  shortVersion = "1.0.0-alpha.2";
+  isRelease = true;
+  srcSha = "1j2n34w0hdz7jrl100c9q9hl80l8nsc3xwnzizv9sh4gx52vjcd9";
+  snapshotHashLinux686 = "191ed5ec4f17e32d36abeade55a1c6085e51245c";
+  snapshotHashLinux64 = "acec86045632f4f3f085c072ba696f889906dffe";
+  snapshotHashDarwin686 = "9d9e622584bfa318f32bcb5b9ce6a365febff595";
+  snapshotHashDarwin64 = "e96c1e9860b186507cc75c186d1b96d44df12292";
+  snapshotDate = "2015-02-17";
+  snapshotRev = "f1bb6c2";
+  patches = [
+    ./patches/alpha2.patch
+    ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
+}
+
diff --git a/pkgs/development/compilers/rustc/common.nix b/pkgs/development/compilers/rustc/common.nix
deleted file mode 100644
index 8debb4342dac..000000000000
--- a/pkgs/development/compilers/rustc/common.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{stdenv, version}:
-
-{
-  inherit version;
-
-  platform = if stdenv.system == "i686-linux"
-    then "linux-i386"
-    else if stdenv.system == "x86_64-linux"
-    then "linux-x86_64"
-    else if stdenv.system == "i686-darwin"
-    then "macos-i386"
-    else if stdenv.system == "x86_64-darwin"
-    then "macos-x86_64"
-    else abort "no snapshot to bootstrap for this platform (missing platform url suffix)";
-
-  target = 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 == "i686-darwin"
-    then "i686-apple-darwin"
-    else if stdenv.system == "x86_64-darwin"
-    then "x86_64-apple-darwin"
-    else abort "no snapshot to bootstrap for this platform (missing target triple)";
-
-  meta = with stdenv.lib; {
-    homepage = http://www.rust-lang.org/;
-    description = "A safe, concurrent, practical language";
-    maintainers = with maintainers; [ madjar cstrahan wizeman ];
-    license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ];
-    platforms = platforms.linux;
-  };
-
-  name = "rustc-${version}";
-}
diff --git a/pkgs/development/compilers/rustc/grsec.HEAD.patch b/pkgs/development/compilers/rustc/grsec.HEAD.patch
deleted file mode 100644
index 84582ab7d70f..000000000000
--- a/pkgs/development/compilers/rustc/grsec.HEAD.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile
-index 2fcdd32..2d9ddb0 100644
---- a/src/test/run-make/relocation-model/Makefile
-+++ b/src/test/run-make/relocation-model/Makefile
-@@ -5,9 +5,11 @@ all:
- 	$(call RUN,foo)
- 
- 	$(RUSTC) -C relocation-model=default foo.rs
-+	paxctl -czexm $(TMPDIR)/foo
- 	$(call RUN,foo)
- 
- 	$(RUSTC) -C relocation-model=static foo.rs
-+	paxctl -czexm $(TMPDIR)/foo
- 	$(call RUN,foo)
- 
- 	$(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs
diff --git a/pkgs/development/compilers/rustc/hardcode_paths.patch b/pkgs/development/compilers/rustc/hardcode_paths.patch
deleted file mode 100644
index 2a9cb09dcbd3..000000000000
--- a/pkgs/development/compilers/rustc/hardcode_paths.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
-index 7ea192b..cd5d01b 100644
---- a/src/librustc_back/archive.rs
-+++ b/src/librustc_back/archive.rs
-@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
-           paths: &[&Path]) -> ProcessOutput {
-     let ar = match *maybe_ar_prog {
-         Some(ref ar) => &ar[],
--        None => "ar"
-+        None => "@arPath@"
-     };
-     let mut cmd = Command::new(ar);
- 
-diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
-index dacf620..815ce60 100644
---- a/src/librustc_trans/back/link.rs
-+++ b/src/librustc_trans/back/link.rs
-@@ -348,8 +348,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
- 
- pub fn get_cc_prog(sess: &Session) -> String {
-     match sess.opts.cg.linker {
--        Some(ref linker) => return linker.to_string(),
--        None => sess.target.target.options.linker.clone(),
-+        Some(ref linker) => linker.to_string(),
-+        None => "@ccPath@".to_string(),
-     }
- }
- 
diff --git a/pkgs/development/compilers/rustc/head.nix b/pkgs/development/compilers/rustc/head.nix
index dd73449d5fd0..5669b15a7000 100644
--- a/pkgs/development/compilers/rustc/head.nix
+++ b/pkgs/development/compilers/rustc/head.nix
@@ -1,101 +1,18 @@
-{ stdenv, fetchurl, fetchgit, which, file, perl, curl, python27, makeWrapper
-, tzdata, git, valgrind, procps, coreutils
-}:
-
-assert !stdenv.isFreeBSD;
-
-/* Rust's build process has a few quirks :
-
-- It requires some patched in llvm that haven't landed upstream, so it
-  compiles its own llvm. This might change in the future, so at some
-  point we may be able to switch to nix's llvm.
-
-- The Rust compiler is written is Rust, so it requires a bootstrap
-  compiler, which is downloaded during the build. To make the build
-  pure, we download it ourself before and put it where it is
-  expected. Once the language is stable (1.0) , we might want to
-  switch it to use nix's packaged rust compiler.
-
-
-NOTE : some derivation depend on rust. When updating this, please make
-sure those derivations still compile. (racer, for example).
-
-*/
-
-let shortVersion = "1.0.0-dev";
-    rev = "a833337943300db1c310a4cf9c84b7b4ef4e9468";
-    revShort = builtins.substring 0 7 rev;
-in
-
-with ((import ./common.nix) {inherit stdenv; version = "${shortVersion}-g${revShort}"; });
-
-let snapshotHash = if stdenv.system == "i686-linux"
-      then "0197ad7179d74eba06a8b46432548caf226aa03d"
-      else if stdenv.system == "x86_64-linux"
-      then "03459f8b216e96ed8b9abe25a42a75859195103d"
-      else if stdenv.system == "i686-darwin"
-      then "b5c004883ddff84159f11a3329cde682e0b7f75b"
-      else if stdenv.system == "x86_64-darwin"
-      then "b69ea42e1c995682adf0390ed4ef8a762c001a4e"
-      else abort "no snapshot for platform ${stdenv.system}";
-    snapshotDate = "2015-01-15";
-    snapshotRev = "9ade482";
-    snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2";
-in
-
-stdenv.mkDerivation {
-  inherit name;
-  inherit version;
-  inherit meta;
-
-  src = fetchgit {
-    url = https://github.com/rust-lang/rust;
-    inherit rev;
-    sha256 = "1b9rnx3j37ckxa3vf20g8amsbffzvk2m9lzv5x1m04ci54w85f56";
-  };
-
-  # We need rust to build rust. If we don't provide it, configure will try to download it.
-  snapshot = stdenv.mkDerivation {
-    name = "rust-stage0";
-    src = fetchurl {
-      url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
-      sha1 = snapshotHash;
-    };
-    dontStrip = true;
-    installPhase = ''
-      mkdir -p "$out"
-      cp -r bin "$out/bin"
-    '' + (if stdenv.isLinux then ''
-      patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \
-               --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \
-               "$out/bin/rustc"
-    '' else "");
-  };
-
-  configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ]
-                ++ stdenv.lib.optional (stdenv.cc ? clang) "--enable-clang";
-
-  # The compiler requires cc, so we patch the source to tell it where to find it
-  patches = [ ./hardcode_paths.HEAD.patch ./local_stage0.HEAD.patch ]
-            ++ stdenv.lib.optional stdenv.needsPax ./grsec.HEAD.patch;
-
-  postPatch = ''
-    substituteInPlace src/librustc_trans/back/link.rs \
-      --subst-var-by "ccPath" "${stdenv.cc}/bin/cc"
-    substituteInPlace src/librustc_back/archive.rs \
-      --subst-var-by "arPath" "${stdenv.cc.binutils}/bin/ar"
-
-    substituteInPlace src/rust-installer/gen-install-script.sh \
-      --replace /bin/echo "${coreutils}/bin/echo"
-    substituteInPlace src/rust-installer/gen-installer.sh \
-      --replace /bin/echo "${coreutils}/bin/echo"
-  '';
-
-  buildInputs = [ which file perl curl python27 makeWrapper git valgrind procps ];
-
-  enableParallelBuilding = false; # disabled due to rust-lang/rust#16305
-
-  preCheck = "export TZDIR=${tzdata}/share/zoneinfo";
-
-  doCheck = true;
+{ stdenv, callPackage }:
+callPackage ./makeRustcDerivation.nix {
+  shortVersion = "1.0.0-dev";
+  isRelease = false;
+  # src rev for master on 2015/03/01
+  srcRev = "157614249594f187f421cd97f928e64c5ab5c1fa";
+  srcSha = "06d6fwl1dg6wfnwa002ak89hnjplpf2sjhg78yjg4ki0ca7b0b74";
+  snapshotHashLinux686 = "3278ebbce8cb269acc0614dac5ddac07eab6a99c";
+  snapshotHashLinux64 = "72287d0d88de3e5a53bae78ac0d958e1a7637d73";
+  snapshotHashDarwin686 = "33b366b5287427a340a0aa6ed886d5ff4edf6a76";
+  snapshotHashDarwin64 = "914bf9baa32081a9d5633f1d06f4d382cd71504e";
+  snapshotDate = "2015-02-25";
+  snapshotRev = "880fb89";
+  patches = [
+    ./patches/head.patch
+  ] ++ stdenv.lib.optional stdenv.needsPax ./patches/grsec.patch;
 }
+
diff --git a/pkgs/development/compilers/rustc/local_stage0.patch b/pkgs/development/compilers/rustc/local_stage0.patch
deleted file mode 100644
index 2f38d7c1757c..000000000000
--- a/pkgs/development/compilers/rustc/local_stage0.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
-index e78f231..6b6773b 100755
---- a/src/etc/local_stage0.sh
-+++ b/src/etc/local_stage0.sh
-@@ -53,11 +53,6 @@
- fi
- 
- cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
--cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
--cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
--cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
--cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
--cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
- 
- # do not fail if one of the above fails, as all we need is a working rustc!
- exit 0
diff --git a/pkgs/development/compilers/rustc/makeRustcDerivation.nix b/pkgs/development/compilers/rustc/makeRustcDerivation.nix
new file mode 100644
index 000000000000..7be005fb763e
--- /dev/null
+++ b/pkgs/development/compilers/rustc/makeRustcDerivation.nix
@@ -0,0 +1,140 @@
+{ stdenv, fetchurl, fetchgit, which, file, perl, curl, python27, makeWrapper
+, tzdata, git, valgrind, procps, coreutils
+
+, shortVersion, isRelease
+, srcSha, srcRev ? ""
+, snapshotHashLinux686, snapshotHashLinux64
+, snapshotHashDarwin686, snapshotHashDarwin64
+, snapshotDate, snapshotRev
+
+, patches
+}:
+
+assert !stdenv.isFreeBSD;
+
+/* Rust's build process has a few quirks :
+
+- It requires some patched in llvm that haven't landed upstream, so it
+  compiles its own llvm. This might change in the future, so at some
+  point we may be able to switch to nix's llvm.
+
+- The Rust compiler is written is Rust, so it requires a bootstrap
+  compiler, which is downloaded during the build. To make the build
+  pure, we download it ourself before and put it where it is
+  expected. Once the language is stable (1.0) , we might want to
+  switch it to use nix's packaged rust compiler.
+
+NOTE : some derivation depend on rust. When updating this, please make
+sure those derivations still compile. (racer, for example).
+
+*/
+
+assert (if isRelease then srcRev == "" else srcRev != "");
+
+let version = if isRelease then
+        "${shortVersion}"
+      else
+        "${shortVersion}-g${builtins.substring 0 7 srcRev}";
+
+    name = "rustc-${version}";
+
+    platform = if stdenv.system == "i686-linux"
+      then "linux-i386"
+      else if stdenv.system == "x86_64-linux"
+      then "linux-x86_64"
+      else if stdenv.system == "i686-darwin"
+      then "macos-i386"
+      else if stdenv.system == "x86_64-darwin"
+      then "macos-x86_64"
+      else abort "no snapshot to bootstrap for this platform (missing platform url suffix)";
+
+    target = 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 == "i686-darwin"
+      then "i686-apple-darwin"
+      else if stdenv.system == "x86_64-darwin"
+      then "x86_64-apple-darwin"
+      else abort "no snapshot to bootstrap for this platform (missing target triple)";
+
+    meta = with stdenv.lib; {
+      homepage = http://www.rust-lang.org/;
+      description = "A safe, concurrent, practical language";
+      maintainers = with maintainers; [ madjar cstrahan wizeman ];
+      license = map (builtins.getAttr "shortName") [ licenses.mit licenses.asl20 ];
+      platforms = platforms.linux;
+    };
+
+    snapshotHash = if stdenv.system == "i686-linux"
+      then snapshotHashLinux686
+      else if stdenv.system == "x86_64-linux"
+      then snapshotHashLinux64
+      else if stdenv.system == "i686-darwin"
+      then snapshotHashDarwin686
+      else if stdenv.system == "x86_64-darwin"
+      then snapshotHashDarwin64
+      else abort "no snapshot for platform ${stdenv.system}";
+    snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshotHash}.tar.bz2";
+in
+
+stdenv.mkDerivation {
+  inherit name;
+  inherit version;
+  inherit meta;
+
+  src = if isRelease then
+      fetchurl {
+        url = "http://static.rust-lang.org/dist/rustc-${version}-src.tar.gz";
+        sha256 = srcSha;
+      }
+    else
+      fetchgit {
+        url = https://github.com/rust-lang/rust;
+        rev = srcRev;
+        sha256 = srcSha;
+      };
+
+  # We need rust to build rust. If we don't provide it, configure will try to download it.
+  snapshot = stdenv.mkDerivation {
+    name = "rust-stage0";
+    src = fetchurl {
+      url = "http://static.rust-lang.org/stage0-snapshots/${snapshotName}";
+      sha1 = snapshotHash;
+    };
+    dontStrip = true;
+    installPhase = ''
+      mkdir -p "$out"
+      cp -r bin "$out/bin"
+    '' + (if stdenv.isLinux then ''
+      patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \
+               --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/" \
+               "$out/bin/rustc"
+    '' else "");
+  };
+
+  configureFlags = [ "--enable-local-rust" "--local-rust-root=$snapshot" ]
+                ++ stdenv.lib.optional (stdenv.cc ? clang) "--enable-clang";
+
+  inherit patches;
+
+  postPatch = ''
+    substituteInPlace src/librustc_trans/back/link.rs \
+      --subst-var-by "ccPath" "${stdenv.cc}/bin/cc"
+    substituteInPlace src/librustc_back/archive.rs \
+      --subst-var-by "arPath" "${stdenv.cc.binutils}/bin/ar"
+
+    substituteInPlace src/rust-installer/gen-install-script.sh \
+      --replace /bin/echo "${coreutils}/bin/echo"
+    substituteInPlace src/rust-installer/gen-installer.sh \
+      --replace /bin/echo "${coreutils}/bin/echo"
+  '';
+
+  buildInputs = [ which file perl curl python27 makeWrapper git valgrind procps ];
+
+  enableParallelBuilding = false; # disabled due to rust-lang/rust#16305
+
+  preCheck = "export TZDIR=${tzdata}/share/zoneinfo";
+
+  doCheck = true;
+}
diff --git a/pkgs/development/compilers/rustc/patches/alpha2.patch b/pkgs/development/compilers/rustc/patches/alpha2.patch
new file mode 100644
index 000000000000..8c15af5aca9b
--- /dev/null
+++ b/pkgs/development/compilers/rustc/patches/alpha2.patch
@@ -0,0 +1,44 @@
+diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
+index b506aff..b4b346b 100755
+--- a/src/etc/local_stage0.sh
++++ b/src/etc/local_stage0.sh
+@@ -50,11 +50,6 @@ if [ -z $TARG_DIR ]; then
+ fi
+ 
+ cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
+-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+ 
+ # do not fail if one of the above fails, as all we need is a working rustc!
+ exit 0
+diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
+index c45ee25..0f91672 100644
+--- a/src/librustc_back/archive.rs
++++ b/src/librustc_back/archive.rs
+@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
+           paths: &[&Path]) -> ProcessOutput {
+     let ar = match *maybe_ar_prog {
+         Some(ref ar) => &ar[..],
+-        None => "ar"
++        None => "@arPath@"
+     };
+     let mut cmd = Command::new(ar);
+ 
+diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
+index ef849bb..e090b99 100644
+--- a/src/librustc_trans/back/link.rs
++++ b/src/librustc_trans/back/link.rs
+@@ -350,8 +350,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
+ 
+ pub fn get_cc_prog(sess: &Session) -> String {
+     match sess.opts.cg.linker {
+-        Some(ref linker) => return linker.to_string(),
+-        None => sess.target.target.options.linker.clone(),
++        Some(ref linker) => linker.to_string(),
++        None => "@ccPath@".to_string(),
+     }
+ }
+ 
diff --git a/pkgs/development/compilers/rustc/grsec.patch b/pkgs/development/compilers/rustc/patches/grsec.patch
index 84582ab7d70f..84582ab7d70f 100644
--- a/pkgs/development/compilers/rustc/grsec.patch
+++ b/pkgs/development/compilers/rustc/patches/grsec.patch
diff --git a/pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch b/pkgs/development/compilers/rustc/patches/hardcode_paths.alpha.patch
index 2a9cb09dcbd3..2a9cb09dcbd3 100644
--- a/pkgs/development/compilers/rustc/hardcode_paths.HEAD.patch
+++ b/pkgs/development/compilers/rustc/patches/hardcode_paths.alpha.patch
diff --git a/pkgs/development/compilers/rustc/patches/head.patch b/pkgs/development/compilers/rustc/patches/head.patch
new file mode 100644
index 000000000000..a0ecdaeb0495
--- /dev/null
+++ b/pkgs/development/compilers/rustc/patches/head.patch
@@ -0,0 +1,44 @@
+diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
+index ca59b1c..65ee7bf 100755
+--- a/src/etc/local_stage0.sh
++++ b/src/etc/local_stage0.sh
+@@ -50,11 +50,6 @@ if [ -z $TARG_DIR ]; then
+ fi
+ 
+ cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
+-cp ${PREFIX}/${LIB_DIR}/${RUSTLIBDIR}/${TARG_DIR}/${LIB_DIR}/* ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}extra*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
+ 
+ # do not fail if one of the above fails, as all we need is a working rustc!
+ exit 0
+diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
+index 6bf7453..319f9af 100644
+--- a/src/librustc_back/archive.rs
++++ b/src/librustc_back/archive.rs
+@@ -54,7 +54,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
+           paths: &[&Path]) -> ProcessOutput {
+     let ar = match *maybe_ar_prog {
+         Some(ref ar) => &ar[..],
+-        None => "ar"
++        None => "@arPath@"
+     };
+     let mut cmd = Command::new(ar);
+ 
+diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs
+index ea5001a..911445c 100644
+--- a/src/librustc_trans/back/link.rs
++++ b/src/librustc_trans/back/link.rs
+@@ -350,8 +350,8 @@ pub fn mangle_internal_name_by_path_and_seq(path: PathElems, flav: &str) -> Stri
+ 
+ pub fn get_cc_prog(sess: &Session) -> String {
+     match sess.opts.cg.linker {
+-        Some(ref linker) => return linker.to_string(),
+-        None => sess.target.target.options.linker.clone(),
++        Some(ref linker) => linker.to_string(),
++        None => "@ccPath@".to_string(),
+     }
+ }
+ 
diff --git a/pkgs/development/compilers/rustc/local_stage0.HEAD.patch b/pkgs/development/compilers/rustc/patches/local_stage0.alpha.patch
index 2f38d7c1757c..2f38d7c1757c 100644
--- a/pkgs/development/compilers/rustc/local_stage0.HEAD.patch
+++ b/pkgs/development/compilers/rustc/patches/local_stage0.alpha.patch
diff --git a/pkgs/development/tools/build-managers/cargo/snapshot.nix b/pkgs/development/tools/build-managers/cargo/snapshot.nix
index f962eaef770b..d38c8166c6e6 100644
--- a/pkgs/development/tools/build-managers/cargo/snapshot.nix
+++ b/pkgs/development/tools/build-managers/cargo/snapshot.nix
@@ -2,19 +2,19 @@
 
 /* Cargo binary snapshot */
 
-let snapshotDate = "2015-01-24";
+let snapshotDate = "2015-02-26";
 in
 
 with ((import ./common.nix) { inherit stdenv; version = "snapshot-${snapshotDate}"; });
 
 let snapshotHash = if stdenv.system == "i686-linux"
-      then "96213038f850569f1c4fa6a0d146c6155c0d566b"
+      then "2a28b604d09b4a76a54a05d91f7f158692427b3a"
       else if stdenv.system == "x86_64-linux"
-      then "4d87486493c2881edced7b1d2f8beaac32aaa5b5"
+      then "7367f4aca86d38e209ef7236b00175df036c03e2"
       else if stdenv.system == "i686-darwin"
-      then "17b9fc782e86bffe170abb83a01e0cb7c90a0daa"
+      then "e5cabb0a4a2b4e47f7b1ae9b802e2b5d0b14eac5"
       else if stdenv.system == "x86_64-darwin"
-      then "18887bdbd3e6d2a127aa34216fa06e9877b0fbc6"
+      then "3026c60ddd46d2bcf1cb178fc801095dbfba5286"
       else throw "no snapshot for platform ${stdenv.system}";
     snapshotName = "cargo-nightly-${platform}.tar.gz";
 in
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
 
   installPhase = ''
     mkdir -p "$out"
-    cp -r bin "$out/bin"
+    cp -r cargo/bin "$out/bin"
   '' + (if stdenv.isLinux then ''
     patchelf --interpreter "${stdenv.glibc}/lib/${stdenv.cc.dynamicLinker}" \
              --set-rpath "${stdenv.cc.cc}/lib/:${stdenv.cc.cc}/lib64/:${zlib}/lib" \
diff --git a/pkgs/development/tools/rust/racer/default.nix b/pkgs/development/tools/rust/racer/default.nix
index d07f7fd28e93..75c099877617 100644
--- a/pkgs/development/tools/rust/racer/default.nix
+++ b/pkgs/development/tools/rust/racer/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   #TODO add emacs support
-  name = "racer-git-2015-01-20";
+  name = "racer-git-2015-02-28";
   src = fetchgit {
     url = https://github.com/phildawes/racer;
-    rev = "599aa524ea949ec5f9f0be0375dbb1df9cb852ae";
-    sha256 = "1kasm7vffn176wr072m1dmqg1rb3wqai9yisxf8mia62548pdx88";
+    rev = "2e1d718fae21431de4493c238196466e9d4996bc";
+    sha256 = "0lvp494kg2hlbbdrwxmmxkyhjw53y9wjdml9z817pwj3fwmrjsx0";
   };
 
   buildInputs = [ rustc cargo makeWrapper ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5f64a37cb696..fba5857cfb4c 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4149,8 +4149,10 @@ let
     ocaml = ocaml_3_08_0;
   };
 
-  rustc       = callPackage ../development/compilers/rustc/1.0.0-alpha.nix {};
+  rustcAlpha  = callPackage ../development/compilers/rustc/1.0.0-alpha.nix {};
+  rustcAlpha2 = callPackage ../development/compilers/rustc/1.0.0-alpha2.nix {};
   rustcMaster = callPackage ../development/compilers/rustc/head.nix {};
+  rustc = rustcAlpha2;
 
 
   sbclBootstrap = callPackage ../development/compilers/sbcl/bootstrap.nix {};