dotnet / BenchmarkDotNet

Powerful .NET library for benchmarking
https://benchmarkdotnet.org
MIT License
10.55k stars 969 forks source link

Missing dotnet.wasm when building autogenerated project files #1732

Closed kg closed 2 years ago

kg commented 3 years ago

After I updated to the latest dotnet/performance to work on some benchmarks, I got a new and exciting error:

// Build Error: Exception! 
Message: Could not find file '/home/kate/Projects/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/Job-UGLDFF/bin/net6.0/browser-wasm/publish/dotnet.wasm'.,
Stack trace:
   at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) in System.Private.CoreLib.dll:token 0x600000a+0xc
   at Interop.CheckIo(Error error, String path, Boolean isDirectory, Func`2 errorRewriter) in System.Private.CoreLib.dll:token 0x600000b+0x3
   at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode) in System.Private.CoreLib.dll:token 0x60000ae+0x6d
   at System.IO.Strategies.Net5CompatFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x600598e+0x3c
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options) in System.Private.CoreLib.dll:token 0x60056b1+0x10d
   at System.IO.FileSystem.CopyFile(String sourceFullPath, String destFullPath, Boolean overwrite) in System.IO.FileSystem.dll:token 0x60001a0+0x1e
   at System.IO.File.Copy(String sourceFileName, String destFileName, Boolean overwrite) in System.IO.FileSystem.dll:token 0x60000dd+0x56
   at BenchmarkDotNet.Toolchains.MonoWasm.WasmBuilder.BuildApp(String programName, String projectRoot, WasmRuntime runtime) in BenchmarkDotNet.dll:token 0x6000208+0xfd
   at BenchmarkDotNet.Toolchains.MonoWasm.WasmBuilder.Build(GenerateResult generateResult, BuildPartition buildPartition, ILogger logger) in BenchmarkDotNet.dll:token 0x6000207+0x0
   at BenchmarkDotNet.Running.BenchmarkRunnerClean.Build(BuildPartition buildPartition, String rootArtifactsFolderPath, ILogger buildLogger) in BenchmarkDotNet.dll:token 0x600041e+0x32

// BenchmarkDotNet has failed to build the auto-generated boilerplate code.
// It can be found in /home/kate/Projects/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/Job-UGLDFF
// Please follow the troubleshooting guide: https://benchmarkdotnet.org/articles/guides/troubleshooting.html

Looking at the bin directory i see x86 and amd64 folders with native DLLs in them (this seems wrong?) and none of the wasm related files, not just dotnet.wasm is missing. It seems like for some reason it generated a native build of the benchmark?

The incantation I'm using to build/run the benchmarks is dotnet.sh run -f net6.0 -c Release --runtimes Wasm --cli ~/Projects/dotnet-runtime-wasm/dotnet.sh --wasmMainJs ~/Projects/dotnet-runtime-wasm/src/mono/wasm/runtime-test.js --customRuntimePack ~/Projects/dotnet-runtime-wasm/artifacts/bin/microsoft.netcore.app.runtime.browser-wasm/Release --wasmEngine $V8_PATH ${@:2} in the dotnet/performance repo's latest main rev, 47ed48cf73aeaace0db82d30d9e3f096a2b0b65f, which appears to be using BDN 0.13.0.1559.

adamsitnik commented 3 years ago

@naricc

naricc commented 3 years ago

I have reproduced this, but I don't know what is going on yet.

kg commented 3 years ago

Thanks, let me know if I can help with a binlog or something.

adamsitnik commented 3 years ago

@naricc was this fixed by #1734 or these are two different issues?

naricc commented 3 years ago

This is a different issue.

adamsitnik commented 2 years ago

I am unable to reproduce this issue when following instructions provided by @radical in https://github.com/dotnet/performance/pull/2612