From 47b1aa68f54068f42650afb291110f908a348147 Mon Sep 17 00:00:00 2001 From: Ava Hahn Date: Wed, 4 Sep 2024 09:58:43 -0700 Subject: [PATCH] component should be linked to more functionality than just proxy Signed-off-by: Ava Hahn --- src/wasm-wasi-component/src/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/wasm-wasi-component/src/lib.rs b/src/wasm-wasi-component/src/lib.rs index faff2cc85..fca4a6284 100644 --- a/src/wasm-wasi-component/src/lib.rs +++ b/src/wasm-wasi-component/src/lib.rs @@ -15,7 +15,7 @@ use wasmtime_wasi::{ DirPerms, FilePerms, WasiCtx, WasiCtxBuilder, WasiView, }; use wasmtime_wasi_http::bindings::http::types::{ErrorCode, Scheme}; -use wasmtime_wasi_http::{WasiHttpCtx, WasiHttpView, add_to_linker_async}; +use wasmtime_wasi_http::{WasiHttpCtx, WasiHttpView}; use wasmtime_wasi_http::bindings::ProxyPre; #[allow( @@ -210,10 +210,10 @@ impl GlobalState { let component = Component::from_file(&engine, &global_config.component) .context("failed to compile component")?; let mut linker = Linker::::new(&engine); - add_to_linker_async(&mut linker) - .context("failed to add to linker")?; - //add_only_http_to_linker_sync(&mut linker) - // .context("failed to add http to linker")?; + wasmtime_wasi::add_to_linker_async(&mut linker) + .context("failed to add wasi to linker")?; + wasmtime_wasi_http::add_only_http_to_linker_sync(&mut linker) + .context("failed to add wasi:http to linker")?; let component = linker .instantiate_pre(&component) .context("failed to pre-instantiate the provided component")?;