Skip to content

improve wasm support#3020

Open
FreyLuis wants to merge 12 commits intodotnet:masterfrom
twobrainsgmbh:improve-wasm
Open

improve wasm support#3020
FreyLuis wants to merge 12 commits intodotnet:masterfrom
twobrainsgmbh:improve-wasm

Conversation

@FreyLuis
Copy link
Contributor

@FreyLuis FreyLuis commented Feb 22, 2026

This PR aims to improve WASM support (as described in #2890) in a few ways:

  • Benchmarking WASM on Windows is now supported.
  • Running on node.js is now supported.
  • The JavaScriptEngine now resolves executables from the PATH.
  • A new mainJsTemplatePath option allows customizing the startup script (with polyfill, for example).
  • Removed unnecessary --wasmDataDir option, that was used by dotnet/performance to set WasmMainJSPath.
  • Removed outdated --expose_wasm as default args for javaScriptEngineArguments.
  • run-selected-tests pipeline fixed with wasm

AOT currently fails because the unit tests set only MonoAotCompilerMode and not the WasmRuntimes aot option. I've fixed the test and disabled it for now.

@FreyLuis FreyLuis changed the title Improve wasm improve wasm support Feb 22, 2026
@timcassell
Copy link
Collaborator

AOT currently fails because the unit tests set only MonoAotCompilerMode and not the WasmRuntimes aot option. I've fixed the test and disabled it for now.

Looking at the code, WasmRuntime.Aot isn't actually used. The toolchain passes aot: netCoreAppSettings.AOTCompilerMode == MonoAotLLVM.MonoAotCompilerMode.wasm to the generator. If the tests are failing, it's due to your changes. They should not be disabled.

@FreyLuis
Copy link
Contributor Author

Looking at the code, WasmRuntime.Aot isn't actually used. The toolchain passes aot: netCoreAppSettings.AOTCompilerMode == MonoAotLLVM.MonoAotCompilerMode.wasm to the generator.

It is used right here which then sets the RunAOTCompilation flag.

I have a ci run without the last commit on main, that worked. It seems like the switch to the Microsoft.NET.Sdk.WebAssembly causes some issues with my changes. I'll see if i can fix that later.

@timcassell
Copy link
Collaborator

It is used right here which then sets the RunAOTCompilation flag.

Oh, duh, not sure how I missed that. What a mess, that could use some cleanup, too. So the test was never actually testing aot.

@timcassell
Copy link
Collaborator

I have a ci run without the last commit on main, that worked. It seems like the switch to the Microsoft.NET.Sdk.WebAssembly causes some issues with my changes. I'll see if i can fix that later.

Maybe the wwwroot is necessary? I also have a green CI run where I had it running on node, with minimal other changes to the toolchain (besides the async refactor and mjs changes for websocket).

@FreyLuis
Copy link
Contributor Author

I don't know why the build doesn't fail in the ci, it crashes on my windows machine with the following errors:

    C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.IntegrationTests.FSharp\release_net8.0\BenchmarkDotNet.IntegrationTests.FSharp.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests.FSharp\BenchmarkDotNet.IntegrationTests.FSharp.fsproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.IntegrationTests.VisualBasic\release_net8.0\BenchmarkDotNet.IntegrationTests.VisualBasic.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests.VisualBasic\BenchmarkDotNet.IntegrationTests.VisualBasic.vbproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.Diagnostics.dotTrace\release_net8.0\BenchmarkDotNet.Diagnostics.dotTrace.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\src\BenchmarkDotNet.Diagnostics.dotTrace\BenchmarkDotNet.Diagnostics.dotTrace.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.Diagnostics.dotMemory\release_net8.0\BenchmarkDotNet.Diagnostics.dotMemory.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\src\BenchmarkDotNet.Diagnostics.dotMemory\BenchmarkDotNet.Diagnostics.dotMemory.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.IntegrationTests.Static\release_net8.0\BenchmarkDotNet.IntegrationTests.Static.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests.Static\BenchmarkDotNet.IntegrationTests.Static.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.IntegrationTests.EnabledOptimizations\release_net8.0\BenchmarkDotNet.IntegrationTests.EnabledOptimizations.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests.EnabledOptimizations\BenchmarkDotNet.IntegrationTests.EnabledOptimizations.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.IntegrationTests.DisabledOptimizations\release_net8.0\BenchmarkDotNet.IntegrationTests.DisabledOptimizations.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests.DisabledOptimizations\BenchmarkDotNet.IntegrationTests.DisabledOptimizations.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Microsoft.Common.CurrentVersion.targets(4903,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net462\BenchmarkDotNet.IntegrationTests-1/.artifacts/\obj\BenchmarkDotNet.IntegrationTests.ConfigPerAssembly\release_net8.0\BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.dll" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests.ConfigPerAssembly\BenchmarkDotNet.IntegrationTests.ConfigPerAssembly.csproj::TargetFramework=net8.0]

It does work with a minimal project (including main.js path).
The main.js error seems to only happen in the integration tests...

I'll see if i can fix this tomorrow.

@FreyLuis FreyLuis marked this pull request as ready for review February 24, 2026 21:53
@FreyLuis
Copy link
Contributor Author

FreyLuis commented Feb 24, 2026

@timcassell It works now.

The IntigrationTests still fail while building the dllgatherer on windows on my pc, but i couldn't reproduce it on another machine or with another project.

Like I wrote in the description, this does remove the --wasmDataDir argument and breaks the current state of dotnet/performance. There is already a PR that removes it.

I've noticed an odd behavior that I did not want to touch: When I set KeepBenchmarkFiles to true and build the project twice, it references all dlls from the previous build. I'm not sure if BenchmarkDotNet should delete the dlls before reusing the folder or build in another folder instead.

@timcassell
Copy link
Collaborator

The IntigrationTests still fail while building the dllgatherer on windows on my pc, but i couldn't reproduce it on another machine or with another project.

What's the error?

I've noticed an odd behavior that I did not want to touch: When I set KeepBenchmarkFiles to true and build the project twice, it references all dlls from the previous build. I'm not sure if BenchmarkDotNet should delete the dlls before reusing the folder or build in another folder instead.

KeepBenchmarkFiles is intended for debugging. The user is expected to delete it before running benchmarks again. I don't think we need to do anything about it.

@FreyLuis
Copy link
Contributor Author

What's the error?

    // start dotnet  build "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj" -f net8.0 -c Release --no-restore --no-dependencies --nodeReuse:false /p:UseSharedCompilation=false /p:Deterministic=true /p:Optimize=true -bl:BenchmarkDotNet.IntegrationTests-1-build-no-restore-no-deps.binlog in C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1
C:\Users\luis\.nuget\packages\verify\31.12.5\buildTransitive\Verify.props(70,5): warning : No solution files found. Unable to auto-discover SolutionDir and SolutionName. Verify searches for .slnx and .sln files in the project directory 'C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1', parent directory, and parent's parent directory. To resolve this, either add a solution file to one of these locations, or explicitly set SolutionDir and SolutionName via command line: /p:SolutionDir="C:\Path\To\Solution\" /p:SolutionName="MySolution" [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
  BenchmarkDotNet.Autogenerated -> C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1.dll
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\pt-BR\Microsoft.TestPlatform.CommunicationUtilities.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\pt-BR\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hans\Microsoft.TestPlatform.CommunicationUtilities.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hans\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hant\Microsoft.TestPlatform.CommunicationUtilities.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hant\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
Build FAILED.
C:\Users\luis\.nuget\packages\verify\31.12.5\buildTransitive\Verify.props(70,5): warning : No solution files found. Unable to auto-discover SolutionDir and SolutionName. Verify searches for .slnx and .sln files in the project directory 'C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1', parent directory, and parent's parent directory. To resolve this, either add a solution file to one of these locations, or explicitly set SolutionDir and SolutionName via command line: /p:SolutionDir="C:\Path\To\Solution\" /p:SolutionName="MySolution" [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\pt-BR\Microsoft.TestPlatform.CommunicationUtilities.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\pt-BR\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hans\Microsoft.TestPlatform.CommunicationUtilities.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hans\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hant\Microsoft.TestPlatform.CommunicationUtilities.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
C:\Program Files\dotnet\sdk\10.0.103\Sdks\Microsoft.NET.Sdk.StaticWebAssets\targets\Microsoft.NET.Sdk.StaticWebAssets.Publish.targets(212,5): error MSB3030: Could not copy the file "C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\bin\Release\net8.0\wwwroot\_framework\zh-Hant\Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.wasm" because it was not found. [C:\Users\luis\source\libraries\BenchmarkDotNet\BenchmarkDotNet\tests\BenchmarkDotNet.IntegrationTests\bin\Release\net8.0\BenchmarkDotNet.IntegrationTests-1\BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net8.0]
    1 Warning(s)
    6 Error(s)
Time Elapsed 00:00:39.44

Looks like the error happened while building BenchmarkDotNet.Autogenerated. The dllgatherer only crashed because I didn't build the project before running the IntigrationTests. All those files do exist.

BenchmarkDotNet.IntegrationTests-1-build-no-restore-no-deps.binlog.zip

@timcassell
Copy link
Collaborator

Looks like there's a merge conflict.

@FreyLuis
Copy link
Contributor Author

Looks like there's a merge conflict.

Should be fixed now.

https://github.com/twobrainsgmbh/BenchmarkDotNet/actions/runs/22404078490

<WasmTargetsPath>$([System.IO.Path]::ChangeExtension('$(OriginalCSProjPath)', '.Wasm.targets'))</WasmTargetsPath>
<WasmDataDir>$WASMDATADIR$</WasmDataDir>
<WasmDataDir Condition="'$(WasmDataDir)' != ''">$([MSBuild]::NormalizeDirectory($(WasmDataDir)))</WasmDataDir>
<WasmMainJSPath>$MAINJS$</WasmMainJSPath>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ilonatommy You recently changed away from this property, what are your thoughts here?

@timcassell timcassell linked an issue Feb 27, 2026 that may be closed by this pull request
@timcassell
Copy link
Collaborator

Copy link
Member

@pavelsavara pavelsavara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but wait for Ilona's review

if (globalThis.arguments !== undefined)
return globalThis.arguments;

// spdermonkey
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

[Theory]
[InlineData(MonoAotCompilerMode.mini)]
[InlineData(MonoAotCompilerMode.wasm)]
[InlineData(MonoAotCompilerMode.wasm, Skip = "AOT is broken")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add link to active issue. What's wrong with it ?

File.WriteAllText(targetMainJsPath, content);
}

protected override string GetExecutablePath(string binariesDirectoryPath, string programName) => Path.Combine(binariesDirectoryPath, "wwwroot", "main.js");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I think the modern convention is to use .mjs extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve wasm support

3 participants