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

wasmer 4.x support #159

Closed
wants to merge 11 commits into from
Closed

wasmer 4.x support #159

wants to merge 11 commits into from

Conversation

chancehudson
Copy link
Collaborator

@chancehudson chancehudson commented Jun 12, 2024

This PR bumps the wasmer version from 2.x to 4.x. This relies on updates to the circom-compat repo to support this version (implemented in the fork here).

Related #151

@vivianjeng
Copy link
Collaborator

There is a good implementation example here
https://github.com/l-adic/circom-compat
but for iOS we still need to patch the wasmer like
wasmerio/wasmer@09c7070

I haven't tried either if we patched the wasmer it works for iOS
or if it can be published in testflight #107

@vivianjeng
Copy link
Collaborator

You can also fork the latest wasmer in zkmopro and patch these lines

@chancehudson chancehudson force-pushed the wasmer-4 branch 2 times, most recently from 29137a7 to dbb7ffc Compare June 14, 2024 04:21
@chancehudson chancehudson changed the title wip: wasmer 4.x support wasmer 4.x support Jun 14, 2024
@chancehudson
Copy link
Collaborator Author

@vivianjeng I think this is ready for review now. I removed the singleton pattern that was caching the wasm executor because of changes in wasmer@4. There's an in memory Store that tracks execution of the wasm and needs to be mutable so it can't be in a static singleton.

The new wasmer also relies more on async functions so tests are async.

@vivianjeng
Copy link
Collaborator

I tried to run it on iOS
Now it can be run if the device is connected to xcode
but it cannot be run if the device is disconnected to xcode
(you download the app, stop xcode, and open the app again and run)

Previously we use dylib feature to fix this
but I tried to use dylib, it throws

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool: input file: /Users/zhengyawen/Documents/GitHub/vimwitch/mopro/mopro-example-app/target/aarch64-apple-ios/release/multiplier2.dylib is not a Mach-O file

Not sure if the wasmer is wrong
but in wasmer v4, there is no dylib feature

I saw there is also a solution like https://github.com/oliveeyay/SwiftWasmer
wasmerio/wasmer#4343
I am not sure if it works in our case

Do you know if the dylib feature can be fixed?
Is it possible that it can be run when disconnected to xcode?

@chancehudson
Copy link
Collaborator Author

Closing in favor of #179

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

Successfully merging this pull request may close these issues.

2 participants