You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that our usage of BuildEngine.LogCustomEvent() causes Xamarin.Android builds to hang when running on .NET 5. We are currently working toward Android support in .NET 6.
I originally thought Xamarin.Build.AsyncTask was at fault. But then I attached a debugger and saw weird behavior after the first LogCustomEvent() call. After this I was seeing Log.LogMessage() calls go through that did not appear in the MSBuild log output. I even saw Execute() return successfully, but the build appears to be stuck at this point. There still may be something we are doing wrong in Xamarin.Build.AsyncTask, let me know.
We can comment out all the LogCustomEvent() calls to fix the issue. It also appears to work fine on .NET framework and Mono.
Steps to Reproduce
Use this project on the dotnet-build-hang branch, and follow the installation instructions on the README:
While .NET framework MSBuild doesn't use this at all.
Versions & Configurations
> dotnet msbuild /version
Microsoft (R) Build Engine version 16.8.0-preview-20475-05+aed5e7ed0 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
16.8.0.47505
Windows 10 1903
Attach a binlog
.binlog is not very useful as I had to kill the process, I used -flp:Verbosity=diag to get more info:
Issue Description
It appears that our usage of
BuildEngine.LogCustomEvent()
causes Xamarin.Android builds to hang when running on .NET 5. We are currently working toward Android support in .NET 6.I originally thought Xamarin.Build.AsyncTask was at fault. But then I attached a debugger and saw weird behavior after the first
LogCustomEvent()
call. After this I was seeingLog.LogMessage()
calls go through that did not appear in the MSBuild log output. I even sawExecute()
return successfully, but the build appears to be stuck at this point. There still may be something we are doing wrong in Xamarin.Build.AsyncTask, let me know.We can comment out all the
LogCustomEvent()
calls to fix the issue. It also appears to work fine on .NET framework and Mono.Steps to Reproduce
Use this project on the
dotnet-build-hang
branch, and follow the installation instructions on the README:https://github.com/xamarin/net6-samples/tree/dotnet-build-hang
Run this command with an Android emulator or device attached:
Removing
-v:diag
also solves the issue as well.Expected Behavior
dotnet build
completes.Actual Behavior
dotnet build
will block indefinitely. Ctrl+C does not stop either, you will need to kill the process.Analysis
One thing I noticed that may/may not be related is that
dotnet build
uses the-distributedlogger
switch:While .NET framework MSBuild doesn't use this at all.
Versions & Configurations
Windows 10 1903
Attach a binlog
.binlog
is not very useful as I had to kill the process, I used-flp:Verbosity=diag
to get more info:logs.zip
The text was updated successfully, but these errors were encountered: