Skip to content

Commit

Permalink
Fix embed wasm-rpc.wit
Browse files Browse the repository at this point in the history
  • Loading branch information
vigoo committed Feb 13, 2024
1 parent f2216d4 commit 8cee210
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wasm-rpc-stubgen/src/wit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,17 @@ pub fn copy_wit_files(def: &StubDefinition) -> anyhow::Result<()> {
}
}
}
let wasm_rpc_wit = include_str!("../../wasm-rpc/wit/wasm-rpc.wit");
let wasm_rpc_root = dest_wit_root.join(Path::new("deps/wasm-rpc"));
fs::create_dir_all(&wasm_rpc_root).unwrap();

println!(
"Writing wasm-rpc.wit to {}",
wasm_rpc_root.to_string_lossy()
);
fs::write(wasm_rpc_root.join(Path::new("wasm-rpc.wit")), wasm_rpc_wit)?;
fs::write(
wasm_rpc_root.join(Path::new("wasm-rpc.wit")),
golem_wasm_rpc::WASM_RPC_WIT,
)?;
Ok(())
}

Expand Down
2 changes: 2 additions & 0 deletions wasm-rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ license = "Apache-2.0"
homepage = "https://golem.cloud"
description = "Golem WASM RPC support library"

include = []

[lib]
path = "src/lib.rs"
crate-type = ["cdylib", "rlib"]
Expand Down
3 changes: 3 additions & 0 deletions wasm-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ impl<'a> arbitrary::Arbitrary<'a> for WitValue {
}
}

#[cfg(feature = "host")]
pub static WASM_RPC_WIT: &'static str = include_str!("../wit/wasm-rpc.wit");

pub const WASM_RPC_VERSION: &str = env!("CARGO_PKG_VERSION");

#[cfg(test)]
Expand Down

0 comments on commit 8cee210

Please sign in to comment.