componentize-dotnet icon indicating copy to clipboard operation
componentize-dotnet copied to clipboard

build failed

Open snikeguo opened this issue 8 months ago • 7 comments

PS E:> dotnet build MyApp 还原完成(0.4) 你正在使用 .NET 的预览版。请参阅 https://aka.ms/dotnet-support-policy MyApp 失败,出现 1 错误 (0.7 秒) → E:\MyApp\bin\Debug\net10.0\wasi-wasm\MyApp.dll C:\Users\Administrator.nuget\packages\microsoft.dotnet.ilcompiler.llvm\10.0.0-alpha.1.25162.1\build\Microsoft.NETCore.Native.targets(409,5): error MSB3073: 命令“"C:\Users\Administrator.wasi-sdk\wasi-sdk-24.0/bin/wasm-component-ld" --version”已退出,代码为 3。

在 1.5 秒内生成 失败,出现 1 错误

snikeguo avatar Mar 28 '25 18:03 snikeguo

Solution: Extract and copy manually.

tar -xf ....temp path/was*....tar.gz

copying bin lib share to C:\Users\Administrator.wasi-sdk\wasi-sdk-24.0

snikeguo avatar Mar 28 '25 18:03 snikeguo

what does your .csproj look like?

could you try running dotnet msbuild src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets /t:PrepareWasmSdks to run only the sdk installer?

jsturtevant avatar Apr 08 '25 20:04 jsturtevant

I'm getting the same problem:

$ dotnet build
Restore complete (0.5s)
You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy
  MyWasmApp failed with 1 error(s) (2.3s) → bin\Debug\net10.0\wasi-wasm\MyWasmApp.dll
    C:\Users\me\.nuget\packages\microsoft.dotnet.ilcompiler.llvm\10.0.0-alpha.1.25162.1\build\Microsoft.NETCore.Native.targets(409,5): error MSB3073: The command ""C:\Users\ray\.wasi-sdk\wasi-sdk-24.0/bin/wasm-component-ld" --version" exited with code 3.

Build failed with 1 error(s) in 3.4s

Running dotnet msbuild src/WitBindgen/build/BytecodeAlliance.Componentize.DotNet.WitBindgen.targets /t:PrepareWasmSdks ran without complaints.

But I still can't find wasm-component-ld

ray440 avatar Apr 23 '25 22:04 ray440

@ray440 does wasm-component-ld exist at the path? Are you on Windows or WSL? looks like the file path might be getting mixed up?

jsturtevant avatar Apr 24 '25 20:04 jsturtevant

@ray440 does wasm-component-ld exist at the path? Are you on Windows or WSL? looks like the file path might be getting mixed up?

I'm on Windows, in powershell. There are many problems: C:\Users\ray\.wasi-sdk\wasi-sdk-16.0\bin exists, but C:\Users\ray\.wasi-sdk\wasi-sdk-24.0 is empty. In either case wasm-component-ld doesn't exist anywhere. How do I set this up properly?

ray440 avatar Apr 24 '25 21:04 ray440

How do I set this up properly?

Got it. I had to manually extract wasi-sdk-24.0-x86_64-windows.tar.gz from releases to the appropriate directory, C:\Users\{login-name}\.wasi-sdk\wasi-sdk-24.0.

ray440 avatar Apr 28 '25 22:04 ray440

C:\Users\ray.wasi-sdk\wasi-sdk-16.0\bin exists, but C:\Users\ray.wasi-sdk\wasi-sdk-24.0 is empty.

It seems there might be some issue if a previous various already exists on the system. It is interesting that the fold was empty. In CI we always start from scratch so it might be there is a bug here somewhere

jsturtevant avatar May 12 '25 22:05 jsturtevant