Use include_bytes! so builtin hosts live in binary

This commit is contained in:
Richard Feldman 2022-11-21 22:30:34 -05:00
parent a90d9d465d
commit e97a5fe7f6
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
11 changed files with 72 additions and 65 deletions

View file

@ -13,9 +13,10 @@ crate-type = ["cdylib"]
roc_builtins = {path = "../compiler/builtins"}
roc_utils = {path = "../utils"}
wasi_libc_sys = { path = "../wasi-libc-sys" }
tempfile.workspace = true
[dependencies]
bumpalo.workspace = true
bumpalo.workspace = true
console_error_panic_hook = {version = "0.1.7", optional = true}
futures = {version = "0.3.24", optional = true}
js-sys = "0.3.60"

View file

@ -23,10 +23,14 @@ 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();
std::fs::write(builtins_host_file.path(), bitcode::HOST_WASM)
.expect("failed to write host builtins object to tempfile");
let output = Command::new(&zig_executable())
.args([
"wasm-ld",
&bitcode::get_builtins_wasm32_obj_path(),
builtins_host_file.path().to_str().unwrap(),
platform_obj.to_str().unwrap(),
WASI_COMPILER_RT_PATH,
WASI_LIBC_PATH,