Add wasm2c native compilation target and host runtime

Add native/extract_core.py to extract embedded core Wasm modules from curl.wasm and native/wasi_host.c providing a POSIX/OpenSSL WASI 0.2 host shim for wasm2c. Add native, test-native, and run-native recipes to justfile (with positional-arguments enabled), support CURL_WASM_NATIVE in tests/test_curl.py, ignore build artifacts in .gitignore, and document native compilation in README.md.
This commit is contained in:
Sprite committed 2026-11-20 00:07:33 +00:00
1 parent e04081daa0
commit 2ff249ff89
6 files changed
+1918 -3

No files matched your search

+6 -1
View File
@@ -229,8 +229,13 @@ class TestServerHandler(http.server.BaseHTTPRequestHandler):
pass
NATIVE_BIN = os.path.abspath(os.environ["CURL_WASM_NATIVE"]) if os.environ.get("CURL_WASM_NATIVE") else None
def run_curl(args, cwd=ROOT, stdin_bytes=None, use_dir=True, use_wrapper=False):
if use_wrapper:
if NATIVE_BIN:
cmd = [NATIVE_BIN] + args
elif use_wrapper:
cmd = [WRAPPER] + args
else:
cmd = ["wasmtime", "run", "-S", "http"]