Preview1 state lives in the host, so Go modules (esbuild) work. esbuild bundles byte-identical to native; uutils and QuickJS-ng file tests pass. The failed guest-side adapter attempt (T7) moves to spikes/s7-preview1-adapter/.
15 lines
570 B
Diff
15 lines
570 B
Diff
diff --git a/crates/wasi-preview1-component-adapter/src/lib.rs b/crates/wasi-preview1-component-adapter/src/lib.rs
|
|
index 7ce52c6..55a8480 100644
|
|
--- a/crates/wasi-preview1-component-adapter/src/lib.rs
|
|
+++ b/crates/wasi-preview1-component-adapter/src/lib.rs
|
|
@@ -129,6 +129,9 @@ pub extern "C" fn run() -> u32 {
|
|
unsafe extern "C" {
|
|
safe fn _start();
|
|
}
|
|
+ // Reserve adapter state before Go snapshots the linear-memory heap extent.
|
|
+ // Lazy memory.grow allocations otherwise overlap Go's sbrk allocator.
|
|
+ State::ptr();
|
|
_start();
|
|
0
|
|
}
|