Skip to content

Commit 2e63bc5

Browse files
committed
cargo: Use $sysroot/$libdir/cargo as work dir
On win32 environment, it's "$sysroot/bin/cargo". On unix-y environment, it's "$sysroot/lib/cargo".
1 parent 657ef8e commit 2e63bc5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/comp/util/filesearch.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ fn mk_filesearch(maybe_sysroot: option<fs::path>,
4848
result::ok(p) { [p] }
4949
result::err(p) { [] }
5050
}
51-
+ [fs::connect(fs::connect(self.sysroot, ".cargo"),
52-
libdir())]
5351
}
5452
fn get_target_lib_path() -> fs::path {
5553
make_target_lib_path(self.sysroot, self.target_triple)
@@ -113,7 +111,9 @@ fn get_sysroot(maybe_sysroot: option<fs::path>) -> fs::path {
113111
}
114112

115113
fn get_cargo_sysroot() -> result::t<fs::path, str> {
116-
result::ok(fs::connect(get_default_sysroot(), ".cargo"))
114+
let path = [get_default_sysroot(), libdir(), "cargo"];
115+
check vec::is_not_empty(path);
116+
result::ok(fs::connect_many(path))
117117
}
118118

119119
fn get_cargo_root() -> result::t<fs::path, str> {

0 commit comments

Comments
 (0)