Draft
Conversation
Collaborator
|
I have reviewed this PR quickly. |
Author
|
Thanks! I would be fine to leave this PR as draft for now, especially as WASI preview2 will probably make a lot of the diff of this PR unnecessary. |
Collaborator
|
OK. Let's keep this PR open. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR if you want to use this to get your Wasm project to compile:
(This is pointing to a branch where the configure script has been checked in.)
This PR adds a bunch of CPP in order to build with the GHC Wasm backend. However, nothing here is actually really Wasm-specific (e.g. the diff doesn't mention Wasm); in principle, there could be other platforms that are also missing certain network functionality similar to Wasm.
This PR probably shouldn't be merged as is; it probably makes sense to wait at least until the Wasm backend updates to WASI preview2 which seems to support more networking stuff.
For a simple example how networking stuff works with Wasm today, see https://gist.github.com/amesgen/8b7d6dc672e7818d951142afa1263dde for a simple echo server example, which can be run via
wasmtime run -S preview2=n -S tcplisten=127.0.0.1:12345 /path/to/wasi-echo-server.wasmand interacted with via e.g.
nc 127.0.0.1 12345.However, usually,
networkis just an accidental dependency in projects that don't actually do any networking stuff (e.g. because they depend onstreaming-commonssomehow). Still, it is useful to have something that compiles on Wasm as one has to patch fewer dependencies this way.