Skip to content
This repository was archived by the owner on Apr 16, 2025. It is now read-only.
This repository was archived by the owner on Apr 16, 2025. It is now read-only.

[Idea] WasiApp #25

@redradist

Description

@redradist

Hi all,

Recently I wrote small wrapper that simplify loading and linking wasi application with all dependencies, see example:

  // Create WasiApp that encapsulate all complexity for linking underhood
  WasiApp wasi_app(linkdirs, workdir);

  // Configure WASI and store it within our `wasmtime_store_t`
  ws::WasiConfig wasi;
  wasi.inherit_argv();
  wasi.inherit_env();
  wasi.inherit_stdin();
  wasi.inherit_stdout();
  wasi.inherit_stderr();

  // Set config to WasiApp
  wasi_app.set_config(std::move(wasi));
  // Load main application with all dependencies
  wasi_app.load_app(app_name);
  // Run application with entry point 'run'
  wasi_app.run("run", {});

The benefits is that this class encapsulate all complexity for properly loading application.
For example, underhood wasi_app.load_app(app_name) loads all dependencies that are describe in import sections

Do you think such functionality would be useful in this repo ? (I could create PR)
Or do you think it should be provided as functionality from wasmtime ?
Or not needed at all ?

Please, share your ideas ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions