Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BDN boilerplate project is not strong named for WASM AOT #2026

Closed
DrewScoggins opened this issue Sep 20, 2021 · 6 comments · Fixed by dotnet/BenchmarkDotNet#1811
Closed

BDN boilerplate project is not strong named for WASM AOT #2026

DrewScoggins opened this issue Sep 20, 2021 · 6 comments · Fixed by dotnet/BenchmarkDotNet#1811
Assignees
Labels
pipeline blocker issue blocks perf pipeline stays green. This be considered high priority.

Comments

@DrewScoggins
Copy link
Member

Looks like we have either stopped strong name signing, or never did and it was not an issue, the BDN boilerplate project. This is now causing issues in WASM AOT, where it seems we require a strong name.

[2021/09/20 09:54:00][INFO]  Standard error:
[2021/09/20 09:54:00][INFO]  Time Elapsed 00:00:21.90
[2021/09/20 09:54:00][INFO]     1 Error(s)
[2021/09/20 09:54:00][INFO]     1 Warning(s)
[2021/09/20 09:54:00][INFO] /home/helixbot/work/AB0D090C/p/dotnet-wasm/src/mono/wasm/build/WasmApp.Native.targets(501,5): error : Failed to get assembly name for /home/helixbot/work/AB0D090C/p/performance/artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net6.0/browser-wasm/wasm/for-publish/aot-in/KernelTraceControl.dll: PE image does not have metadata. [/home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/BenchmarkDotNet.Autogenerated.csproj]
[2021/09/20 09:54:00][INFO] CSC : warning CS8002: Referenced assembly 'MicroBenchmarks, Version=42.42.42.42, Culture=neutral, PublicKeyToken=null' does not have a strong name. [/home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/BenchmarkDotNet.Autogenerated.csproj]
[2021/09/20 09:54:00][INFO] Build FAILED.
[2021/09/20 09:54:00][INFO] /home/helixbot/work/AB0D090C/p/dotnet-wasm/src/mono/wasm/build/WasmApp.Native.targets(501,5): error : Failed to get assembly name for /home/helixbot/work/AB0D090C/p/performance/artifacts/obj/BenchmarkDotNet.Autogenerated/Release/net6.0/browser-wasm/wasm/for-publish/aot-in/KernelTraceControl.dll: PE image does not have metadata. [/home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/BenchmarkDotNet.Autogenerated.csproj]
[2021/09/20 09:54:00][INFO]   AOT'ing 150 assemblies
[2021/09/20 09:54:00][INFO]   BenchmarkDotNet.Autogenerated -> /home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/bin/net6.0/browser-wasm/publish/
[2021/09/20 09:54:00][INFO]   Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
[2021/09/20 09:54:00][INFO]   BenchmarkDotNet.Autogenerated -> /home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/bin/net6.0/browser-wasm/b8c41410-124f-4d7d-a3fa-ca559db6a6c7.dll
[2021/09/20 09:54:00][INFO]   BenchmarkDotNet.Autogenerated -> /home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/bin/net6.0/browser-wasm/publish/
[2021/09/20 09:54:00][INFO]   Optimizing assemblies for size, which may change the behavior of the app. Be sure to test after publishing. See: https://aka.ms/dotnet-illink
[2021/09/20 09:54:00][INFO]   BenchmarkDotNet.Autogenerated -> /home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/bin/net6.0/browser-wasm/b8c41410-124f-4d7d-a3fa-ca559db6a6c7.dll
[2021/09/20 09:54:00][INFO] CSC : warning CS8002: Referenced assembly 'MicroBenchmarks, Version=42.42.42.42, Culture=neutral, PublicKeyToken=null' does not have a strong name. [/home/helixbot/work/AB0D090C/p/performance/artifacts/bin/MicroBenchmarks/Release/net6.0/b8c41410-124f-4d7d-a3fa-ca559db6a6c7/BenchmarkDotNet.Autogenerated.csproj]
@naricc
Copy link

naricc commented Sep 20, 2021

This has the look of some check being enabled in the SDK that wasn't before. I will try to find out what it is and how to disable or satisfy it.

@lambdageek
Copy link
Member

KernelTraceControl.dll: PE image does not have metadata.

That looks like we're running the AOT compiler on a native .dll for some reason.

@lambdageek
Copy link
Member

lambdageek commented Sep 20, 2021

This is the related/known issue dotnet/runtime#46856

The best thing to do would be to exclude this KernelTraceControl.dll from the wasm (or really any non-Windows) build

@naricc
Copy link

naricc commented Sep 20, 2021

So it seems like the issue is that AOT compiler is trying to compile a native DLL. I am not sure exactly why this is coming up now; it is just trying to compile everything the ends up in the publish directory. Maybe a change in BDN added this?

Discussing with @radical, it seems like the AOT compiler should just skip any native assemblies it encounters, emitting a warning when doing so. I will make that change.

I think I can do this by using PEReader.HasMetadata around here: https://github.com/dotnet/runtime/blob/cf796613157e5d028ab292d4312c321b97fa94ed/src/tasks/AotCompilerTask/MonoAOTCompiler.cs#L879-L882

@naricc
Copy link

naricc commented Sep 20, 2021

Actually, the quickest solution might be to jsut fitler out that DLL from WasmAssembliesToBundle here: https://github.com/dotnet/BenchmarkDotNet/blob/38b99b9a038fb065312978995f2cb9223ad88417/src/BenchmarkDotNet/Templates/WasmAotCsProj.txt#L41

The proper solution belongs in the SDK somewhere, but may take time to work out.

@Lxiamail Lxiamail added the pipeline blocker issue blocks perf pipeline stays green. This be considered high priority. label Sep 21, 2021
@Lxiamail
Copy link
Member

wasm aot run is green now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pipeline blocker issue blocks perf pipeline stays green. This be considered high priority.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants