File tree Expand file tree Collapse file tree 3 files changed +11
-15
lines changed
branches/try2/src/librustc Expand file tree Collapse file tree 3 files changed +11
-15
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 25a6b6ef8b4a2852c98585496146ca9d3da37b1b
8
+ refs/heads/try2: 3f2c55f7d5b5c7717dd12eef4572c52a4e8ff550
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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