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

Building on windows with wasmer_wamr feature #117

Open
mattyg opened this issue Sep 1, 2024 · 2 comments
Open

Building on windows with wasmer_wamr feature #117

mattyg opened this issue Sep 1, 2024 · 2 comments

Comments

@mattyg
Copy link
Collaborator

mattyg commented Sep 1, 2024

I have been unable to get these crates building on windows with the wasmer_wamr feature flag.

I don't know the c or windows tooling well so am not sure the best approach. My understanding is the "official" windows tooling is cmake and MSVC as compiler. There are also several projects porting gnu build tools to windows including MSYS2 and MinGW.

Current State:

  • When attempting to build the fork of hc-wasmer linked above on a windows machine with cmake, msvc, and llvm installed:
    • wasm-micro-runtime builds
    • bingen generates bindings
    • crate fails to compile due to type inconsistencies between bindgen bindings and wasmer code interfacing with it
    • When modifying wasmer code to fix type inconsistencies
    • Get a huge error dump that link.exe failed
@ThetaSinner
Copy link
Member

ThetaSinner commented Sep 11, 2024

Have the wasmer team built this for Windows? Wondering if this will build as a dependency of a simple crate or whether it's just always hard/impossible to build for Windows? I see, only as a binary, not as a Rust dependency into a library.

Happy to try and help with this, but it'll have to be between other things at the moment unfortunately, with Holo stuff happening! What steps do I need to take, like branches and roughly the steps you've gone through, to get to a build failure for this on Windows?

@mattyg
Copy link
Collaborator Author

mattyg commented Sep 11, 2024

Happy to try and help with this, but it'll have to be between other things at the moment unfortunately, with Holo stuff happening! What steps do I need to take, like branches and roughly the steps you've gone through, to get to a build failure for this on Windows?

Thanks! I did give the wasmer team a heads up about the issue and it sounds like they want to resolve it before including it in an actual release.

  • You can attempt build wasmer from this branch: https://github.com/holochain/wasmer/tree/fix/win32-build
  • In lib/api/build.rs you'll see that we are downloading the wasm-micro-runtime source code and then compiling it with the rust cmake wrapper crate.
  • I'm guessing we will need to change the cmake settings in wasm-micro-runtime's CMakeLists.txt and/or a different cmake call and system setup to do the compilation with MSYS2 or MinGW instead of MSVC.

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

No branches or pull requests

2 participants