What happened?
The wasm_guest_bindgen! macro in hyperlight_wasm_macro fails to compile when the WIT world includes flags type definitions (e.g. from wasi:filesystem/types@0.2.0).
Error:
error[E0277]: the trait bound `DescriptorFlags: wasmtime::component::Lower` is not satisfied
error[E0277]: the trait bound `PathFlags: wasmtime::component::Lift` is not satisfied
error[E0277]: the trait bound `OpenFlags: wasmtime::component::Lift` is not satisfied
WIT that triggers the error:
flags descriptor-flags {
read,
write,
file-integrity-sync,
data-integrity-sync,
requested-write-sync,
mutate-directory,
}
flags path-flags {
symlink-follow,
}
flags open-flags {
create,
directory,
exclusive,
truncate,
}
Steps to Reproduce
Reproduction
- Create a WIT with
wasi:filesystem/types including flags descriptor-flags { ... }
- Compile with
wasm-tools component wit ... -w -o world.wasm
- Build with
WIT_WORLD=world.wasm cargo build -p hyperlight-wasm
- Runtime sub-build fails with the
Lift/Lower errors above
Expected Results
Without flags support, it's impossible to use wasi:filesystem with hyperlight-wasm component model support.
Actual Results
TODO: What actually happened?
Versions and Environment
Hyperlight version or commit: TODO
OS Version
Run the following to find your OS version:
Linux:
cat /etc/os-release && uname -a
Windows (PowerShell):
Hypervisor
Run the following to check hypervisor access:
Linux:
ls -la /dev/kvm /dev/mshv 2>&1; getfacl /dev/kvm /dev/mshv 2>&1; id
[ -r /dev/kvm ] && [ -w /dev/kvm ] && echo "KVM: OK" || echo "KVM: FAIL"
[ -r /dev/mshv ] && [ -w /dev/mshv ] && echo "MSHV: OK" || echo "MSHV: FAIL"
Windows (Admin PowerShell):
Get-WindowsOptionalFeature -Online | Where-Object {$_.FeatureName -match 'Hyper-V|HypervisorPlatform|VirtualMachinePlatform'} | Format-Table
Extra Info
Anything else you'd like to add?
hyperlight-wasm-sockets-example — works around by omitting flags from WIT
hyperlight-wasm-http-example — avoids the issue by not importing wasi:filesystem at all
What happened?
The wasm_guest_bindgen! macro in hyperlight_wasm_macro fails to compile when the WIT world includes flags type definitions (e.g. from wasi:filesystem/types@0.2.0).
Error:
WIT that triggers the error:
Steps to Reproduce
Reproduction
wasi:filesystem/typesincludingflags descriptor-flags { ... }wasm-tools component wit ... -w -o world.wasmWIT_WORLD=world.wasm cargo build -p hyperlight-wasmLift/Lowererrors aboveExpected Results
Without
flagssupport, it's impossible to usewasi:filesystemwith hyperlight-wasm component model support.Actual Results
TODO: What actually happened?
Versions and Environment
Hyperlight version or commit: TODO
OS Version
Run the following to find your OS version:
Linux:
cat /etc/os-release && uname -aWindows (PowerShell):
cmd /c verHypervisor
Run the following to check hypervisor access:
Linux:
Windows (Admin PowerShell):
Extra Info
Anything else you'd like to add?
hyperlight-wasm-sockets-example— works around by omittingflagsfrom WIThyperlight-wasm-http-example— avoids the issue by not importingwasi:filesystemat all