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

@ -100,7 +100,12 @@ fn build_wasm_test_host() {
let mut outfile = PathBuf::from(&out_dir).join(PLATFORM_FILENAME);
outfile.set_extension("wasm");
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");