Skip to content

hyperlight_host doesn't build on Windows without init-paging feature enabled #685

Closed
@marosset

Description

@marosset

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

#[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()?,
when target_os = Windows

BUT

crate::mem::shared_mem::SharedMemory is only used when init-paging feature is enabled

#[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.

Metadata

Metadata

Assignees

Labels

lifecycle/confirmedBug is verified or proposal seems reasonable

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions