feat(runtime): forward WEFT_FILE_PORTAL_SOCKET into WASI environment

When WEFT_FILE_PORTAL_SOCKET is present in the process environment
(set by weft-appd before exec), it is now forwarded into the WASI
context so the WASM component can read it via std::env::var or
equivalent and locate the per-session file portal socket.
This commit is contained in:
Marco Allegretti 2026-03-11 18:23:32 +01:00
parent 8eb7211998
commit c181bc8015

View file

@ -146,6 +146,10 @@ fn run_module(
ctx_builder.env("WEFT_IPC_SOCKET", socket_path);
}
if let Ok(portal_socket) = std::env::var("WEFT_FILE_PORTAL_SOCKET") {
ctx_builder.env("WEFT_FILE_PORTAL_SOCKET", &portal_socket);
}
for (host_path, guest_path) in preopen {
let dir = Dir::open_ambient_dir(host_path, ambient_authority())
.with_context(|| format!("open preopen dir {host_path}"))?;