summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobbie McKinstry <thesnowmancometh@gmail.com>2024-08-28 03:00:43 +0100
committerAva Hahn <110854134+avahahn@users.noreply.github.com>2024-09-04 14:50:59 -0700
commit56c237b347fd0ff3fa182663cbc965e05b158e39 (patch)
tree66108eb8dd775f117e9f3d7ee41bc4f2fe8df204
parent011071aaa1809f63abdc4287c80843c8d6e7e179 (diff)
downloadunit-56c237b347fd0ff3fa182663cbc965e05b158e39.tar.gz
unit-56c237b347fd0ff3fa182663cbc965e05b158e39.tar.bz2
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 <a.clayton@nginx.com>
-rw-r--r--src/wasm-wasi-component/src/lib.rs1
1 files changed, 1 insertions, 0 deletions
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,