Skip to content

Commit b01dad7

Browse files
committed
Updates for cargo plugin
Signed-off-by: James Sturtevant <[email protected]>
1 parent a7f2003 commit b01dad7

File tree

3 files changed

+9
-42
lines changed

3 files changed

+9
-42
lines changed

src/hyperlight_wasm/build.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ fn build_wasm_runtime() -> PathBuf {
105105
let out_dir = env::var_os("OUT_DIR").unwrap();
106106

107107
let target_dir = Path::new("").join(&out_dir).join("target");
108-
let toolchain_dir = Path::new("").join(&out_dir).join("toolchain");
109108

110109
let in_repo_dir = get_wasm_runtime_path();
111110

@@ -126,20 +125,21 @@ fn build_wasm_runtime() -> PathBuf {
126125

127126
let mut cargo_cmd = std::process::Command::new(&cargo_bin);
128127
let mut cmd = cargo_cmd
128+
.arg("hyperlight")
129129
.arg("build")
130+
.arg("--target-dir")
131+
.arg(&target_dir)
130132
.arg("--profile")
131133
.arg(cargo_profile)
132134
.arg("-v")
133-
.arg("--target-dir")
134-
.arg(&target_dir)
135135
.current_dir(&in_repo_dir)
136136
.env_clear()
137-
// On windows when `gdb` features is enabled this is not set correctly
138-
.env("CFLAGS_x86_64_unknown_none", "-fPIC")
139-
.envs(env_vars)
140-
.env("PATH", path_with(&toolchain_dir))
141-
.env("HYPERLIGHT_GUEST_TOOLCHAIN_ROOT", &toolchain_dir);
137+
.envs(env_vars);
142138

139+
// should this go in cargo hyperlight?
140+
// On windows when `gdb` features is enabled this is not set correctly
141+
//.env("CFLAGS_x86_64_unknown_none", "-fPIC")
142+
143143
// Add --features gdb if the gdb feature is enabled for this build script
144144
if std::env::var("CARGO_FEATURE_GDB").is_ok() {
145145
cmd = cmd.arg("--features").arg("gdb");
@@ -152,7 +152,7 @@ fn build_wasm_runtime() -> PathBuf {
152152
panic!("could not compile wasm_runtime");
153153
}
154154
let resource = target_dir
155-
.join("x86_64-unknown-none")
155+
.join("x86_64-hyperlight-none")
156156
.join(profile)
157157
.join("wasm_runtime");
158158

src/wasm_runtime/.cargo/config.toml

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/wasm_runtime/build.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,6 @@ use std::{env, fs};
2020
use cargo_metadata::{MetadataCommand, Package};
2121

2222
fn main() {
23-
let toolchain_dir = env::var_os("HYPERLIGHT_GUEST_TOOLCHAIN_ROOT").unwrap();
24-
let toolchain_dir = PathBuf::from(toolchain_dir);
25-
let clang_path = toolchain_dir.join("clang");
26-
27-
assert!(
28-
clang_path.exists(),
29-
"could not find clang at {clang_path:?}"
30-
);
31-
3223
println!("cargo:rerun-if-changed=.");
3324
let mut cfg = cc::Build::new();
3425

@@ -63,7 +54,6 @@ fn main() {
6354

6455
cfg.include("src/include");
6556
cfg.file("src/platform.c");
66-
cfg.compiler(clang_path);
6757
if cfg!(windows) {
6858
env::set_var("AR_x86_64_unknown_none", "llvm-ar");
6959
}

0 commit comments

Comments
 (0)