compiletest: fallback to the original path if it's not a symlink
This commit is contained in:
parent
8075ddb98e
commit
61ef9838df
@ -1146,11 +1146,9 @@ fn expand_variables(mut value: String, config: &Config) -> String {
|
||||
}
|
||||
|
||||
if value.contains(RUST_SRC_BASE) {
|
||||
let src_base = config
|
||||
.sysroot_base
|
||||
.join("lib/rustlib/src/rust")
|
||||
.read_link()
|
||||
.expect("lib/rustlib/src/rust in target is a symlink to checkout root");
|
||||
let src_base = config.sysroot_base.join("lib/rustlib/src/rust");
|
||||
src_base.try_exists().expect(&*format!("{} should exists", src_base.display()));
|
||||
let src_base = src_base.read_link().unwrap_or(src_base);
|
||||
value = value.replace(RUST_SRC_BASE, &src_base.to_string_lossy());
|
||||
}
|
||||
|
||||
|
@ -2311,12 +2311,9 @@ impl<'test> TestCx<'test> {
|
||||
normalize_path(parent_build_dir, "$BUILD_DIR");
|
||||
|
||||
// Real paths into the libstd/libcore
|
||||
let rust_src_dir = &self
|
||||
.config
|
||||
.sysroot_base
|
||||
.join("lib/rustlib/src/rust")
|
||||
.read_link()
|
||||
.expect("lib/rustlib/src/rust in target is a symlink to checkout root");
|
||||
let rust_src_dir = &self.config.sysroot_base.join("lib/rustlib/src/rust");
|
||||
rust_src_dir.try_exists().expect(&*format!("{} should exists", rust_src_dir.display()));
|
||||
let rust_src_dir = rust_src_dir.read_link().unwrap_or(rust_src_dir.to_path_buf());
|
||||
normalize_path(&rust_src_dir.join("library"), "$SRC_DIR_REAL");
|
||||
|
||||
if json {
|
||||
|
Loading…
x
Reference in New Issue
Block a user