Skip to content

Commit bf23bd6

Browse files
committed
---
yaml --- r: 150715 b: refs/heads/try2 c: 3f2c55f h: refs/heads/master i: 150713: 6247f57 150711: fe3d739 v: v3
1 parent 05fa0b4 commit bf23bd6

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 25a6b6ef8b4a2852c98585496146ca9d3da37b1b
8+
refs/heads/try2: 3f2c55f7d5b5c7717dd12eef4572c52a4e8ff550
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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");

branches/try2/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)