Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade rustup used on AppVeyor #3996

Merged
merged 1 commit into from
May 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
47 changes: 19 additions & 28 deletions tests/cargotest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ extern crate url;
#[cfg(windows)] extern crate kernel32;
#[cfg(windows)] extern crate winapi;

use cargo::util::Rustc;
use std::ffi::OsStr;
use std::time::Duration;
use std::path::PathBuf;
use std::env;
use std::path::{Path, PathBuf};

use cargo::util::Rustc;
use cargo::util::paths;

pub mod support;
pub mod install;
Expand Down Expand Up @@ -69,31 +70,21 @@ 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 mut rustc = RUSTC.with(|r| r.process());
let output = rustc.arg("--print").arg("sysroot").exec_with_output().unwrap();
let libdir = String::from_utf8(output.stdout).unwrap();
let libdir = Path::new(libdir.trim());
let libdir = if cfg!(windows) {
libdir.join("bin")
} else {
libdir.join("lib")
};
let mut paths = paths::dylib_path();
println!("libdir: {:?}", libdir);
if !paths.contains(&libdir) {
paths.push(libdir);
p.env(paths::dylib_path_envvar(),
paths::join_paths(&paths, paths::dylib_path_envvar()).unwrap());
}
return p
}
Expand Down