File tree Expand file tree Collapse file tree 2 files changed +19
-3
lines changed
branches/dist-snap/src/librustc/metadata Expand file tree Collapse file tree 2 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ refs/heads/try: f64fdf524a434f0e5cd0bc91d09c144723f3c90d
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
8
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9
- refs/heads/dist-snap: cdd146b8954d704a07a4445f00ef8ed0f65da096
9
+ refs/heads/dist-snap: 8cce35e490ce259244656e12d272ab1915b0541b
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
12
12
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
Original file line number Diff line number Diff line change @@ -160,8 +160,24 @@ fn make_rustpkg_target_lib_path(dir: &Path,
160
160
}
161
161
162
162
pub fn get_or_default_sysroot ( ) -> Path {
163
- match os:: self_exe_path ( ) {
164
- option:: Some ( p) => { let mut p = p; p. pop ( ) ; p }
163
+ // Follow symlinks. If the resolved path is relative, make it absolute.
164
+ fn canonicalize ( path : Option < Path > ) -> Option < Path > {
165
+ path. and_then ( |mut path|
166
+ match io:: io_error:: cond. trap ( |_| ( ) ) . inside ( || fs:: readlink ( & path) ) {
167
+ Some ( canon) => {
168
+ if canon. is_absolute ( ) {
169
+ Some ( canon)
170
+ } else {
171
+ path. pop ( ) ;
172
+ Some ( path. join ( canon) )
173
+ }
174
+ } ,
175
+ None => Some ( path) ,
176
+ } )
177
+ }
178
+
179
+ match canonicalize ( os:: self_exe_name ( ) ) {
180
+ option:: Some ( p) => { let mut p = p; p. pop ( ) ; p. pop ( ) ; p }
165
181
option:: None => fail ! ( "can't determine value for sysroot" )
166
182
}
167
183
}
You can’t perform that action at this time.
0 commit comments