Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the MIT license. See License.txt in the project root for full license information. -->
<Project>
<PropertyGroup>
<VersionPrefix>17.13.12</VersionPrefix>
<VersionPrefix>17.13.13</VersionPrefix>
<DotNetFinalVersionKind>release</DotNetFinalVersionKind>
<PackageValidationBaselineVersion>17.12.6</PackageValidationBaselineVersion>
<AssemblyVersion>15.1.0.0</AssemblyVersion>
Expand Down
7 changes: 7 additions & 0 deletions src/Build/BackEnd/Components/Logging/LoggingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ internal enum LoggingServiceState
/// </summary>
internal partial class LoggingService : ILoggingService, INodePacketHandler
{
/// <summary>
/// Gets or sets a value if BuildCheck is enabled. The presence of this flag influences the logging logic.
/// </summary>
private bool _buildCheckEnabled;

/// <summary>
/// The default maximum size for the logging event queue.
/// </summary>
Expand Down Expand Up @@ -871,6 +876,8 @@ public void InitializeComponent(IBuildComponentHost buildComponentHost)
_serviceState = LoggingServiceState.Initialized;

_buildEngineDataRouter = (buildComponentHost.GetComponent(BuildComponentType.BuildCheckManagerProvider) as IBuildCheckManagerProvider)?.BuildEngineDataRouter;

_buildCheckEnabled = buildComponentHost.BuildParameters.IsBuildCheckEnabled;
}
}

Expand Down
11 changes: 8 additions & 3 deletions src/Build/BackEnd/Components/Logging/LoggingServiceLogMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,15 @@ public void LogProjectFinished(BuildEventContext projectBuildEventContext, strin
buildEvent.BuildEventContext = projectBuildEventContext;
ProcessLoggingEvent(buildEvent);

// PERF: Not using VerifyThrow to avoid boxing of projectBuildEventContext.ProjectContextId in the non-error case.
if (!_projectFileMap.TryRemove(projectBuildEventContext.ProjectContextId, out _))
// BuildCheck can still emit some LogBuildEvent(s) after ProjectFinishedEventArgs was reported.
// Due to GetAndVerifyProjectFileFromContext validation, these checks break the build.
if (!_buildCheckEnabled)
{
ErrorUtilities.ThrowInternalError("ContextID {0} for project {1} should be in the ID-to-file mapping!", projectBuildEventContext.ProjectContextId, projectFile);
// PERF: Not using VerifyThrow to avoid boxing of projectBuildEventContext.ProjectContextId in the non-error case.
if (!_projectFileMap.TryRemove(projectBuildEventContext.ProjectContextId, out _))
{
ErrorUtilities.ThrowInternalError("ContextID {0} for project {1} should be in the ID-to-file mapping!", projectBuildEventContext.ProjectContextId, projectFile);
}
}
}

Expand Down
Loading