Skip to content

Integrate wasi-runtime-config into wasmtime-cli#8970

Merged
alexcrichton merged 1 commit intobytecodealliance:mainfrom
iawia002:cli-runtime-config
Jul 19, 2024
Merged

Integrate wasi-runtime-config into wasmtime-cli#8970
alexcrichton merged 1 commit intobytecodealliance:mainfrom
iawia002:cli-runtime-config

Conversation

@iawia002
Copy link
Copy Markdown
Contributor

@iawia002 iawia002 commented Jul 18, 2024

Part of #8929

This patch adds two new flags:

  -S            runtime-config[=y|n] -- Enable support for WASI runtime config API (experimental)
  -S runtime-config-var=<name>=<val> -- Pass a wasi runtime config variable to the program.

Separating these two flags is considered to handle the scenario where the wasi-runtime-config API is enabled but no configuration needs to be passed.

To use the wasi-runtime-config API in wasmtime-cli:

  1. Enable wasi-runtime-config API support by -Sruntime-config:
wasmtime run/serve -Sruntime-config ...
  1. Pass custom runtime configs to the component:
wasmtime run/serve -Sruntime-config -Sruntime-config-var=key1=value1 -Sruntime-config-var=key2=value2 ...

cc @alexcrichton

@iawia002 iawia002 requested review from a team as code owners July 18, 2024 07:55
@iawia002 iawia002 requested review from elliottt and removed request for a team July 18, 2024 07:55
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Thanks for this!

Ok(())
}

#[cfg(feature = "wasi-runtime-config")]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Currently we assume that all features are enabled during testing, so it's ok to drop this and the marker below.

Cargo.toml Outdated
winch = ["wasmtime/winch"]
wmemcheck = ["wasmtime/wmemcheck"]
memory-protection-keys = ["wasmtime-cli-flags/memory-protection-keys"]
wasi-runtime-config = ["dep:wasmtime-wasi-runtime-config"]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could this be added to the on-by-default features list? That's generally what we're doing with WASI proposals right now so long as there's no extra build requirements, which this proposal doesn't have.

@iawia002 iawia002 force-pushed the cli-runtime-config branch from ac33a7d to 347ad82 Compare July 19, 2024 01:11
@iawia002
Copy link
Copy Markdown
Contributor Author

All comments addressed, PTAL

@alexcrichton alexcrichton added this pull request to the merge queue Jul 19, 2024
Merged via the queue into bytecodealliance:main with commit 4b842a0 Jul 19, 2024
@iawia002 iawia002 deleted the cli-runtime-config branch July 20, 2024 02:45
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.

2 participants