iawia002 opened issue #8929:
Feature
The wasi-runtime-config API has entered Phase 2, I think we can start implementing it.
Benefit
For users, the env API from wasi-cli can currently be used to achieve similar functionality. However, from a semantic standpoint, some configuration items that the runtime wants to pass to the user should be implemented through the config API.
Implementation
Because
the wasi-runtime-config
API is very simple, its implementation will be quick. However, there is one issue: I'm not sure whether this API should be merged into the currentwasi
crate or if we should create a separatewasi-runtime-config
crate likewasi-http
. The current wasi crate essentially only implements thewasi-cli
API, so I'm uncertain how we should handle new wasi APIs, eg:wasi-runtime-config
orwasi-keyvalue
, etc.If this proposal is accepted, I would be happy to implement this API.
cc @alexcrichton
alexcrichton commented on issue #8929:
I think it'll be best to follow the pattern of wasi-nn here to have a separate crate. That would boil down to a few components:
- An
add_to_linker
function- A "view structure" which provides contextual access to anything necessary, such as the configuration keys.
- A context type and builder if necessary.
That would then all get integrated into the CLI in the same manner as wasi-nn where it's off-by-default but a flag can be passed to enable it.
Does that sound reasonable to you?
iawia002 commented on issue #8929:
Yeah, thanks for the help, I'll start implementing it soon.
alexcrichton closed issue #8929:
Feature
The wasi-runtime-config API has entered Phase 2, I think we can start implementing it.
Benefit
For users, the env API from wasi-cli can currently be used to achieve similar functionality. However, from a semantic standpoint, some configuration items that the runtime wants to pass to the user should be implemented through the config API.
Implementation
Because
the wasi-runtime-config
API is very simple, its implementation will be quick. However, there is one issue: I'm not sure whether this API should be merged into the currentwasi
crate or if we should create a separatewasi-runtime-config
crate likewasi-http
. The current wasi crate essentially only implements thewasi-cli
API, so I'm uncertain how we should handle new wasi APIs, eg:wasi-runtime-config
orwasi-keyvalue
, etc.If this proposal is accepted, I would be happy to implement this API.
cc @alexcrichton
Last updated: Nov 22 2024 at 17:03 UTC