rust: Upgrade rust stable to 0.12

This commit is contained in:
Paul Colomiets 2014-10-16 23:24:33 +03:00
parent 287d6d5d3a
commit 4035d9f27e
4 changed files with 34 additions and 25 deletions

View File

@ -16,19 +16,19 @@ assert stdenv.gcc.gcc != null;
*/
with ((import ./common.nix) {inherit stdenv; version = "0.11.0"; });
with ((import ./common.nix) {inherit stdenv; version = "0.12.0"; });
let snapshot = if stdenv.system == "i686-linux"
then "84339ea0f796ae468ef86797ef4587274bec19ea"
then "555aca74f9a268f80cab2df1147dc6406403e9e4"
else if stdenv.system == "x86_64-linux"
then "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae"
then "6a43c2f6c8ba2cbbcb9da1f7b58f748aef99f431"
else if stdenv.system == "i686-darwin"
then "3f25b2680efbab16ad074477a19d49dcce475977"
then "331bd7ef519cbb424188c546273e8c7d738f0894"
else if stdenv.system == "x86_64-darwin"
then "4a8c2e1b7634d73406bac32a1a97893ec3ed818d"
then "2c83a79a9febfe1d326acb17c3af76ba053c6ca9"
else abort "no-snapshot for platform ${stdenv.system}";
snapshotDate = "2014-06-21";
snapshotRev = "db9af1d";
snapshotDate = "2014-10-04";
snapshotRev = "749ff5e";
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2";
in stdenv.mkDerivation {
@ -37,8 +37,8 @@ in stdenv.mkDerivation {
inherit meta;
src = fetchurl {
url = http://static.rust-lang.org/dist/rust-0.11.0.tar.gz;
sha256 = "1fhi8iiyyj5j48fpnp93sfv781z1dm0xy94h534vh4mz91jf7cyi";
url = http://static.rust-lang.org/dist/rust-0.12.0.tar.gz;
sha256 = "1dv9wxh41230zknbwj34zgjnh1kgvvy6k12kbiy9bnch9nr6cgl8";
};
# We need rust to build rust. If we don't provide it, configure will try to download it.
@ -65,7 +65,8 @@ in stdenv.mkDerivation {
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
postPatch = ''
substituteInPlace src/librustc/back/link.rs \
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc" \
--subst-var-by "ccPath" "${stdenv.gcc}/bin/cc"
substituteInPlace src/librustc_back/archive.rs \
--subst-var-by "arPath" "${stdenv.gcc.binutils}/bin/ar"
'';

View File

@ -1,8 +1,8 @@
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
index 7a3e912..ced75fa 100644
index 1cc60fc..2e94b99 100644
--- a/src/librustc/back/link.rs
+++ b/src/librustc/back/link.rs
@@ -766,24 +766,15 @@ pub fn output_lib_filename(id: &CrateId) -> String {
@@ -383,18 +383,9 @@ 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 {
@ -15,18 +15,23 @@ index 7a3e912..ced75fa 100644
- // In the future, FreeBSD will use clang as default compiler.
- // It would be flexible to use cc (system's default C compiler)
- // instead of hard-coded gcc.
- // For win32, there is no cc command, so we add a condition to make it use gcc.
- // For Windows, there is no cc command, so we add a condition to make it use gcc.
- match sess.targ_cfg.os {
- abi::OsWin32 => "gcc",
- abi::OsWindows => "gcc",
- _ => "cc",
- }.to_string()
}
pub fn get_ar_prog(sess: &Session) -> String {
match sess.opts.cg.ar {
Some(ref ar) => (*ar).clone(),
- None => "ar".to_string()
+ None => "@arPath@".to_string()
}
}
pub fn remove(sess: &Session, path: &Path) {
diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
index 060dda5..fecf76b 100644
--- a/src/librustc_back/archive.rs
+++ b/src/librustc_back/archive.rs
@@ -53,7 +53,7 @@ fn run_ar(handler: &ErrorHandler, maybe_ar_prog: &Option<String>,
paths: &[&Path]) -> ProcessOutput {
let ar = match *maybe_ar_prog {
Some(ref ar) => ar.as_slice(),
- None => "ar"
+ None => "@arPath@"
};
let mut cmd = Command::new(ar);

View File

@ -2,12 +2,15 @@ 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,8 +53,3 @@ if [ -z $TARG_DIR ]; then
@@ -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

View File

@ -3653,7 +3653,7 @@ let
roadsend = callPackage ../development/compilers/roadsend { };
rustc = callPackage ../development/compilers/rustc/0.11.nix {};
rustc = callPackage ../development/compilers/rustc/0.12.nix {};
rustcMaster = callPackage ../development/compilers/rustc/head.nix {};
rust = rustc;