Skip to content

Wasm build hangs when using WasmEdge #85429

@mrhockeymonkey

Description

@mrhockeymonkey

Description

I have been kicking the tyres on dotnet wasm builds using the Wasi.Sdk nuget package. I have a very simple console app that prints out the RuntimeInformation.OSArchitecture as a test. When using wasmtime.exe this works fine but when using wasmedge.exe it seems to just hang.

As I understand work in that area has moved away from dotnet/dotnet-wasi-sdk. If this issue has potentially been fixed am I able to test it in a preview or nightly build?

I like to check in on this tracking issue but I'm not sure if any of this work is made available for us to use/test?

If there isn't a known fix then I just wanted to flag this since docker now supports wasmedge but not wasmtime as far as I can tell. For example it would be nice to run this as see the expected output

docker container run --rm --runtime=io.containerd.wasmedge.v1 --platform=wasi/wasm my-image:latest

Reproduction Steps

using System.Runtime.InteropServices;
using DateTime = System.DateTime;

namespace WasiConsole;
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine($"Hello from {RuntimeInformation.OSArchitecture} at {DateTime.Now}");
    }
}
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>net7.0</TargetFramework>
    <ImplicitUsings>enable</ImplicitUsings>
    <Nullable>enable</Nullable>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Wasi.Sdk" Version="0.1.1" />
  </ItemGroup>

</Project>

Expected behavior

& "C:\Program Files\Wasmtime\bin\wasmtime.exe" .\bin\Debug\net7.0\WasiConsole.wasm
Hello from Wasm at 04/26/2023 22:25:21

& "C:\Users\Scott\Downloads\WasmEdge-0.12.0-windows\bin\wasmedge.exe" .\bin\Debug\net7.0\WasiConsole.wasm
Hello from Wasm at 04/26/2023 22:25:21

Actual behavior

& "C:\Program Files\Wasmtime\bin\wasmtime.exe" .\bin\Debug\net7.0\WasiConsole.wasm
Hello from Wasm at 04/26/2023 22:25:21

& "C:\Users\Scott\Downloads\WasmEdge-0.12.0-windows\bin\wasmedge.exe" .\bin\Debug\net7.0\WasiConsole.wasm
(hangs)

Regression?

No response

Known Workarounds

No response

Configuration

.NET SDK 7.0.201
Windows 10

Other information

This issue may be related but looks like it is more to do with networking rather than hanging

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions