File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -72,11 +72,11 @@ impl Sysroot {
72
72
/// Returns the path to Rust source, `$SRC`, where `$SRC/libstd/Carg.toml`
73
73
/// exists
74
74
pub fn src ( & self ) -> Result < Src > {
75
- let src = self . path ( ) . join ( "lib/ rustlib/ src" ) ;
75
+ let src = self . path ( ) . join ( "lib" ) . join ( " rustlib" ) . join ( " src") ;
76
76
77
- if src. join ( "rust/ src/ libstd/ Cargo.toml" ) . is_file ( ) {
77
+ if src. join ( "rust" ) . join ( " src" ) . join ( " libstd" ) . join ( " Cargo.toml") . is_file ( ) {
78
78
return Ok ( Src {
79
- path : src. join ( "rust/ src" ) ,
79
+ path : src. join ( "rust" ) . join ( " src") ,
80
80
} ) ;
81
81
}
82
82
Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ version = "0.0.0"
104
104
}
105
105
106
106
// rust-src comes with a lockfile for libstd. Use it.
107
- let lockfile = src. path ( ) . join ( ".." ) . join ( "Cargo.lock" ) ;
107
+ let src_parent = src. path ( ) . parent ( ) . map ( Path :: to_path_buf) . unwrap_or_else ( || src. path ( ) . join ( ".." ) ) ;
108
+ let lockfile = src_parent. join ( "Cargo.lock" ) ;
108
109
let target_lockfile = td. join ( "Cargo.lock" ) ;
109
110
fs:: copy ( lockfile, & target_lockfile) . chain_err ( || "Cargo.lock file is missing from source dir" ) ?;
110
111
@@ -117,7 +118,7 @@ version = "0.0.0"
117
118
118
119
util:: write ( & td. join ( "Cargo.toml" ) , & stoml) ?;
119
120
util:: mkdir ( & td. join ( "src" ) ) ?;
120
- util:: write ( & td. join ( "src/ lib.rs" ) , "" ) ?;
121
+ util:: write ( & td. join ( "src" ) . join ( " lib.rs") , "" ) ?;
121
122
122
123
let cargo = || {
123
124
let mut cmd = cargo:: command ( ) ;
@@ -337,13 +338,14 @@ pub fn update(
337
338
util:: cp_r (
338
339
& sysroot
339
340
. path ( )
340
- . join ( "lib/rustlib" )
341
+ . join ( "lib" )
342
+ . join ( "rustlib" )
341
343
. join ( & meta. host )
342
344
. join ( "lib" ) ,
343
345
& dst,
344
346
) ?;
345
347
346
- let bin_src = sysroot. path ( ) . join ( "lib/ rustlib" ) . join ( & meta. host ) . join ( "bin" ) ;
348
+ let bin_src = sysroot. path ( ) . join ( "lib" ) . join ( " rustlib") . join ( & meta. host ) . join ( "bin" ) ;
347
349
// copy the Rust linker if it exists
348
350
if bin_src. exists ( ) {
349
351
let bin_dst = lock. parent ( ) . join ( "bin" ) ;
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ impl Home {
58
58
}
59
59
60
60
fn path ( & self , triple : & str ) -> Filesystem {
61
- self . path . join ( "lib/ rustlib" ) . join ( triple)
61
+ self . path . join ( "lib" ) . join ( " rustlib") . join ( triple)
62
62
}
63
63
64
64
pub fn lock_ro ( & self , triple : & str ) -> Result < FileLock > {
You can’t perform that action at this time.
0 commit comments