Skip to content

wasm_guest_bindgen! macro doesn't support WIT flags types (needed for wasi:filesystem) #1318

Closed

Description

@jsturtevant

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

  1. Create a WIT with wasi:filesystem/types including flags descriptor-flags { ... }
  2. Compile with wasm-tools component wit ... -w -o world.wasm
  3. Build with WIT_WORLD=world.wasm cargo build -p hyperlight-wasm
  4. 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):

cmd /c ver

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

Activity

  1. added 2 commits that reference this issue on Mar 19, 2026
    add87d8
    6850d96
  2. added a commit that references this issue on Apr 3, 2026
    941609a
  3. added a commit that references this issue on Apr 27, 2026
    8ef38be
  4. added this to the v0.16 milestone on Jun 17, 2026
  5. added a commit that references this issue on Jun 18, 2026
    8600767
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions