mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 14:54:47 +00:00
Handle multiple find
results in wasi libc build
This commit is contained in:
parent
c90fc98524
commit
262b2fd24e
1 changed files with 7 additions and 8 deletions
|
@ -32,15 +32,14 @@ fn main() {
|
||||||
);
|
);
|
||||||
|
|
||||||
// Find the libc.a and compiler_rt.o files that Zig wrote (as a side-effect of compiling the dummy program)
|
// Find the libc.a and compiler_rt.o files that Zig wrote (as a side-effect of compiling the dummy program)
|
||||||
let find_libc_output = run_command(Path::new("."), "find", [&zig_cache_dir, "-name", "libc.a"]);
|
let cwd = std::env::current_dir().unwrap();
|
||||||
let zig_libc_path = find_libc_output.trim(); // get rid of a newline
|
let find_libc_output = run_command(&cwd, "find", [&zig_cache_dir, "-name", "libc.a"]);
|
||||||
|
// If `find` printed multiple results, take the first.
|
||||||
|
let zig_libc_path = find_libc_output.split("\n").next().unwrap();
|
||||||
|
|
||||||
let find_crt_output = run_command(
|
let find_crt_output = run_command(&cwd, "find", [&zig_cache_dir, "-name", "compiler_rt.o"]);
|
||||||
Path::new("."),
|
// If `find` printed multiple results, take the first.
|
||||||
"find",
|
let zig_crt_path = find_crt_output.split("\n").next().unwrap();
|
||||||
[&zig_cache_dir, "-name", "compiler_rt.o"],
|
|
||||||
);
|
|
||||||
let zig_crt_path = find_crt_output.trim(); // get rid of a newline
|
|
||||||
|
|
||||||
// Copy libc to where Cargo expects the output of this crate
|
// Copy libc to where Cargo expects the output of this crate
|
||||||
fs::copy(&zig_libc_path, &out_file).unwrap();
|
fs::copy(&zig_libc_path, &out_file).unwrap();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue