File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 25a6b6ef8b4a2852c98585496146ca9d3da37b1b
2
+ refs/heads/master: 3f2c55f7d5b5c7717dd12eef4572c52a4e8ff550
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: e263ef1df7b892ed29e53313565eb05ab75e52f4
5
5
refs/heads/try: 597a645456b55e1c886ce15d23a192abdf4d55cf
Original file line number Diff line number Diff line change 12
12
use driver:: session:: Session ;
13
13
use metadata:: cstore;
14
14
use metadata:: filesearch;
15
+ use util:: fs;
15
16
16
17
use collections:: HashSet ;
17
- use std:: { os , slice } ;
18
+ use std:: os ;
18
19
use syntax:: abi;
19
20
20
21
fn not_win32 ( os : abi:: Os ) -> bool {
@@ -121,9 +122,9 @@ pub fn get_rpath_relative_to_output(os: abi::Os,
121
122
abi:: OsWin32 => unreachable ! ( )
122
123
} ;
123
124
124
- let mut lib = os:: make_absolute ( lib) ;
125
+ let mut lib = fs :: realpath ( & os:: make_absolute ( lib) ) . unwrap ( ) ;
125
126
lib. pop ( ) ;
126
- let mut output = os:: make_absolute ( output) ;
127
+ let mut output = fs :: realpath ( & os:: make_absolute ( output) ) . unwrap ( ) ;
127
128
output. pop ( ) ;
128
129
let relative = lib. path_relative_from ( & output) ;
129
130
let relative = relative. expect ( "could not create rpath relative to output" ) ;
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ use std::os;
15
15
use std:: io:: fs;
16
16
use collections:: HashSet ;
17
17
18
+ use myfs = util:: fs;
19
+
18
20
pub enum FileMatch { FileMatches , FileDoesntMatch }
19
21
20
22
// A module for searching for libraries
@@ -156,17 +158,10 @@ fn make_rustpkg_target_lib_path(sysroot: &Path,
156
158
pub fn get_or_default_sysroot ( ) -> Path {
157
159
// Follow symlinks. If the resolved path is relative, make it absolute.
158
160
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) ,
170
165
} )
171
166
}
172
167
You can’t perform that action at this time.
0 commit comments