Browse Source
Currently with the `bindgen!` macro when the `with` key is used then the generated bindings are different than if the `with` key was not used. Not only for replacement purposes but the generated bindings are missing two key pieces: * In the generated `add_to_linker` functions bounds and invocations of `with`-overridden interfaces are all missing. This means that the generated `add_to_linker` functions don't actually represent the full world. * The generated module hierarchy has "holes" for all the modules that are overridden. While it's mostly a minor inconvenience it's also easy enough to generate everything via `pub use` to have everything hooked up correctly. After this PR it means that each `bindgen!` macro should, in isolation, work for any other `bindgen!` macro invocation. It shouldn't be necessary to weave things together and remember how each macro was invoked along the way. This is primarily to unblock #8715 which is running into a case where tcp/udp are generated as sync but their dependency, `wasi:sockets/network`, is used from an upstream async version. The generated `add_to_linker` does not compile because tcp/udp depend on `wasi:sockets/network` isn't added to the linker. After fixing that it then required more modules to be generated, hence this PR.pull/8725/head
Alex Crichton
5 months ago
committed by
GitHub
6 changed files with 169 additions and 25 deletions
Loading…
Reference in new issue