Buildalyzer icon indicating copy to clipboard operation
Buildalyzer copied to clipboard

after upgrade to 3.0.0/1 MsBuildPipeLogger is hanging for certain apps

Open ltcmelo opened this issue 4 years ago • 12 comments

I made a description of the issue, together with a PR in (your other) project.

ltcmelo avatar Jul 01 '20 19:07 ltcmelo

What OS are you using?

Can you share a problematic solution?

duncanawoods avatar Jul 10 '20 09:07 duncanawoods

I'm running both macos and linux (ubuntu), with .NET Core. I've come across a few projects in which the problem is reproducible, one of them is the music store sample (you might need to git reset the repo to the 3.1 tag).

Note that the buildalyzer does build the project successfully (through I call IProjectAnalyzer.Build, with/without specific targets), as I describe; the issue is the hanging.

ltcmelo avatar Jul 14 '20 17:07 ltcmelo

Another open source app example: https://github.com/HooliCorp/Goatly.NET

ltcmelo avatar Jul 21 '21 11:07 ltcmelo

There's been a lot of work around the pipe logger recently so I'm 🤞 this is resolved. I'm going to close the issue, but let me know if you're still seeing the problem on Buildalyzer 4.1.2 or later.

daveaglick avatar Mar 09 '22 20:03 daveaglick

I'm 🤞 this is resolved

It isn't :-)
To be thorough, it did work up to net5, but with net6 the incompatibilities around MsBuild emerged back.

ltcmelo avatar Nov 16 '22 13:11 ltcmelo

I'll take another look at this one - with the update to .NET 6 for Buildalyzer pending in #220 maybe that will help (though I'm doubtful - if the problem is that the .NET 6 MSBuild is doing something unexpected for these projects updating the Buildalyzer target won't resolve that).

daveaglick avatar Nov 29 '22 19:11 daveaglick

I can consistently reproduce this hanging:

  • Clone the example project https://github.com/HooliCorp/Goatly.NET
  • Clone this example program https://github.com/xavierpinho/BuildalyzerDemo
  • Run dotnet run --project BuildalyzerDemo/BuildalyzerDemo.csproj <path-to-GoatlyCore.sln-file>
  • (Hangs for 10 full minutes)

Here's the dotnet --info: dotnetinfo.txt.

After some debugging, here's what I noticed:

  • The hanging happens on PipeStream.Dispose. Stack trace: image

  • It enters MsBuildPipeLogger.ReadAll and MsBuildPipeLogger.Dispose twice (I guess because of the presence of .cshtml files), and it's only during the second iteration that the hanging occurs.

  • Oddly enough, if we start a new process while the first one is hanging, the second process won't hang. Could this be related?: https://github.com/dotnet/runtime/issues/63536

xavierpinho avatar Dec 30 '22 13:12 xavierpinho

Moreover, just noticed that the hanging is gone once we pass a TargetFramework property to MSBuild. See, e.g. https://github.com/xavierpinho/BuildalyzerDemo/blob/master/BuildalyzerDemo/Program.cs#L15. Rings any bell, perhaps?

xavierpinho avatar Feb 08 '23 10:02 xavierpinho

Same issue. .NET 7 and 6. Was using 4.1.6. Upgrading to latest version to see if it still happens, but I assume so since this bug is still open.

I only experience the issue on Linux and OS X.

wasabii avatar Oct 04 '23 17:10 wasabii

Yup. Broken in 5.0.1.

wasabii avatar Oct 04 '23 17:10 wasabii

I just released several fixes, including a bunch of reference updates. If anyone here is still using Buildalyzer, and still having this problem, I'd be curious if it's resolved in 6.0.3?

daveaglick avatar Dec 22 '23 15:12 daveaglick

It does not appear to have resolved it for me.

wasabii avatar Jan 28 '24 02:01 wasabii