Skip to content

Commit 6c7fbd2

Browse files
author
Elly Fong-Jones
committed
[cargo] detect libs properly
The change to do build and test in different directories broke library detection.
1 parent 2a59ab8 commit 6c7fbd2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/cargo/cargo.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,8 @@ fn test_one_crate(_c: cargo, _path: str, cf: str, _p: pkg) {
367367
ret;
368368
}
369369
let new = fs::list_dir(buildpath);
370-
let exec_suffix = os::exec_suffix();
371370
for ct: str in new {
372-
if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) ||
373-
(exec_suffix == "" && !str::starts_with(ct, "./lib")) {
374-
run::run_program(ct, []);
375-
}
371+
run::run_program(ct, []);
376372
}
377373
}
378374

@@ -389,7 +385,8 @@ fn install_one_crate(c: cargo, _path: str, cf: str, _p: pkg) {
389385
let exec_suffix = os::exec_suffix();
390386
for ct: str in new {
391387
if (exec_suffix != "" && str::ends_with(ct, exec_suffix)) ||
392-
(exec_suffix == "" && !str::starts_with(ct, "./lib")) {
388+
(exec_suffix == "" && !str::starts_with(fs::basename(ct),
389+
"lib")) {
393390
#debug(" bin: %s", ct);
394391
// FIXME: need libstd fs::copy or something
395392
run::run_program("cp", [ct, c.bindir]);

0 commit comments

Comments
 (0)