Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to re-use some types from wasi-http interfaces #1065

Open
ahmed-rizk-oie opened this issue Oct 16, 2024 · 1 comment
Open

unable to re-use some types from wasi-http interfaces #1065

ahmed-rizk-oie opened this issue Oct 16, 2024 · 1 comment

Comments

@ahmed-rizk-oie
Copy link

I'm trying to create a wit interface, a type(record) is re-using another type(record) from wasi-http
I'm using wasmcloud dev tools, but still the error occurs on the bindgen macro

error: failed to resolve directory while parsing WIT for path [/home/dev/work/rating/distributed-rating-poc/1.x/rating-coordicator/wit]

   Caused by:
     package not found
        --> <Project-path>/wit/types.wit:3:7
         |
       3 |   use wasi:http/types.{fields};
         |       ^--------
            src/lib.rs:1:1

the interface definition

interface types{

  use wasi:http/types.{fields};

  record rating-process-request{
  headers: fields
} 
}

the deps.toml

http = "https://github.com/WebAssembly/wasi-http/archive/v0.2.0.tar.gz"
keyvalue = "https://github.com/WebAssembly/wasi-keyvalue/archive/53ff9402194704cb68b1599c4e35e9182f4c57c4.tar.gz"
logging = "https://github.com/WebAssembly/wasi-logging/archive/d31c41d0d9eed81aabe02333d0025d42acf3fb75.tar.gz"
bus =  "https://github.com/wasmCloud/wasmCloud/releases/download/wit-wasmcloud-bus-v1.0.0/wit-wasmcloud-bus-1.0.0.tar.gz"

@alexcrichton
Copy link
Member

Thanks for the report! While the error sort of comes from this repository my guess is that the fix here is going to be at a level of configuration unrelated to this repository. The tooling you're using to assemble WIT files looks reasonable but it appears that something has gone wrong and wasi:http isn't available for parsing. As to precisely why that is I'm not sure myself, and I'm also not sure what the fix would be off the top of my head (I'm not familiar with deps.toml and its tooling)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants