From 56c237b347fd0ff3fa182663cbc965e05b158e39 Mon Sep 17 00:00:00 2001 From: Robbie McKinstry Date: Wed, 28 Aug 2024 03:00:43 +0100 Subject: wasm-wc: Enable environment inheritance While the C based wasm language module inherits the process environment the Rust based wasm-wasi-component language module did not. One upshot of this is that with wasm-wasi-component you don't get access to any environment variables specified in the Unit configuration. wasm-wasi-component was based on wasmtime 17.0.0. This capability wasn't added to the wasmtime-crate until version 20.0.0. Now that wasm-wasi-component has been updated to a newer wasmtime-crate we can enable this functionality. Closes: https://github.com/nginx/unit/issues/1312 [ Commit message - Andrew ] Signed-off-by: Andrew Clayton --- src/wasm-wasi-component/src/lib.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/wasm-wasi-component/src/lib.rs b/src/wasm-wasi-component/src/lib.rs index facbe2a0..93c26214 100644 --- a/src/wasm-wasi-component/src/lib.rs +++ b/src/wasm-wasi-component/src/lib.rs @@ -259,6 +259,7 @@ impl GlobalState { // shouldn't get raw access to stdout/stderr. cx.inherit_stdout(); cx.inherit_stderr(); + cx.inherit_env(); for dir in self.global_config.dirs.iter() { cx.preopened_dir( dir, -- cgit