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::EngineBuilder::engine returns a wasmer_compiler::Engine instead of wasmer::Engine #3947

Closed
dsherret opened this issue Jun 2, 2023 · 3 comments
Assignees
Labels
📚 documentation Do you like to read? priority-medium Medium priority issue 🏚 stale Inactive issues or PR
Milestone

Comments

@dsherret
Copy link
Contributor

dsherret commented Jun 2, 2023

I've been trying to upgrade wasmer, but have been unable to because 3.x is very slow dropping instances of modules. In order to do this fast, I apparently need to share an engine across all the instances (#3378 (comment)).

I just tried out wasmer 3.3 and was unable to upgrade because wasmer::EngineBuilder::engine returns a wasmer_compiler::Engine instead of wasmer::Engine and is therefore incompatible with EngineRef. For example, the following code does not work:

let compiler = Cranelift::default();
let engine = EngineBuilder::new(compiler).engine();
let engineref = EngineRef::new(&engine);
//                             ^^^^^^^ expected struct `Engine`, found struct `wasmer_compiler::engine::inner::Engine`
let module = Module::new(&engineref, &wasm_bytes)?;
@dsherret
Copy link
Contributor Author

dsherret commented Jun 4, 2023

I've discovered a way to do this is to do:

let engine: wasmer::Engine = engine.into();
let engine_ref = EngineRef::new(&engine);

That said, this is not very discoverable. I feel like .engine() in EngineBuilder should still return a wasmer::Engine?

@ptitSeb ptitSeb added 📚 documentation Do you like to read? priority-medium Medium priority issue labels Jun 6, 2023
@ptitSeb ptitSeb added this to the v4.1 milestone Jun 6, 2023
Copy link

stale bot commented Aug 16, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale Inactive issues or PR label Aug 16, 2024
Copy link

stale bot commented Sep 17, 2024

Feel free to reopen the issue if it has been closed by mistake.

@stale stale bot closed this as completed Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 documentation Do you like to read? priority-medium Medium priority issue 🏚 stale Inactive issues or PR
Projects
None yet
Development

No branches or pull requests

3 participants