diff --git a/Cargo.lock b/Cargo.lock
index 24f2dd548b..9e971d85da 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -84,11 +84,6 @@ name = "bitflags"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "bitflags"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "cfg-if"
version = "0.1.0"
@@ -108,38 +103,25 @@ dependencies = [
]
[[package]]
-name = "cookie"
-version = "0.2.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "core-foundation"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+name = "curl"
+version = "0.2.18"
+source = "git+https://github.com/alexcrichton/curl-rust?branch=rewrite#416a7d0c369b00c41753f0bac5889eaa46b82058"
dependencies = [
- "core-foundation-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl-sys 0.1.34 (git+https://github.com/alexcrichton/curl-rust?branch=rewrite)",
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
-name = "core-foundation-sys"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+name = "curl-sys"
+version = "0.1.34"
+source = "git+https://github.com/alexcrichton/curl-rust?branch=rewrite#416a7d0c369b00c41753f0bac5889eaa46b82058"
dependencies = [
+ "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "crypt32-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libz-sys 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "openssl-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -188,39 +170,6 @@ dependencies = [
"winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "hpack"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "httparse"
-version = "1.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "hyper"
-version = "0.9.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cookie 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "httparse 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "mime 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "num_cpus 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
- "solicit 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
- "time 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "idna"
version = "0.1.0"
@@ -263,21 +212,11 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "language-tags"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "lazy_static"
version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "lazy_static"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "libc"
version = "0.2.11"
@@ -292,9 +231,14 @@ dependencies = [
]
[[package]]
-name = "log"
-version = "0.3.6"
+name = "libz-sys"
+version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "pkg-config 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
+]
[[package]]
name = "markdown"
@@ -318,14 +262,6 @@ dependencies = [
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "mime"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "miniz-sys"
version = "0.1.7"
@@ -335,25 +271,6 @@ dependencies = [
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "native-tls"
-version = "0.1.0"
-source = "git+https://github.com/sfackler/rust-native-tls.git#a3d03b6ab5cee02313ff79a9e96a10b0c9b9e28a"
-dependencies = [
- "openssl 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-verify 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "schannel 0.0.2 (git+https://github.com/sfackler/schannel-rs)",
- "security-framework 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "num_cpus"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "ole32-sys"
version = "0.2.0"
@@ -363,19 +280,6 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "openssl"
-version = "0.7.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "bitflags 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys-extras 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "openssl-sys"
version = "0.7.11"
@@ -388,24 +292,6 @@ dependencies = [
"user32-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "openssl-sys-extras"
-version = "0.7.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "gcc 0.3.28 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "openssl-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "openssl-verify"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "openssl 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "pipeline"
version = "0.5.0"
@@ -454,14 +340,6 @@ name = "rustc-serialize"
version = "0.3.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "rustc_version"
-version = "0.1.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "rustup-dist"
version = "0.1.10"
@@ -505,11 +383,10 @@ name = "rustup-utils"
version = "0.1.10"
dependencies = [
"advapi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
+ "curl 0.2.18 (git+https://github.com/alexcrichton/curl-rust?branch=rewrite)",
"error-chain 0.1.10",
- "hyper 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "native-tls 0.1.0 (git+https://github.com/sfackler/rust-native-tls.git)",
"ole32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.7.11 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -517,62 +394,17 @@ dependencies = [
"scopeguard 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"sha2 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"shell32-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "url 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"userenv-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"winreg 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "schannel"
-version = "0.0.2"
-source = "git+https://github.com/sfackler/schannel-rs#d16f7949939777375bae9716f098145b151c28e5"
-dependencies = [
- "crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
- "secur32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "scopeguard"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-[[package]]
-name = "secur32-sys"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "winapi 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "security-framework"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "core-foundation 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "core-foundation-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "security-framework-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "security-framework-sys"
-version = "0.1.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "core-foundation-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
-name = "semver"
-version = "0.1.20"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
[[package]]
name = "sha2"
version = "0.1.2"
@@ -590,15 +422,6 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "solicit"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "hpack 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "strsim"
version = "0.4.1"
@@ -665,24 +488,6 @@ dependencies = [
"rustc-serialize 0.3.19 (registry+https://github.com/rust-lang/crates.io-index)",
]
-[[package]]
-name = "traitobject"
-version = "0.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "typeable"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "unicase"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
[[package]]
name = "unicode-bidi"
version = "0.2.3"
diff --git a/appveyor.yml b/appveyor.yml
index 154087f3be..4407d96d0f 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,11 +1,13 @@
environment:
matrix:
- - TARGET: x86_64-pc-windows-msvc
- - TARGET: i686-pc-windows-msvc
- - TARGET: x86_64-pc-windows-gnu
- BITS: 64
- TARGET: i686-pc-windows-gnu
- BITS: 32
+ MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/dwarf/i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z/download
+ MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z
+ MINGW_DIR: mingw32
+ - TARGET: x86_64-pc-windows-gnu
+ MSYS_BITS: 64
+ - TARGET: i686-pc-windows-msvc
+ - TARGET: x86_64-pc-windows-msvc
access_token:
secure: q8Wqx0brgfpOYFQqWauvucE2h0o1WYb41a3gKaCKV9QiE4eTz6qLNlqyC3mdsp4Q
branches:
@@ -15,27 +17,35 @@ branches:
- auto
install:
- - ps: |
- # Install Rust
- Start-FileDownload "https://static.rust-lang.org/dist/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"
+ # Install rust, x86_64-pc-windows-msvc host
+ - curl -sSf -o rustup-init.exe https://win.rustup.rs/
+ - rustup-init.exe -y
+ - set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
+ - rustup default nightly-x86_64-pc-windows-msvc
+
+ # Install the target we're compiling for
+ - if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET%
+
+ # Use the system msys if we can
+ - if defined MSYS_BITS set PATH=C:\msys64\mingw%MSYS_BITS%\bin;C:\msys64\usr\bin;%PATH%
- # For -gnu builds
- if ($env:TARGET -match "-gnu$") {
- $env:PATH="$env:PATH;C:\msys64\mingw${env:BITS}\bin"
- }
+ # download a custom compiler otherwise
+ - if defined MINGW_ARCHIVE appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%"
+ - if defined MINGW_ARCHIVE 7z x -y "%MINGW_ARCHIVE%" > nul
+ - if defined MINGW_ARCHIVE set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
- # Print version info
- rustc -vV
- cargo -vV
+ # let's see what we got
+ - where gcc rustc cargo
+ - rustc -vV
+ - cargo -vV
+ - set CARGO_TARGET_DIR=%CD%\target
build: false
test_script:
- - cargo build --release
- - cargo test --release -p rustup-dist
- - cargo test --release
+ - cargo build --release --target %TARGET%
+ - cargo test --release -p rustup-dist --target %TARGET%
+ - cargo test --release --target %TARGET%
notifications:
- provider: Webhook
diff --git a/ci/prepare-deploy-appveyor.ps1 b/ci/prepare-deploy-appveyor.ps1
index 5df8d6c323..743fbb3760 100644
--- a/ci/prepare-deploy-appveyor.ps1
+++ b/ci/prepare-deploy-appveyor.ps1
@@ -7,17 +7,17 @@ if ($env:APPVEYOR_REPO_BRANCH -eq "auto") {
}
# Copy rustup-init to rustup-setup for backwards compatibility
-cp target\release\rustup-init.exe target\release\rustup-setup.exe
+cp target\${env:TARGET}\release\rustup-init.exe target\${env:TARGET}release\rustup-setup.exe
# Generate hashes
-Get-FileHash .\target\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
+Get-FileHash .\target\${env:TARGET}\release\* | ForEach-Object {[io.file]::WriteAllText($_.Path + ".sha256", $_.Hash.ToLower() + "`n")}
# Prepare bins for upload
$dest = "dist\$env:TARGET"
md -Force "$dest"
-cp target\release\rustup-init.exe "$dest/"
-cp target\release\rustup-init.exe.sha256 "$dest/"
-cp target\release\rustup-setup.exe "$dest/"
-cp target\release\rustup-setup.exe.sha256 "$dest/"
+cp target\${env:TARGET}\release\rustup-init.exe "$dest/"
+cp target\${env:TARGET}\release\rustup-init.exe.sha256 "$dest/"
+cp target\${env:TARGET}\release\rustup-setup.exe "$dest/"
+cp target\${env:TARGET}\release\rustup-setup.exe.sha256 "$dest/"
ls "$dest"
diff --git a/src/rustup-cli/common.rs b/src/rustup-cli/common.rs
index 9bd92fbc1e..8c0428b8bc 100644
--- a/src/rustup-cli/common.rs
+++ b/src/rustup-cli/common.rs
@@ -6,7 +6,7 @@ use errors::*;
use rustup_utils::utils;
use rustup_utils::notify::NotificationLevel;
use self_update;
-use std::io::{Write, Read, BufRead};
+use std::io::{Write, BufRead};
use std::process::Command;
use std::{cmp, iter};
use std::str::FromStr;
diff --git a/src/rustup-cli/self_update.rs b/src/rustup-cli/self_update.rs
index f071bc295a..fd40cc649e 100644
--- a/src/rustup-cli/self_update.rs
+++ b/src/rustup-cli/self_update.rs
@@ -31,7 +31,6 @@
//! and racy on Windows.
use common::{self, Confirm};
-use itertools::Itertools;
use rustup::{NotifyHandler};
use errors::*;
use rustup_dist::dist;
@@ -1069,7 +1068,7 @@ pub fn prepare_update() -> Result