mirror of
https://github.com/marcoallegretti/WEFT_OS.git
synced 2026-03-27 01:13:09 +00:00
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:
parent
8eb7211998
commit
c181bc8015
1 changed files with 4 additions and 0 deletions
|
|
@ -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}"))?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue