Skip to content

Added partial support for no-std environments #2168

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

Closed
wants to merge 13 commits into from

Conversation

KernelFreeze
Copy link

@KernelFreeze KernelFreeze commented Mar 5, 2021

Description

Added dynamic imports and feature flags to allow support for no-std environments in wasmer-compiler and singlepass-compiler as a first step for supporting no-std in Wasmer.

Review

  • Add a short description of the change to the CHANGELOG.md file

@KernelFreeze KernelFreeze changed the title Added wasmer-compiler support for no-std environments Added partial support for no-std environments Mar 5, 2021
@Hywan Hywan self-assigned this Mar 5, 2021
@Hywan Hywan added the 🎉 enhancement New feature! label Mar 5, 2021
@Hywan
Copy link
Contributor

Hywan commented Mar 5, 2021

Thanks for your patch, I'll review it soon :-).

Copy link
Contributor

@MarkMcCaskey MarkMcCaskey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I skimmed through the changes and they seem reasonable -- thanks for the PR!

For some background, we haven't been working toward keeping Wasmer no-std supporting because we don't have a clear use case for it yet and it adds some overhead to the code we maintain. That said, if there are use cases for no-std Wasmer then we'd like to support it. And at least so far, the changes in this PR don't seem too burdensome.

On a related note to that, I think we'll need a test of some kind in CI or we'll likely break no-std support the day after this PR lands. A test could be a good opportunity to show-case some of the uses of no-std support, though that may be harder than it initially seems. I suspect we may run into issues with some of the OS-specific stuff in wasmer-vm, for example, when trying to use Wasmer with no-std. To not block this PR on something as (potentially) hard as getting no-std wasmer working in a test, perhaps we can just test that these crates compile with the no-std feature enabled (cargo check) or that the unit tests of these crates pass with no-std.

I'd like to hear your thoughts on this!

@KernelFreeze
Copy link
Author

For some background, we haven't been working toward keeping Wasmer no-std supporting because we don't have a clear use case for it yet and it adds some overhead to the code we maintain. That said, if there are use cases for no-std Wasmer then we'd like to support it. And at least so far, the changes in this PR don't seem too burdensome.

Hey, thank you for your quick reply! I have a use case that can be quite interesting, running Wasmer in a Rust Kernel, creating an environment to run WASM in bare-metal hardware. See etheryal-kernel for more details.

On a related note to that, I think we'll need a test of some kind in CI or we'll likely break no-std support the day after this PR lands. A test could be a good opportunity to show-case some of the uses of no-std support, though that may be harder than it initially seems. I suspect we may run into issues with some of the OS-specific stuff in wasmer-vm, for example, when trying to use Wasmer with no-std.

I can try to add an integration test of some sort using no-std, if not possible, we could just make it compile with core feature flag, so it disables any std integration.

@syrusakbary
Copy link
Member

I can try to add an integration test of some sort using no-std, if not possible, we could just make it compile with core feature flag, so it disables any std integration.

Sounds good!

@syrusakbary
Copy link
Member

@KernelFreeze the progress is looking great. Let us know once the PR is ready to review :)

@KernelFreeze
Copy link
Author

Sure! Thank you :)

@KernelFreeze KernelFreeze marked this pull request as draft May 13, 2021 03:55
@syrusakbary syrusakbary mentioned this pull request Jul 14, 2021
@syrusakbary
Copy link
Member

Hey @KernelFreeze, we are reviewing stalled PRs and it would be great to know if you want to continue working on this

@KernelFreeze
Copy link
Author

Hey! I don't have time at the moment, so I will reopen another pull request when I'm ready. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 enhancement New feature!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants