Merge pull request #4558 from tailhook/rust0.12
rust: Upgrade rust stable to 0.12
This commit is contained in:
commit
1aa6022173
@ -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"
|
let snapshot = if stdenv.system == "i686-linux"
|
||||||
then "84339ea0f796ae468ef86797ef4587274bec19ea"
|
then "555aca74f9a268f80cab2df1147dc6406403e9e4"
|
||||||
else if stdenv.system == "x86_64-linux"
|
else if stdenv.system == "x86_64-linux"
|
||||||
then "bd8a6bc1f28845b7f4b768f6bfa06e7fbdcfcaae"
|
then "6a43c2f6c8ba2cbbcb9da1f7b58f748aef99f431"
|
||||||
else if stdenv.system == "i686-darwin"
|
else if stdenv.system == "i686-darwin"
|
||||||
then "3f25b2680efbab16ad074477a19d49dcce475977"
|
then "331bd7ef519cbb424188c546273e8c7d738f0894"
|
||||||
else if stdenv.system == "x86_64-darwin"
|
else if stdenv.system == "x86_64-darwin"
|
||||||
then "4a8c2e1b7634d73406bac32a1a97893ec3ed818d"
|
then "2c83a79a9febfe1d326acb17c3af76ba053c6ca9"
|
||||||
else abort "no-snapshot for platform ${stdenv.system}";
|
else abort "no-snapshot for platform ${stdenv.system}";
|
||||||
snapshotDate = "2014-06-21";
|
snapshotDate = "2014-10-04";
|
||||||
snapshotRev = "db9af1d";
|
snapshotRev = "749ff5e";
|
||||||
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2";
|
snapshotName = "rust-stage0-${snapshotDate}-${snapshotRev}-${platform}-${snapshot}.tar.bz2";
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
@ -37,8 +37,8 @@ in stdenv.mkDerivation {
|
|||||||
inherit meta;
|
inherit meta;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = http://static.rust-lang.org/dist/rust-0.11.0.tar.gz;
|
url = http://static.rust-lang.org/dist/rust-0.12.0.tar.gz;
|
||||||
sha256 = "1fhi8iiyyj5j48fpnp93sfv781z1dm0xy94h534vh4mz91jf7cyi";
|
sha256 = "1dv9wxh41230zknbwj34zgjnh1kgvvy6k12kbiy9bnch9nr6cgl8";
|
||||||
};
|
};
|
||||||
|
|
||||||
# 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.
|
||||||
@ -65,7 +65,8 @@ in stdenv.mkDerivation {
|
|||||||
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
|
patches = [ ./hardcode_paths.patch ./local_stage0.patch ];
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
substituteInPlace src/librustc/back/link.rs \
|
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"
|
--subst-var-by "arPath" "${stdenv.gcc.binutils}/bin/ar"
|
||||||
'';
|
'';
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
diff --git a/src/librustc/back/link.rs b/src/librustc/back/link.rs
|
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
|
--- a/src/librustc/back/link.rs
|
||||||
+++ b/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 {
|
pub fn get_cc_prog(sess: &Session) -> String {
|
||||||
match sess.opts.cg.linker {
|
match sess.opts.cg.linker {
|
||||||
@ -15,18 +15,23 @@ index 7a3e912..ced75fa 100644
|
|||||||
- // In the future, FreeBSD will use clang as default compiler.
|
- // In the future, FreeBSD will use clang as default compiler.
|
||||||
- // It would be flexible to use cc (system's default C compiler)
|
- // It would be flexible to use cc (system's default C compiler)
|
||||||
- // instead of hard-coded gcc.
|
- // 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 {
|
- match sess.targ_cfg.os {
|
||||||
- abi::OsWin32 => "gcc",
|
- abi::OsWindows => "gcc",
|
||||||
- _ => "cc",
|
- _ => "cc",
|
||||||
- }.to_string()
|
- }.to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_ar_prog(sess: &Session) -> String {
|
pub fn remove(sess: &Session, path: &Path) {
|
||||||
match sess.opts.cg.ar {
|
diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs
|
||||||
Some(ref ar) => (*ar).clone(),
|
index 060dda5..fecf76b 100644
|
||||||
- None => "ar".to_string()
|
--- a/src/librustc_back/archive.rs
|
||||||
+ None => "@arPath@".to_string()
|
+++ 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);
|
||||||
|
@ -2,7 +2,7 @@ diff --git a/src/etc/local_stage0.sh b/src/etc/local_stage0.sh
|
|||||||
index e78f231..6b6773b 100755
|
index e78f231..6b6773b 100755
|
||||||
--- a/src/etc/local_stage0.sh
|
--- a/src/etc/local_stage0.sh
|
||||||
+++ b/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
|
fi
|
||||||
|
|
||||||
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
|
cp ${PREFIX}/bin/rustc${BIN_SUF} ${TARG_DIR}/stage0/bin/
|
||||||
@ -11,3 +11,6 @@ index e78f231..6b6773b 100755
|
|||||||
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}rust*${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}std*${LIB_SUF} ${TARG_DIR}/stage0/${LIB_DIR}/
|
||||||
-cp ${PREFIX}/${LIB_DIR}/${LIB_PREFIX}syntax*${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
|
||||||
|
@ -3653,7 +3653,7 @@ let
|
|||||||
|
|
||||||
roadsend = callPackage ../development/compilers/roadsend { };
|
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 {};
|
rustcMaster = callPackage ../development/compilers/rustc/head.nix {};
|
||||||
|
|
||||||
rust = rustc;
|
rust = rustc;
|
||||||
|
Loading…
Reference in New Issue
Block a user