Skip to content

Commit f1ea4e7

Browse files
committed
Auto merge of #3996 - alexcrichton:rustup-up, r=alexcrichton
Upgrade rustup used on AppVeyor
2 parents bc6fda5 + 4ff9b5e commit f1ea4e7

File tree

2 files changed

+24
-27
lines changed

2 files changed

+24
-27
lines changed

appveyor.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ install:
2828
- if defined MINGW_URL 7z x -y %MINGW_ARCHIVE% > nul
2929
- if defined MINGW_URL set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%
3030

31-
# FIXME(#3394) use master rustup
32-
- curl -sSfO https://static.rust-lang.org/rustup/archive/0.6.5/x86_64-pc-windows-msvc/rustup-init.exe
31+
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
3332
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly-2017-03-03
3433
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
3534
- if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET%

tests/cargotest/lib.rs

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -69,31 +69,29 @@ fn _process(t: &OsStr) -> cargo::util::ProcessBuilder {
6969

7070
// We'll need dynamic libraries at some point in this test suite, so ensure
7171
// that the rustc libdir is somewhere in LD_LIBRARY_PATH as appropriate.
72-
// Note that this isn't needed on Windows as we assume the bindir (with
73-
// dlls) is in PATH.
74-
if cfg!(unix) {
75-
let var = if cfg!(target_os = "macos") {
76-
"DYLD_LIBRARY_PATH"
77-
} else {
78-
"LD_LIBRARY_PATH"
79-
};
80-
let rustc = RUSTC.with(|r| r.path.clone());
81-
let path = env::var_os("PATH").unwrap_or(Default::default());
82-
let rustc = env::split_paths(&path)
83-
.map(|p| p.join(&rustc))
84-
.find(|p| p.exists())
85-
.unwrap();
86-
let mut libdir = rustc.clone();
87-
libdir.pop();
88-
libdir.pop();
89-
libdir.push("lib");
90-
let prev = env::var_os(&var).unwrap_or(Default::default());
91-
let mut paths = env::split_paths(&prev).collect::<Vec<_>>();
92-
println!("libdir: {:?}", libdir);
93-
if !paths.contains(&libdir) {
94-
paths.push(libdir);
95-
p.env(var, env::join_paths(&paths).unwrap());
96-
}
72+
let var = if cfg!(target_os = "macos") {
73+
"DYLD_LIBRARY_PATH"
74+
} else if cfg!(windows) {
75+
"PATH"
76+
} else {
77+
"LD_LIBRARY_PATH"
78+
};
79+
let rustc = RUSTC.with(|r| r.path.clone());
80+
let path = env::var_os("PATH").unwrap_or(Default::default());
81+
let rustc = env::split_paths(&path)
82+
.map(|p| p.join(&rustc))
83+
.find(|p| p.exists())
84+
.unwrap();
85+
let mut libdir = rustc.clone();
86+
libdir.pop();
87+
libdir.pop();
88+
libdir.push("lib");
89+
let prev = env::var_os(&var).unwrap_or(Default::default());
90+
let mut paths = env::split_paths(&prev).collect::<Vec<_>>();
91+
println!("libdir: {:?}", libdir);
92+
if !paths.contains(&libdir) {
93+
paths.push(libdir);
94+
p.env(var, env::join_paths(&paths).unwrap());
9795
}
9896
return p
9997
}

0 commit comments

Comments
 (0)