Stream: git-wasmtime

Topic: wasmtime / issue #9249 Support list of paths in component...


view this post on Zulip Wasmtime GitHub notifications bot (Sep 15 2024 at 14:52):

lwansbrough opened issue #9249:

wit-bindgen includes the option to provide a list of paths for the wit sources. This makes it more practical to satisfy the requirements of imports from other packages. Enabling this behaviour for the component bindgen macro would be helpful.

wit-bindgen docs:

// Path to parse WIT and its dependencies from. Defaults to the `wit`
// folder adjacent to your `Cargo.toml`.
//
// This parameter also supports the form of a list, such as:
// ["../path/to/wit1", "../path/to/wit2"]
// Usually used in testing, our test suite may want to generate code
// from wit files located in multiple paths within a single mod, and we
// don't want to copy these files again.
path: "../path/to/wit",

view this post on Zulip Wasmtime GitHub notifications bot (Sep 16 2024 at 15:23):

alexcrichton commented on issue #9249:

Thanks for the report! To link things here this was implemented in wit-bindgen in https://github.com/bytecodealliance/wit-bindgen/pull/1003 and I think it'd be reasonable to copy over a similar structure into Wasmtime as well. @lwansbrough would you be interested in creating a PR perhaps?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2024 at 16:44):

lwansbrough commented on issue #9249:

@alexcrichton I'll see what I can do.

I was looking through that commit and this looks like a bug to me. https://github.com/bytecodealliance/wit-bindgen/blob/3e3877da85daf1ed98bd1aee7007e496461c3bd1/crates/guest-rust/macro/src/lib.rs#L215

Line 237 passes root.join("wit") which would mean root is joined to root.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 19 2024 at 16:46):

alexcrichton commented on issue #9249:

Good catch! Semantically that'll work out ok since "/a".join("/b") yields "/b", so the end result is the same. That being said it's unnecessarily complex, and just passing in "wit" instead of root.join("wit") should also work and be cleaner.

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 19:33):

MarinPostma commented on issue #9249:

Will this enable importing transitive dependencies of the package? Say I am generating binding for package A, but package A includes package B in a different directory, should I just be able to add the path to B and have it all work?

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:12):

alexcrichton closed issue #9249:

wit-bindgen includes the option to provide a list of paths for the wit sources. This makes it more practical to satisfy the requirements of imports from other packages. Enabling this behaviour for the component bindgen macro would be helpful.

wit-bindgen docs:

// Path to parse WIT and its dependencies from. Defaults to the `wit`
// folder adjacent to your `Cargo.toml`.
//
// This parameter also supports the form of a list, such as:
// ["../path/to/wit1", "../path/to/wit2"]
// Usually used in testing, our test suite may want to generate code
// from wit files located in multiple paths within a single mod, and we
// don't want to copy these files again.
path: "../path/to/wit",

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:26):

alexcrichton commented on issue #9249:

@MarinPostma I believe so yeah, but it if it doesn't

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:27):

alexcrichton edited a comment on issue #9249:

@MarinPostma I believe so yeah, but if it doesn't let me know!

view this post on Zulip Wasmtime GitHub notifications bot (Sep 24 2024 at 20:43):

MarinPostma commented on issue #9249:

I'll give it a try then :)


Last updated: Nov 22 2024 at 16:03 UTC