Skip to content

Improve UX for publishing existing project as wasi #95345

Description

@richlander

I've started converting existing projects to Wasi. I always get this error first:

rich@Richs-Air count % dotnet run
WasmAppHost --runtime-config /Users/rich/git/convenience/wordcount/count/bin/Debug/net8.0/wasi-wasm/AppBundle/count.runtimeconfig.json
Error: no perHostConfigs found

I then remember that I need the following file:

% cat runtimeconfig.template.json 
{
    "wasmHostProperties": {
        "perHostConfig": [
            {
                "name": "wasmtime",
                "Host": "wasmtime"
            }
        ]
    }
}

It would be good if we could make wasmtime the default. I'm glad that this is configurable, however.

Ideally, we'd upgrade the current RuntimeIdentifier approach to be more like PublishWasi, just like PublishAot. And then have an optional WasmHost property.

<PropertyGroup>
   <PublishWasi>true</PublishWasi>
   <WasmHost>wasmtime</WasmHost>
</PropertyGroup>

We should also decide if parameters to the WasmHost should be handled here. I'd ideally like to be able to dotnet run a wasm app that requires directory mapping, for example.

Metadata

Metadata

Assignees

Labels

arch-wasmWebAssembly architecturearea-Build-monoin-prThere is an active PR which will close this issue when it is mergedos-wasiRelated to WASI variant of arch-wasm

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions