diff --git a/servo/README.md b/servo/README.md index a4c5dbfdb482..235d44d6960f 100644 --- a/servo/README.md +++ b/servo/README.md @@ -1274,9 +1274,7 @@ see [ rust - -commit -- -hash +toolchain ] ( https @@ -1297,9 +1295,7 @@ master / rust - -commit -- -hash +toolchain ) . # diff --git a/servo/appveyor.yml b/servo/appveyor.yml index acc25ebe0486..7167ac7d100d 100644 --- a/servo/appveyor.yml +++ b/servo/appveyor.yml @@ -410,9 +410,7 @@ servo > rust - -commit -- -hash +toolchain - . cargo @@ -420,9 +418,7 @@ cargo > rust - -commit -- -hash +toolchain - . ccache diff --git a/servo/python/servo/bootstrap_commands.py b/servo/python/servo/bootstrap_commands.py index aaa8a6dd7979..8ed86214151e 100644 --- a/servo/python/servo/bootstrap_commands.py +++ b/servo/python/servo/bootstrap_commands.py @@ -387,22 +387,6 @@ stable ) -version -= -self -. -rust_version -( -) - -rust_path -= -self -. -rust_path -( -) - rust_dir = path @@ -417,7 +401,11 @@ " rust " +self +. rust_path +( +) ) install_dir @@ -434,43 +422,49 @@ " rust " -version -) - -if -not self . -config -[ -" -build -" -] -[ -" -llvm -- -assertions -" -] -: - -if -not +rust_install_dir +( +) +) + +version += self . -use_stable_rust +rust_stable_version ( ) -: - -install_dir -+ +if +stable +else +" +nightly +" + +static_s3 = " +https +: +/ +/ +static - -alt +rust +- +lang +- +org +. +s3 +. +amazonaws +. +com +/ +dist " if @@ -565,83 +559,148 @@ stable : -tarball +base_url += +static_s3 + +else +: + +import +toml + +import +re + +channel = " -rustc -- % s -- +/ % s +/ +channel +- +rust +- +nightly . -tar -. -gz +toml " % ( +static_s3 +self +. +rust_nightly_date +( +) +) + +version_string += +toml +. +load +( +urllib2 +. +urlopen +( +channel +) +) +[ +" +pkg +" +] +[ +" +rustc +" +] +[ +" version -host_triple +" +] + +short_commit += +re +. +search ( +" +\ +( +( +[ +0 +- +9a +- +f +] ++ ) +" +version_string +) +. +group +( +1 ) -rustc_url +commit_api = " https : / / -static -- -rust -- -lang -- -org -. -s3 +api . -amazonaws +github . com / -dist +repos +/ +rust +- +lang +/ +rust +/ +commits / " + -tarball - -else -: +short_commit -tarball +nightly_commit_hash = -" -% -s -/ -rustc -- -nightly -- -% -s -. -tar +json . -gz -" -% +load ( -version -host_triple +urllib2 +. +urlopen ( +commit_api ) ) +[ +" +sha +" +] base_url = @@ -694,15 +753,40 @@ alt " +base_url ++ += +" +/ +" ++ +nightly_commit_hash + rustc_url = base_url + " / +rustc +- +% +s +- +% +s +. +tar +. +gz " -+ -tarball +% +( +version +host_triple +( +) +) tgz_file = @@ -755,36 +839,6 @@ " ) -nightly_suffix -= -" -" -if -stable -else -" -- -nightly -" - -stable_version -= -" -- -{ -} -" -. -format -( -version -) -if -stable -else -" -" - lib_dir = path @@ -795,19 +849,16 @@ " rustc -{ -} -{ -} - -{ -} +% +s +- +% +s " -. -format +% ( -nightly_suffix -stable_version +version host_triple ( ) @@ -914,38 +965,9 @@ continue -if -self -. -use_stable_rust -( -) -: - -std_url +tarball = -( " -https -: -/ -/ -static -- -rust -- -lang -- -org -. -s3 -. -amazonaws -. -com -/ -dist -/ rust - std @@ -960,114 +982,62 @@ . gz " - % ( version target_triple ) -) - + tgz_file = -install_dir -+ -( -' -rust -- -std -- -% -s -- -% -s -. -tar +path . -gz -' -% +join ( -version -target_triple -) +install_dir +tarball ) -else +if +self +. +use_stable_rust +( +) : std_url = -( +static_s3 ++ " -https -: -/ -/ -s3 -. -amazonaws -. -com -/ -rust -- -lang -- -ci -/ -rustc -- -builds -/ -% -s / -rust -- -std -- -nightly -- -% -s -. -tar -. -gz " - -% -( -version -target_triple -) -) ++ +tarball + +else +: -tgz_file +std_url = -install_dir +static_s3 + -( -' -rust -- -std -- -nightly -- -% -s -. -tar +" +/ +" ++ +self . -gz -' -% -target_triple +rust_nightly_date +( ) ++ +" +/ +" ++ +tarball download_file ( @@ -1124,8 +1094,7 @@ rust - std -% -s +- % s - @@ -1134,8 +1103,7 @@ " % ( -nightly_suffix -stable_version +version target_triple ) @@ -1149,6 +1117,7 @@ " % target_triple + " lib " @@ -1166,8 +1135,7 @@ " rustc -% -s +- % s - @@ -1176,8 +1144,7 @@ " % ( -nightly_suffix -stable_version +version host_triple ( ) @@ -1186,6 +1153,7 @@ " rustc " + " lib " @@ -1205,13 +1173,11 @@ join ( install_dir - " rust - std -% -s +- % s - @@ -1220,8 +1186,7 @@ " % ( -nightly_suffix -stable_version +version target_triple ) ) @@ -1459,6 +1424,9 @@ / dist / +% +s +/ rust - docs @@ -1474,10 +1442,17 @@ " % +( +self +. +rust_nightly_date +( +) host_triple ( ) ) +) tgz_file = @@ -1691,10 +1666,9 @@ " cargo " - self . -cargo_build_id +rust_nightly_date ( ) ) @@ -1811,21 +1785,21 @@ : / / +static +- +rust +- +lang +- +org +. s3 . amazonaws . com / -rust -- -lang -- -ci -/ -rustc -- -builds +dist / % s @@ -1839,19 +1813,9 @@ ( self . -cargo_build_id +rust_nightly_date ( ) -[ -len -( -" -rust -- -" -) -: -] tgz_file ) @@ -2611,33 +2575,19 @@ ) : -self -. -set_use_stable_rust -( -False -) - rust_current_nightly = self . -rust_version +rust_nightly_date ( ) -self -. -set_use_stable_rust -( -True -) - rust_current_stable = self . -rust_version +rust_stable_version ( ) @@ -2717,9 +2667,7 @@ ' rust - -commit -- -hash +toolchain ' ' rust diff --git a/servo/python/servo/command_base.py b/servo/python/servo/command_base.py index 98e31799e3bb..8bf8b49e1090 100644 --- a/servo/python/servo/command_base.py +++ b/servo/python/servo/command_base.py @@ -2082,15 +2082,11 @@ = False -_rust_version +_rust_stable_version = None -_rust_version_is_stable -= -False - -_cargo_build_id +_rust_nightly_date = None @@ -2151,7 +2147,7 @@ " self . -cargo_build_id +rust_nightly_date ( ) ) @@ -2260,20 +2256,12 @@ _use_stable_rust def -rust_path +rust_install_dir ( self ) : -version -= -self -. -rust_version -( -) - if self . @@ -2281,32 +2269,13 @@ : return -os -. -path +self . -join +rust_stable_version ( -version -" -rustc -- -% -s -- -% -s -" -% -( -version -host_triple -( -) -) ) -if +elif not self . @@ -2325,40 +2294,94 @@ ] : -version +return +self +. +rust_nightly_date +( +) + -= " - alt " +else +: + return -os +self . -path +rust_nightly_date +( +) + +def +rust_path +( +self +) +: + +if +self . -join +_use_stable_rust +: + +version += +self +. +rust_stable_version ( +) + +else +: + version += +" +nightly +" + +subdir += " rustc - -nightly +% +s - % s " % ( +version host_triple ( ) ) + +return +os +. +path +. +join +( +self +. +rust_install_dir +( +) +subdir ) def -rust_version +rust_stable_version ( self ) @@ -2367,18 +2390,9 @@ if self . -_rust_version +_rust_stable_version is None -or -self -. -_use_stable_rust -! -= -self -. -_rust_version_is_stable : filename @@ -2387,12 +2401,6 @@ . join ( -self -. -context -. -topdir - " rust - @@ -2400,18 +2408,6 @@ - version " -if -self -. -_use_stable_rust -else -" -rust -- -commit -- -hash -" ) with @@ -2425,7 +2421,7 @@ self . -_rust_version +_rust_stable_version = f . @@ -2440,10 +2436,10 @@ return self . -_rust_version +_rust_stable_version def -cargo_build_id +rust_nightly_date ( self ) @@ -2452,7 +2448,7 @@ if self . -_cargo_build_id +_rust_nightly_date is None : @@ -2471,9 +2467,7 @@ " rust - -commit -- -hash +toolchain " ) @@ -2486,29 +2480,50 @@ f : -self +toolchain += +f . -_cargo_build_id +read +( +) +. +strip +( +) + +prefix = " -rust +nightly - " -+ -f + +assert +toolchain . -read +startswith ( +prefix ) + +self . -strip +_rust_nightly_date += +toolchain +[ +len ( +prefix ) +: +] return self . -_cargo_build_id +_rust_nightly_date def get_top_dir @@ -5038,7 +5053,7 @@ print ( " -looking +Looking for rustc at diff --git a/servo/python/servo/devenv_commands.py b/servo/python/servo/devenv_commands.py index ab020ca55b23..18194b343998 100644 --- a/servo/python/servo/devenv_commands.py +++ b/servo/python/servo/devenv_commands.py @@ -984,9 +984,6 @@ import toml -import -json - import httplib @@ -2112,113 +2109,13 @@ ' ) -CommandArgument -( -' -- -- -master -' - -action -= -' -store_true -' - -help -= -' -Use -the -latest -commit -of -the -" -master -" -branch -' -) - def rustup ( self -master -= -False ) : -if -master -: - -url -= -" -https -: -/ -/ -api -. -github -. -com -/ -repos -/ -rust -- -lang -/ -rust -/ -git -/ -refs -/ -heads -/ -master -" - -commit -= -json -. -load -( -urllib2 -. -urlopen -( -url -) -) -[ -" -object -" -] -[ -" -sha -" -] - -else -: - -import -toml - -import -re - url = " @@ -2241,112 +2138,24 @@ rust - nightly +- +date . -toml +txt " - -version + +nightly_date = -toml -. -load -( urllib2 . urlopen ( url ) -) -[ -" -pkg -" -] -[ -" -rustc -" -] -[ -" -version -" -] - -short_commit -= -re -. -search -( -" -\ -( -( -[ -0 -- -9a -- -f -] -+ -) -" -version -) -. -group -( -1 -) - -url -= -" -https -: -/ -/ -api -. -github . -com -/ -repos -/ -rust -- -lang -/ -rust -/ -commits -/ -" -+ -short_commit - -commit -= -json -. -load -( -urllib2 -. -urlopen +read ( -url -) ) -[ -" -sha -" -] filename = @@ -2362,9 +2171,7 @@ " rust - -commit -- -hash +toolchain " ) @@ -2384,17 +2191,21 @@ . write ( -commit -+ " +nightly +- +% +s \ n " +% +nightly_date ) self . -_rust_version +_rust_nightly_date = None @@ -2405,12 +2216,6 @@ False ) -self -. -_cargo_build_id -= -None - self . set_cargo_root diff --git a/servo/rust-commit-hash b/servo/rust-commit-hash deleted file mode 100644 index a08d23cd1a71..000000000000 --- a/servo/rust-commit-hash +++ /dev/null @@ -1 +0,0 @@ -13d94d5fa8129a34f5c77a1bcd76983f5aed2434 diff --git a/servo/rust-toolchain b/servo/rust-toolchain new file mode 100644 index 000000000000..3ff26df591da --- /dev/null +++ b/servo/rust-toolchain @@ -0,0 +1,7 @@ +nightly +- +2017 +- +08 +- +30