Skip to content

Commit 56c237b

Browse files
RobbieMcKinstryavahahn
authored andcommitted
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: #1312 [ Commit message - Andrew ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 011071a commit 56c237b

File tree

1 file changed

+1
-0
lines changed
  • src/wasm-wasi-component/src

1 file changed

+1
-0
lines changed

src/wasm-wasi-component/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ impl GlobalState {
259259
// shouldn't get raw access to stdout/stderr.
260260
cx.inherit_stdout();
261261
cx.inherit_stderr();
262+
cx.inherit_env();
262263
for dir in self.global_config.dirs.iter() {
263264
cx.preopened_dir(
264265
dir,

0 commit comments

Comments
 (0)