-
Notifications
You must be signed in to change notification settings - Fork 32
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
add ability to dynamically link wasm modules #596
Conversation
@tessi would appreciate your review! |
hey @munjalpatel lot's of 💛 for taking this on! The code looks real solid and easy enough to understand, love it! I understand that dynamic linking is a problem we might want to solve later - good call. However, we might want to hint at that in the docs. I love that you started implementing test infrastructure, but if I'm not mistaken the actual test for linking modules isn't in yet. To make this an easy merge, I'd appreciate if you could add this new (great!) feature to the |
Yes, tests are missing. I wanted to get an early review before I polish it up. |
@tessi I think the PR is ready for another review! |
somehow on older OTP versions one of the linking tests fails:
specifically on:
It might be an OTP 25 problem (although I fail to see how) or a flaky test (although suspiciously not failing on newer OTP versions). Do you have an idea what's going on here? |
Just had another look and your work looks great. Love the introduced API and how the link-map has different keys (bytes, module, module_resource) depending on how far the map was processed. It still gives us the option to maybe introduce an "easier" api later (linking from module-name to module-bytes without a map) if this feature gets lots of use and there is demand. but no need to optimise for that future now :) only got a few 💅 polishing suggestions and the only real blocker is CI complaining. |
Co-authored-by: Philipp Tessenow <philipp@tessenow.org>
Co-authored-by: Philipp Tessenow <philipp@tessenow.org>
No, I haven't seen this error before. Will have to investigate. |
hmm, thinking about what you said. do you think it's worth/possible adding an extra check on the store being equal and raise a helpful error instead of this weird one? (given that this is also the error in case of mismatching stores it would be hard to identify what the problem is just from reading the error mesage) |
My bad, that was a different error about mis-match in stores, not the same error we are experiencing here. I'll take look what's up with this error. |
* fix nested dynamic link issue * add test for compiled dynamically linked module deps
@tessi we now have support for dynamically linked module dependencies and that should also resolve failing tests. |
@munjalpatel looks great! I guess we can spend time to implement the rust side "proper" when someone needs it. Sooner or later - I guess - linked modules will be replaced by the component model anyways. So maybe we never have to build it ;) thanks again for your work here! ❤️ |
Fixes #437
Link un-compiled wasm module:
Link compiled wasm module:
Note:
This PR doesn't solve dynamic-linking dependency chain. Meaning, linking
Module A
toModule B
and then linkingModule B
to theFinal Module
. That's a much bigger undertaking.A potential solution for now is to link both
Module A
andModule B
to theFinal Module
. This should work in most cases as long as there are no module name collisions.