Skip to content

Commit

Permalink
wasm-wc: Enable environment inheritance
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
RobbieMcKinstry authored and ac000 committed Sep 4, 2024
1 parent 5a48f44 commit 3945ff7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/wasm-wasi-component/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 3945ff7

Please sign in to comment.