diff --git a/.travis.yml b/.travis.yml index a4e1e21604..d727d90613 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,8 @@ install: # Download nightly rust - mkdir -p ~/rust - echo -e "\033[33;1mDownloading Rust\033[0m" - - curl -sL http://static.rust-lang.org/dist/rust-nightly-$TARGET.tar.gz | tar --strip-components=1 -C ~/rust -xzf - + # FIXME: Pinned nightly for rust-lang/rust#32247 + - curl -sL http://static.rust-lang.org/dist/2016-03-11/rust-nightly-$TARGET.tar.gz | tar --strip-components=1 -C ~/rust -xzf - # For linux, install required packages - if [ "$TRAVIS_OS_NAME" == "linux" ]; then if [ "$BITS" == "32" ]; then diff --git a/appveyor.yml b/appveyor.yml index ec8ebb148e..82b7ee8e4d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,8 @@ branches: install: - ps: | # Install Rust - Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe" -FileName "rust-nightly.exe" + # FIXME: Pinned nightly for rust-lang/rust#32247 + Start-FileDownload "https://static.rust-lang.org/dist/2016-03-11/rust-nightly-${env:TARGET}.exe" -FileName "rust-nightly.exe" .\rust-nightly.exe /VERYSILENT /NORESTART /DIR="C:\rust" | Out-Null $env:PATH="$env:PATH;C:\rust\bin" diff --git a/src/multirust-dist/src/dist.rs b/src/multirust-dist/src/dist.rs index 2c0e3b3efd..2391a2c4a6 100644 --- a/src/multirust-dist/src/dist.rs +++ b/src/multirust-dist/src/dist.rs @@ -272,35 +272,25 @@ pub fn update_from_dist<'a>(download: DownloadCfg<'a>, remove_extensions: remove.to_owned(), }; - // Until the v2 dist manifests are actually deployed live they are - // not on by default. Putting this env var in Cfg an snaking it - // all the way down here didn't seem worth the effort since this - // should be short-lived. - let enable_experimental = ::std::env::var("MULTIRUST_ENABLE_EXPERIMENTAL").is_ok(); - let already_using_v2 = try!(manifestation.read_config()).is_some(); - let can_dl_v2_manifest = enable_experimental || already_using_v2; - // TODO: Add a notification about which manifest version is going to be used download.notify_handler.call(Notification::DownloadingManifest); - if can_dl_v2_manifest { - match dl_v2_manifest(download, update_hash, toolchain) { - Ok(Some((m, hash))) => { - return match try!(manifestation.update(&m, changes, &download.temp_cfg, - download.notify_handler.clone())) { - UpdateStatus::Unchanged => Ok(None), - UpdateStatus::Changed => Ok(Some(hash)), - } + match dl_v2_manifest(download, update_hash, toolchain) { + Ok(Some((m, hash))) => { + return match try!(manifestation.update(&m, changes, &download.temp_cfg, + download.notify_handler.clone())) { + UpdateStatus::Unchanged => Ok(None), + UpdateStatus::Changed => Ok(Some(hash)), } - Ok(None) => return Ok(None), - Err(Error::Utils(::multirust_utils::errors::Error::DownloadingFile { - error: ::multirust_utils::raw::DownloadError::Status(hyper::status::StatusCode::NotFound), - .. - })) => { - // Proceed to try v1 as a fallback - download.notify_handler.call(Notification::DownloadingLegacyManifest); - } - Err(e) => return Err(e) } + Ok(None) => return Ok(None), + Err(Error::Utils(::multirust_utils::errors::Error::DownloadingFile { + error: ::multirust_utils::raw::DownloadError::Status(hyper::status::StatusCode::NotFound), + .. + })) => { + // Proceed to try v1 as a fallback + download.notify_handler.call(Notification::DownloadingLegacyManifest); + } + Err(e) => return Err(e) } // If the v2 manifest is not found then try v1 diff --git a/src/multirust-mock/src/clitools.rs b/src/multirust-mock/src/clitools.rs index 458724c4e2..9fe256a86e 100644 --- a/src/multirust-mock/src/clitools.rs +++ b/src/multirust-mock/src/clitools.rs @@ -167,7 +167,6 @@ pub fn cmd(config: &Config, name: &str, args: &[&str]) -> Command { cmd.args(args); cmd.env("MULTIRUST_HOME", config.homedir.path().to_string_lossy().to_string()); cmd.env("MULTIRUST_DIST_ROOT", format!("file://{}", config.distdir.path().join("dist").to_string_lossy())); - cmd.env("MULTIRUST_ENABLE_EXPERIMENTAL", "1"); cmd } diff --git a/tests/cli-v2.rs b/tests/cli-v2.rs index 50bd0819a3..558d965f0d 100644 --- a/tests/cli-v2.rs +++ b/tests/cli-v2.rs @@ -12,7 +12,7 @@ use multirust_mock::clitools::{self, Config, Scenario, this_host_triple, expect_ok, expect_stdout_ok, expect_err, expect_stderr_ok, set_current_dist_date, - change_dir, run, cmd}; + change_dir, run}; pub fn setup(f: &Fn(&Config)) { clitools::setup(Scenario::SimpleV2, f); @@ -504,19 +504,6 @@ fn upgrade_v2_to_v1() { }); } -// v2 manifests only work with MULTIRUST_ENABLE_EXPERIMENTAL -#[test] -fn enable_experimental() { - setup(&|config| { - let mut cmd = cmd(config, "multirust", &["update", "nightly"]); - cmd.env_remove("MULTIRUST_ENABLE_EXPERIMENTAL"); - let out = cmd.output().unwrap(); - assert!(!out.status.success()); - let stderr = String::from_utf8(out.stderr).unwrap(); - assert!(stderr.contains("could not download file")); - }); -} - #[test] fn list_targets_no_toolchain() { setup(&|config| {