Change libaux directory to fix aux crate tests on Windows#7979
Change libaux directory to fix aux crate tests on Windows#7979crnobog wants to merge 1 commit intorust-lang:masterfrom
Conversation
|
Hey @crnobog, these fixes look like they might be caused by some bug in |
|
I think with_filetype is working as documented and just shouldn't be used in constructing these paths in compiletest. The way with_filetype is commented Path("something").with_filetype("foo").with_filetype("bar") should produce "something.bar". The offending functions causing the problem here are below: fn output_base_name(config: &config, testfile: &Path) -> Path {
config.build_base
.push_rel(&output_testname(testfile))
.with_filetype(config.stage_id)
}
fn aux_output_dir_name(config: &config, testfile: &Path) -> Path {
output_base_name(config, testfile).with_filetype("libaux")
}
fn make_exe_name(config: &config, testfile: &Path) -> Path {
Path(output_base_name(config, testfile).to_str() + os::EXE_SUFFIX)
}
#[cfg(target_os = "win32")]
fn target_env(lib_path: &str, prog: &str) -> ~[(~str,~str)] {
let mut env = os::env();
// Make sure we include the aux directory in the path
assert!(prog.ends_with(".exe"));
let aux_path = prog.slice(0u, prog.len() - 4u).to_owned() + ".libaux";
env = do env.map() |pair| {
let (k,v) = (*pair).clone();
if k == ~"PATH" { (~"PATH", v + ";" + lib_path + ";" + aux_path) }
else { (k,v) }
};
if prog.ends_with("rustc.exe") {
env.push((~"RUST_THREADS", ~"1"));
}
return env;
}make_exe_name will produce something like test.stage2-i686-mingw.exe on my machine, output_base_name being test.state2-i686-mingw, and aux_output_dir_name being test.libaux. But then the window procsrv runner will try to add test.stage2-i686-mingw to the PATH because it extracts it from the exe name. This fix seemed the simplest way of getting uniform behaviour across platforms. |
No description provided.