KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.44k stars 190 forks source link

Item metadata appearing in parameter list with wrong indent #540

Closed zdavidsen closed 2 years ago

zdavidsen commented 2 years ago

Under some unknown circumstances, the log viewer displays multi-line item metadata in task parameters with the wrong indent, which makes it appear as multiple new parameters, after which it resumes the normal metadata indent for the remaining metadata entries

image

This same metadata is hidden behind a preview notice when the item is declared:

image

This is how that metadata is declared:

image

I tried several ways to reproduce the bug with a minimal example, but I haven't been able to so far, I'll go ahead and attach my attempts anyway. msbuild.xml.txt

It may also be worth noting that I'm attempting to reproduce in a different environment than produced the original log, because the original log came off of our build server

KirillOsenkov commented 2 years ago

Is this from a .binlog recorded by MSBuild or by building your project directly from the viewer? Any chance you could email me your binlog privately at my first name dot last name at Microsoft dot com? If you go to File -> Statistics, it will print the binlog version at the end of the tree, is the binlog version 14?

KirillOsenkov commented 2 years ago

Also what is the MSBuild version printed at the top of the log? I'm guessing you must be using older MSBuild on the build server.

I remember we had this bug long back but it has been fixed in MSBuild.

zdavidsen commented 2 years ago

This was a binlog recorded by msbuild.exe (build server is TeamCity and there's at least one intermediate exe that it spawns, so I'm not exactly sure), statistics say BinlogFileFormatVersion = 9 (I don't see any other nodes that look like versions), MSBuild version = "16.8.2+25e4d540b". I'll look into sending the binlog, just gotta clear it with management and make sure it doesn't include anything dangerous

KirillOsenkov commented 2 years ago

Ah, yes, no need to send the binlog. The MSBuild you’re using in TeamCity is too old. This was fixed in newer MSBuild (around 16.10 I think)