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

Add compiler features to wai-bindgen-wasmer #3879

Merged
merged 1 commit into from
May 18, 2023

Conversation

kajacx
Copy link
Contributor

@kajacx kajacx commented May 18, 2023

Description

Specify which compiler you want to use with a feature directly in wai-bindgen-wasmer .

Current situation:

When you want to use wai-bindgen-wasmer with the sys feature, you have to separately include wasmer to specify which compiler you want to use, like this:

wai-bindgen-wasmer = { version = "=0.4.0", features = ["sys"]}
wasmer = {version = "=3.3.0", features = ["cranelift"]}

Why this is suboptimal:

There are several reasons:

  • You have to remember to do it. New people who just want to use wai-bindgen-wasmer would not know this and would be confused by the compiler error.
  • You have to track down which specific version of wasmer to use.
  • You have the decision fatigue of whether to use wai-bindgen-wasmer::wamser or just wasmer in your code.
  • Your cargo setup is needlessly complicated when you are building for both native and web targets.

With the proposed change:

You just specify which compiler you want to use directly in the wai-bindgen-wasmer dependency:

wai-bindgen-wasmer = { version = "=0.4.0", features = ["sys", "cranelift"]}

Things to consider:

Should cranelift be enabled by default when using sys? It is when using wasmer directly, but I don't think that would fit here well. Alternatively, sys could be removed in favor of sys-cranelift, sys-singlepass and sys-llvm instead.

Also, is there a changelog for the wai-vingen-wasmer crate, or should I put this change to the main changelog?

This enables using `wai-bindgen-wasmer` as a single dependency, without needing to include `wasmer` with the specified compiler.
@syrusakbary syrusakbary merged commit cb18650 into wasmerio:master May 18, 2023
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