Skip to content

Commit 0088a44

Browse files
committed
---
yaml --- r: 110586 b: refs/heads/master c: 3f2c55f h: refs/heads/master v: v3
1 parent df7c6f2 commit 0088a44

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 25a6b6ef8b4a2852c98585496146ca9d3da37b1b
2+
refs/heads/master: 3f2c55f7d5b5c7717dd12eef4572c52a4e8ff550
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: e263ef1df7b892ed29e53313565eb05ab75e52f4
55
refs/heads/try: 597a645456b55e1c886ce15d23a192abdf4d55cf

trunk/src/librustc/back/rpath.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
use driver::session::Session;
1313
use metadata::cstore;
1414
use metadata::filesearch;
15+
use util::fs;
1516

1617
use collections::HashSet;
17-
use std::{os, slice};
18+
use std::os;
1819
use syntax::abi;
1920

2021
fn not_win32(os: abi::Os) -> bool {
@@ -121,9 +122,9 @@ pub fn get_rpath_relative_to_output(os: abi::Os,
121122
abi::OsWin32 => unreachable!()
122123
};
123124

124-
let mut lib = os::make_absolute(lib);
125+
let mut lib = fs::realpath(&os::make_absolute(lib)).unwrap();
125126
lib.pop();
126-
let mut output = os::make_absolute(output);
127+
let mut output = fs::realpath(&os::make_absolute(output)).unwrap();
127128
output.pop();
128129
let relative = lib.path_relative_from(&output);
129130
let relative = relative.expect("could not create rpath relative to output");

trunk/src/librustc/metadata/filesearch.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ use std::os;
1515
use std::io::fs;
1616
use collections::HashSet;
1717

18+
use myfs = util::fs;
19+
1820
pub enum FileMatch { FileMatches, FileDoesntMatch }
1921

2022
// A module for searching for libraries
@@ -156,17 +158,10 @@ fn make_rustpkg_target_lib_path(sysroot: &Path,
156158
pub fn get_or_default_sysroot() -> Path {
157159
// Follow symlinks. If the resolved path is relative, make it absolute.
158160
fn canonicalize(path: Option<Path>) -> Option<Path> {
159-
path.and_then(|mut path|
160-
match fs::readlink(&path) {
161-
Ok(canon) => {
162-
if canon.is_absolute() {
163-
Some(canon)
164-
} else {
165-
path.pop();
166-
Some(path.join(canon))
167-
}
168-
},
169-
Err(..) => Some(path),
161+
path.and_then(|path|
162+
match myfs::realpath(&path) {
163+
Ok(canon) => Some(canon),
164+
Err(e) => fail!("failed to get realpath: {}", e),
170165
})
171166
}
172167

0 commit comments

Comments
 (0)