Centralize host tempfile builder logic

This commit is contained in:
Richard Feldman 2022-11-22 20:38:59 -05:00
parent 0b73ea69af
commit a8b6fa051a
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
7 changed files with 95 additions and 117 deletions

View file

@ -193,14 +193,8 @@ pub fn helper(
.expect("failed to build output object");
std::fs::write(&app_o_file, module_out).expect("failed to write object to file");
let builtins_host_tempfile = tempfile::Builder::new()
.prefix("host_bitcode")
.suffix(".o")
.rand_bytes(5)
.tempfile()
.unwrap();
std::fs::write(builtins_host_tempfile.path(), bitcode::HOST_UNIX)
.expect("failed to write host builtins object to tempfile");
let builtins_host_tempfile =
bitcode::host_unix_tempfile().expect("failed to write host builtins object to tempfile");
let (mut child, dylib_path) = link(
&target,