Skip to content

Migrate wai bindgen wasmer to 3.3#42

Draft
kajacx wants to merge 10 commits intowasmerio:mainfrom
kajacx:migrate-wai-bindgen-wasmer-to-3.3
Draft

Migrate wai bindgen wasmer to 3.3#42
kajacx wants to merge 10 commits intowasmerio:mainfrom
kajacx:migrate-wai-bindgen-wasmer-to-3.3

Conversation

@kajacx
Copy link

@kajacx kajacx commented May 24, 2023

Ok, the migration is almost ready. Running cargo test in the crates/gen-wasmer folder passes. I cannot run cargo test in the root folder, because of some error with Python.

But there is one last problem to solve ... how to resolve the imports. Currently, I am using a cloned version of wasmer. There is no change in the wai-bindgen-wasmer crate in the wasmer repo other than changing the wai-bindgen-wasmer-impl dependency to this for in the repo, like so:

wai-bindgen-wasmer-impl = { path = "../../../wai/wai-crates/wasmer-impl" }

But how to resolve this? I guess I should check if the data_and_store_mut method works in wasmer 3.1, at least then the gen-wasmer crate could be updated as a non-breaking change.

But that still leaves to decide what to do with the wasi to wasix "migration". The new wasix crate is needed because it uses wasmer 3.3, but users who use wai bindgen with wasmer 3.1 would expirience a breaking change when updating wai-bindgen-wasmer, because it would create a conflict between wasmer 3.1 and 3.3

I will have to look at it more tomorrow.

@kajacx
Copy link
Author

kajacx commented May 28, 2023

Ok, data_and_store_mut in not available in 3.1. I am thinking on how to migrate this properly. Thankfully, the wasix port will not be a problem, since that is only a dev dependency that is used for testing.

The dependency tree on the other hand looks like this:
image

I hope I got that correctly. Either way, it is a mess. The biggest problem is that wai-bindgen-wasmer is in the wasmer repo, and not in the wai repo, where it should be.

What to do?

The code from wai-bindgen-wasmer which is needed in wasmer should be extracted into a separate crate, and that crate should be put in the wasmer and be used in wasmer and from wai bindgen. I can work on PR for this.

@kajacx
Copy link
Author

kajacx commented May 28, 2023

The code from wai-bindgen-wasmer which is needed in wasmer should be extracted into a separate crate, and that crate should be put in the wasmer and be used in wasmer and from wai bindgen. I can work on PR for this.

Ok, that is not realistic. In that case, I cannot update wai with this PR without also simultaneously updating the wasmer repo to use the new version of the gen-wasmer crate which I am trying to update in the first place. What a mess.

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.

1 participant