-
Notifications
You must be signed in to change notification settings - Fork 821
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
Disable closures as host functions for now + docs + tests #1841
Conversation
3ea8817
to
29d50a5
Compare
It's going to break |
We don't support native closures with Wasmer... are they used in wasmer-python ? |
We use this feature for a year or so without any issues. In our case, the |
In https://doc.rust-lang.org/book/ch13-01-closures.html#capturing-the-environment-with-closures there is a good explanation regarding naming and the different capture types. In Rust all anonymous functions are closures (no "lambda" as used in other languages). Then there are different types of environment capturing. And it turns out some of those captures (all captured data owned by the function) are still possible with this PR. |
It captures the |
Closures as host functions are going to be disabled for a moment in Wasmer, see wasmerio/wasmer#1841. In the `wasmer` Python package, we were passing a closure to `Function::new_with_env`. In order to get a regular function, this patch stores the previously captured varibles into the function environment. The only concerned variable is `result_types`.
I found why my code is not affected by this change. We use |
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com>
Yeah, you are right @webmaster128 |
bors r+ |
1841: Disable closures as host functions for now + docs + tests r=syrusakbary a=MarkMcCaskey Resolves #1811 for now Part of #1840 # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Mark McCaskey <mark@wasmer.io> Co-authored-by: Syrus Akbary <me@syrusakbary.com>
Build failed: |
bors r+ |
Resolves #1811 for now
Part of #1840
Review