Skip to content

Conversation

chrisdickinson
Copy link
Contributor

I implemented this as an ExtismPluginOption, enableWasiOutput, that defaults to checking the environment variable (on platforms that support runtime environment variables.)

  • There was a WASI browser polyfill bug with the wasistdout module. Since wasistdout doesn't export a initialize or start method, we weren't initializing the context appropriately. This now fixed.
  • Neither Deno nor Node squelched WASI output before this commit. Now they do by default -- by opening /dev/null (or NUL on Windows) and sending that FD in instead.
  • And now the browser supports WASI output as well!

Fixes #43.

Copy link
Member

@nilslice nilslice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I implemented this as an `ExtismPluginOption`, `enableWasiOutput`, that
defaults to checking the environment variable (on platforms that support
runtime environment variables.)

- There was a WASI browser polyfill bug with the wasistdout module.
  Since `wasistdout` doesn't export a `initialize` or `start` method,
  we weren't initializing the context appropriately. This now fixed.
- Neither Deno nor Node squelched WASI output before this commit. Now
  they do by default -- by opening /dev/null (or NUL on Windows) and
  sending that FD in instead.
- And now the browser supports WASI output as well!
- Additionally, simplify all `prop?: T | undefined` to `prop?: T` in
  `src/interfaces.ts`.

Fixes #43.
@chrisdickinson chrisdickinson force-pushed the chris/20240104-respect-extism-output-env-var branch from 8036bc8 to 3d4164c Compare January 5, 2024 18:32
@chrisdickinson chrisdickinson merged commit 85b5022 into main Jan 5, 2024
@chrisdickinson chrisdickinson deleted the chris/20240104-respect-extism-output-env-var branch January 5, 2024 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for enabling WASI output via EXTISM_ENABLE_WASI_OUTPUT env var

2 participants