Skip to content

Commit

Permalink
Auto merge of #3996 - alexcrichton:rustup-up, r=alexcrichton
Browse files Browse the repository at this point in the history
Upgrade rustup used on AppVeyor
  • Loading branch information
bors committed May 5, 2017
2 parents bc6fda5 + 4ff9b5e commit f1ea4e7
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 27 deletions.
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ install:
- if defined MINGW_URL 7z x -y %MINGW_ARCHIVE% > nul
- if defined MINGW_URL set PATH=%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH%

# FIXME(#3394) use master rustup
- curl -sSfO https://static.rust-lang.org/rustup/archive/0.6.5/x86_64-pc-windows-msvc/rustup-init.exe
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly-2017-03-03
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
- if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET%
Expand Down
48 changes: 23 additions & 25 deletions tests/cargotest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,29 @@ fn _process(t: &OsStr) -> cargo::util::ProcessBuilder {

// We'll need dynamic libraries at some point in this test suite, so ensure
// that the rustc libdir is somewhere in LD_LIBRARY_PATH as appropriate.
// Note that this isn't needed on Windows as we assume the bindir (with
// dlls) is in PATH.
if cfg!(unix) {
let var = if cfg!(target_os = "macos") {
"DYLD_LIBRARY_PATH"
} else {
"LD_LIBRARY_PATH"
};
let rustc = RUSTC.with(|r| r.path.clone());
let path = env::var_os("PATH").unwrap_or(Default::default());
let rustc = env::split_paths(&path)
.map(|p| p.join(&rustc))
.find(|p| p.exists())
.unwrap();
let mut libdir = rustc.clone();
libdir.pop();
libdir.pop();
libdir.push("lib");
let prev = env::var_os(&var).unwrap_or(Default::default());
let mut paths = env::split_paths(&prev).collect::<Vec<_>>();
println!("libdir: {:?}", libdir);
if !paths.contains(&libdir) {
paths.push(libdir);
p.env(var, env::join_paths(&paths).unwrap());
}
let var = if cfg!(target_os = "macos") {
"DYLD_LIBRARY_PATH"
} else if cfg!(windows) {
"PATH"
} else {
"LD_LIBRARY_PATH"
};
let rustc = RUSTC.with(|r| r.path.clone());
let path = env::var_os("PATH").unwrap_or(Default::default());
let rustc = env::split_paths(&path)
.map(|p| p.join(&rustc))
.find(|p| p.exists())
.unwrap();
let mut libdir = rustc.clone();
libdir.pop();
libdir.pop();
libdir.push("lib");
let prev = env::var_os(&var).unwrap_or(Default::default());
let mut paths = env::split_paths(&prev).collect::<Vec<_>>();
println!("libdir: {:?}", libdir);
if !paths.contains(&libdir) {
paths.push(libdir);
p.env(var, env::join_paths(&paths).unwrap());
}
return p
}
Expand Down

0 comments on commit f1ea4e7

Please sign in to comment.