Give tempfiles the file extensions Zig expects

This commit is contained in:
Richard Feldman 2022-11-22 19:19:44 -05:00
parent 16fd39c4f7
commit 9c1291d57d
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
5 changed files with 54 additions and 13 deletions

View file

@ -23,7 +23,12 @@ fn main() {
pre_linked_binary_path.extend(["pre_linked_binary"]);
pre_linked_binary_path.set_extension("o");
let builtins_host_file = tempfile::NamedTempFile::new().unwrap();
let builtins_host_file = tempfile::Builder::new()
.prefix("host_bitcode")
.suffix(".wasm")
.rand_bytes(5)
.tempfile()
.unwrap();
std::fs::write(builtins_host_file.path(), bitcode::HOST_WASM)
.expect("failed to write host builtins object to tempfile");