Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/StructuredLogger/BinaryLogger/BuildEventArgsReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,12 @@ private BuildEventArgs ReadProjectEvaluationFinishedEventArgs()
if (_fileFormatVersion >= 12)
{
IEnumerable globalProperties = null;
if (ReadBoolean())
// In newer versions, we store the global properties always, as it handles
// null and empty within WriteProperties already.
// This saves a single boolean, but mainly doesn't hide the difference between null and empty
// during write->read roundtrip.
if (_fileFormatVersion >= BinaryLogger.ForwardCompatibilityMinimalVersion ||
ReadBoolean())
{
globalProperties = ReadStringDictionary();
}
Expand Down Expand Up @@ -778,12 +783,12 @@ private BuildEventArgs ReadProjectStartedEventArgs()

if (_fileFormatVersion > 6)
{
if (_fileFormatVersion < BinaryLogger.ForwardCompatibilityMinimalVersion)
// See ReadProjectEvaluationFinishedEventArgs for details on why we always store global properties in newer version.
if (_fileFormatVersion >= BinaryLogger.ForwardCompatibilityMinimalVersion ||
ReadBoolean())
{
// Throw away, but need to advance past it
ReadBoolean();
globalProperties = ReadStringDictionary();
}
globalProperties = ReadStringDictionary();
}

var propertyList = ReadPropertyList();
Expand Down