-
Couldn't load subscription status.
- Fork 152
Description
What happened?
Sandbox creation code for WHP has a build error if init-paging feature is not enabled
What did you expect to happen?
Sandbox creation for WHP should build with all optional features disabled
Steps to reproduce the behavior
include hyperlight_host v0.7.0 in another project and build on Windows
Hyperlight Version
0.7.0
OS version
On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here
On Windows:
C:\> cmd /c ver
# paste output here
Additional Information
mgr.shared_mem.raw_mem_size() is referenced at
hyperlight/src/hyperlight_host/src/sandbox/uninitialized_evolve.rs
Lines 245 to 255 in c725c8b
| #[cfg(target_os = "windows")] | |
| Some(HypervisorType::Whp) => { | |
| use crate::hypervisor::wrappers::HandleWrapper; | |
| let mmap_file_handle = mgr | |
| .shared_mem | |
| .with_exclusivity(|e| e.get_mmap_file_handle())?; | |
| let hv = crate::hypervisor::hyperv_windows::HypervWindowsDriver::new( | |
| regions, | |
| mgr.shared_mem.raw_mem_size(), // we use raw_* here because windows driver requires 64K aligned addresses, | |
| pml4_ptr.absolute()?, |
BUT
crate::mem::shared_mem::SharedMemory is only used when init-paging feature is enabled
hyperlight/src/hyperlight_host/src/sandbox/uninitialized_evolve.rs
Lines 36 to 37 in c725c8b
| #[cfg(feature = "init-paging")] | |
| use crate::mem::shared_mem::SharedMemory; |
This causes build issues when hyperlight_host's build.rs script runs when the crate is included in other projects (like hyperlight-wasm) AND init-paging feature is not enabled.