Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/hyperlight_wasm_aot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@ Application to precompile WebAssembly binaries to for hyperlight-wasm.
wasmtime = { version = "47.0.4", default-features = false, features = ["cranelift", "pulley", "runtime", "component-model"] }
wasmtime_lts = { package = "wasmtime", version = "36.0.14", default-features = false, features = ["cranelift", "pulley", "runtime", "component-model"] }
clap = { version = "4.6", features = ["derive"] }
object = { version = "0.39.1", default-features = false, features = ["read_core", "elf"] }
rustc_version = "0.4.1"

[build-dependencies]
cargo_metadata = "0.23"
cargo-util-schemas = "=0.14.1"
object = { version = "0.39.1", default-features = false, features = ["read_core", "elf"] }

[features]
gdb = ["wasmtime/debug-builtins", "wasmtime_lts/debug-builtins"]
33 changes: 33 additions & 0 deletions src/hyperlight_wasm_aot/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use cargo_metadata::MetadataCommand;
use cargo_util_schemas::manifest::PackageName;

fn main() {
let metadata = MetadataCommand::new().exec().unwrap();
let this_pkg_name = PackageName::new("hyperlight-wasm-aot").unwrap();
let this_pkg_id = metadata
.workspace_members
.iter()
.find(|x| metadata[x].name == this_pkg_name)
.unwrap();
let this_pkg = &metadata.resolve.as_ref().unwrap()[this_pkg_id];
let get_dep = |name| {
let mut iter = this_pkg.deps.iter().filter(|x| x.name == name);
let dep = iter
.next()
.unwrap_or_else(|| panic!("hyperlight-wasm-aot has no {name} dependency"));
if iter.next().is_some() {
panic!("hyperlight-wasm-aot has multiple {name} dependencies");
}
dep
};
let wasmtime_lts = &metadata[&get_dep("wasmtime_lts").pkg];
let wasmtime_latest = &metadata[&get_dep("wasmtime").pkg];
println!(
"cargo::rustc-env=WASMTIME_LTS_VERSION={}",
wasmtime_lts.version
);
println!(
"cargo::rustc-env=WASMTIME_LATEST_VERSION={}",
wasmtime_latest.version
);
}
Loading
Loading