Skip to content

Linker update broke dotnet/runtime wasm perf builds #2893

@radical

Description

@radical

The linker update from 7.0.100-1.22362.1 -> 7.0.100-1.22362.3 (https://github.com/dotnet/linker/compare/ef2d0f25b72469b55925251a79f..33a76b856466b) broke wasm/aot builds on the dotnet/runtime perf pipeline.

To reproduce:

  1. Install 7.0.100-rc.1.22363.25 sdk
  2. dotnet workload install wasm-tools --skip-manifest-update
  3. Download https://raw.githubusercontent.com/dotnet/runtime/main/src/mono/wasm/test-main.js into /tmp/data/test-main.js
  4. In a checkout for dotnet/performance, run:
$ python3 ./scripts/benchmarks_ci.py --csproj src/benchmarks/micro/MicroBenchmarks.csproj --incremental no --architecture x64 -f net7.0 --cli-source-info args --cli-branch refs/heads/main --cli-repository https://github.com/dotnet/runtime --run-isolated --wasm --bdn-artifacts artifacts/BenchmarkDotNet.Artifacts --bdn-arguments="--anyCategories Libraries Runtime  --category-exclusion-filter NoInterpreter NoWASM NoMono --buildTimeout 3600 --logBuildOutput --generateBinLog --aotcompilermode wasm --wasmDataDir /tmp/data"

The build will fail with:

/workspaces/performance/tools/dotnet/x64/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/7.0.0-preview.7.22362.3/Sdk/WasmApp.Native.targets(583,5):
   error : Precompiling failed for /workspaces/performance/artifacts/bin/for-running/MicroBenchmarks/7c61964b-30e6-4214-a6f1-8d79a98f5a50/bin/net7.0/browser-wasm/publish/OSExtensions.dll. [/workspaces/performance/artifacts/bin/for-running/MicroBenchmarks/7c61964b-30e6-4214-a6f1-8d79a98f5a50/BenchmarkDotNet.Autogenerated.csproj]
/workspaces/performance/tools/dotnet/x64/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/7.0.0-preview.7.22362.3/Sdk/WasmApp.Native.targets(583,5):
   error : Failed to load methodspec 0x2b000001 due to Methodnot found: int System.Runtime.InteropServices.Marshal.SizeOf<!0>(!!0). [/workspaces/performance/artifacts/bin/for-running/MicroBenchmarks/7c61964b-30e6-4214-a6f1-8d79a98f5a50/BenchmarkDotNet.Autogenerated.csproj]
/workspaces/performance/tools/dotnet/x64/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/7.0.0-preview.7.22362.3/Sdk/WasmApp.Native.targets(583,5):
   error : Run with MONO_LOG_LEVEL=debug for more information. [/workspaces/performance/artifacts/bin/for-running/MicroBenchmarks/7c61964b-30e6-4214-a6f1-8d79a98f5a50/BenchmarkDotNet.Autogenerated.csproj]
/workspaces/performance/tools/dotnet/x64/packs/Microsoft.NET.Runtime.WebAssembly.Sdk/7.0.0-preview.7.22362.3/Sdk/WasmApp.Native.targets(583,5):
   error : Unable to compile method 'void Microsoft.Diagnostics.Tracing.Extensions.ETWControl:EnableStackCaching (ulong)' due to: 'Method not found: void System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(int)'. [/workspaces/performance/artifacts/bin/for-running/MicroBenchmarks/7c61964b-30e6-4214-a6f1-8d79a98f5a50/BenchmarkDotNet.Autogenerated.csproj]

Looking at artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked, it shows only 10 assemblies. In a working build we get 145 assemblies.

artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/7c61964b-30e6-4214-a6f1-8d79a98f5a50.dll
artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/BenchmarkDotNet.dll
artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/System.Console.dll
artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/System.Linq.dll
artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/System.Private.CoreLib.dll
artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/System.Private.Uri.dll
artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net7.0/browser-wasm/linked/System.Runtime.InteropServices.JavaScript.dll
  • Wasm build uses the artifacts/bin/for-running/MicroBenchmarks/*/bin/net7.0/browser-wasm/publish folder for AOT, and that contains the same number of assemblies.
  • If I copy Sdks/Microsoft.NET.ILLink.Tasks from sdk 7.0.100-rc.1.22363.1, to the latest sdk 7.0.100-rc.1.22363.25, then it works fine.

Note: OSExtensions.dll is included as None, and shouldn't really be AOT'ed but that's a wasm issue, and should be irrelevant here. In previous builds, it worked fine with OSExtensions.dll also being processed for AOT.

Original issue: dotnet/runtime#72105

cc @lewing @vargaz @vitek-karas @marek-safar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions