diff --git a/.exp-insertions.yml b/.exp-insertions.yml index 40aa1dda370..dac0bddd22a 100644 --- a/.exp-insertions.yml +++ b/.exp-insertions.yml @@ -152,7 +152,7 @@ jobs: command: restore feedsToUse: config restoreSolution: '$(Build.SourcesDirectory)\eng\common\internal\Tools.csproj' - nugetConfigPath: '$(Build.SourcesDirectory)\NuGet.config' + nugetConfigPath: '$(Build.SourcesDirectory)\eng\common\internal\NuGet.config' restoreDirectory: '$(Build.SourcesDirectory)\.packages' # https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/1es-security-configuration/configuration-guides/pat-burndown-guidance#authentication-from-pipelines diff --git a/.vsts-dotnet.yml b/.vsts-dotnet.yml index 47280eea93c..103da2378bc 100644 --- a/.vsts-dotnet.yml +++ b/.vsts-dotnet.yml @@ -141,7 +141,7 @@ extends: command: restore feedsToUse: config restoreSolution: 'eng\common\internal\Tools.csproj' - nugetConfigPath: 'NuGet.config' + nugetConfigPath: 'eng\common\internal\NuGet.config' restoreDirectory: '$(Build.SourcesDirectory)\.packages' - task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1 diff --git a/documentation/specs/event-source.md b/documentation/specs/event-source.md index 4eef03f279b..198791bb356 100644 --- a/documentation/specs/event-source.md +++ b/documentation/specs/event-source.md @@ -45,7 +45,7 @@ EventSource is primarily used to profile code. For MSBuild specifically, a major One can run MSBuild with eventing using the following command: -`PerfView /OnlyProviders=*Microsoft-Build run MSBuild.exe ` +`PerfView /Providers=*Microsoft-Build run MSBuild.exe ` For example, if PerfView is one level up from my current directory (which has MSBuild.exe), and I want to build MSBuild.sln on Windows, I would use the following command: diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 15f6004cf7d..e9852d79c36 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -71,36 +71,36 @@ - + https://github.com/dotnet/arcade - c4bbc67763bf0c5a868862df874079380e647d61 + bac7e1caea791275b7c3ccb4cb75fd6a04a26618 - + https://github.com/dotnet/arcade - c4bbc67763bf0c5a868862df874079380e647d61 + bac7e1caea791275b7c3ccb4cb75fd6a04a26618 - + https://github.com/dotnet/arcade - c4bbc67763bf0c5a868862df874079380e647d61 + bac7e1caea791275b7c3ccb4cb75fd6a04a26618 - + https://github.com/nuget/nuget.client - c4b26195ee5a77e70b2ea5fd50db87d6a9194c24 + 3d42754f2962b30deac1ec48e5415aa83c071b37 - + https://github.com/dotnet/roslyn - cef17ee67990e8a447c7461bb94b4df7f0fb12ee + 19c9b9eb00ae9afa7bedb10bd6be06bb41a880f6 - + https://github.com/dotnet/roslyn - cef17ee67990e8a447c7461bb94b4df7f0fb12ee + 19c9b9eb00ae9afa7bedb10bd6be06bb41a880f6 - + https://github.com/dotnet/arcade - c4bbc67763bf0c5a868862df874079380e647d61 + bac7e1caea791275b7c3ccb4cb75fd6a04a26618 diff --git a/eng/Versions.props b/eng/Versions.props index 998c359b5ad..222dd4ab8ea 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -61,8 +61,8 @@ Otherwise, this version of dotnet will not be installed and the build will error out. --> $([System.Text.RegularExpressions.Regex]::Match($([System.IO.File]::ReadAllText('$(MSBuildThisFileDirectory)..\global.json')), '"dotnet": "([^"]*)"').Groups.get_Item(1)) 4.2.0-1.22102.8 - 9.0.0-beta.25065.2 - 4.13.0-3.25076.8 + 9.0.0-beta.25077.4 + 4.14.0-2.25111.1 6.13.0-rc.113 diff --git a/eng/common/internal/Tools.csproj b/eng/common/internal/Tools.csproj index 32f79dfb340..feaa6d20812 100644 --- a/eng/common/internal/Tools.csproj +++ b/eng/common/internal/Tools.csproj @@ -15,16 +15,6 @@ - - - - https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json; - - - $(RestoreSources); - https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json; - - diff --git a/eng/dependabot/Packages.props b/eng/dependabot/Packages.props index 7393d570b66..9760c0c6bc3 100644 --- a/eng/dependabot/Packages.props +++ b/eng/dependabot/Packages.props @@ -66,7 +66,7 @@ - + diff --git a/global.json b/global.json index 64e7669530a..eaefaede835 100644 --- a/global.json +++ b/global.json @@ -10,6 +10,6 @@ "xcopy-msbuild": "17.12.0" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25065.2" + "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25077.4" } } diff --git a/src/Build/BackEnd/Components/Logging/LoggingService.cs b/src/Build/BackEnd/Components/Logging/LoggingService.cs index aae5f4a2d47..c826b40c316 100644 --- a/src/Build/BackEnd/Components/Logging/LoggingService.cs +++ b/src/Build/BackEnd/Components/Logging/LoggingService.cs @@ -10,12 +10,12 @@ using System.Threading; using Microsoft.Build.BackEnd.Components.RequestBuilder; using Microsoft.Build.Evaluation; +using Microsoft.Build.Experimental.BuildCheck; using Microsoft.Build.Experimental.BuildCheck.Infrastructure; using Microsoft.Build.Framework; using Microsoft.Build.Shared; using InternalLoggerException = Microsoft.Build.Exceptions.InternalLoggerException; using LoggerDescription = Microsoft.Build.Logging.LoggerDescription; -using Microsoft.Build.Experimental.BuildCheck; #nullable disable @@ -62,7 +62,7 @@ internal enum LoggingServiceState ShuttingDown, /// - /// The logging service completly shutdown + /// The logging service completely shutdown. /// Shutdown } @@ -253,12 +253,14 @@ internal partial class LoggingService : ILoggingService, INodePacketHandler /// Event set when message is consumed from queue. /// private AutoResetEvent _dequeueEvent; + /// - /// Event set when queue become empty. + /// Event set when queue become empty. /// private ManualResetEvent _emptyQueueEvent; + /// - /// Even set when message is added into queue. + /// Event set when message is added into queue. /// private AutoResetEvent _enqueueEvent; @@ -1408,34 +1410,47 @@ private void StartLoggingEventProcessing() void LoggingEventProc() { var completeAdding = _loggingEventProcessingCancellation.Token; - WaitHandle[] waitHandlesForNextEvent = { completeAdding.WaitHandle, _enqueueEvent }; + WaitHandle[] waitHandlesForNextEvent = [completeAdding.WaitHandle, _enqueueEvent]; - do + try { - if (_eventQueue.TryDequeue(out object ev)) - { - LoggingEventProcessor(ev); - _dequeueEvent.Set(); - } - else - { - _emptyQueueEvent.Set(); + // Store field references locally to prevent race with cleanup + var eventQueue = _eventQueue; + var dequeueEvent = _dequeueEvent; + var emptyQueueEvent = _emptyQueueEvent; + var enqueueEvent = _enqueueEvent; - // Wait for next event, or finish. - if (!completeAdding.IsCancellationRequested && _eventQueue.IsEmpty) + do + { + if (eventQueue.TryDequeue(out object ev)) { - WaitHandle.WaitAny(waitHandlesForNextEvent); + LoggingEventProcessor(ev); + dequeueEvent?.Set(); } + else + { + emptyQueueEvent?.Set(); - _emptyQueueEvent.Reset(); - } - } while (!_eventQueue.IsEmpty || !completeAdding.IsCancellationRequested); + // Wait for next event, or finish. + if (!completeAdding.IsCancellationRequested && eventQueue.IsEmpty) + { + WaitHandle.WaitAny(waitHandlesForNextEvent); + } - _emptyQueueEvent.Set(); + emptyQueueEvent.Reset(); + } + } while (!eventQueue.IsEmpty || !completeAdding.IsCancellationRequested); + + emptyQueueEvent.Set(); + } + catch (ObjectDisposedException) + { + // Events/queue were disposed during shutdown, exit processing + return; + } } } - /// /// Clean resources used for logging event processing queue. /// @@ -1448,9 +1463,11 @@ private void CleanLoggingEventProcessing() _loggingEventProcessingCancellation?.Dispose(); _eventQueue = null; + _dequeueEvent = null; _enqueueEvent = null; _emptyQueueEvent = null; + _loggingEventProcessingCancellation = null; _loggingEventProcessingThread = null; } diff --git a/src/Build/BackEnd/Shared/BuildRequestConfiguration.cs b/src/Build/BackEnd/Shared/BuildRequestConfiguration.cs index 7108a74cca6..f90f99d14d3 100644 --- a/src/Build/BackEnd/Shared/BuildRequestConfiguration.cs +++ b/src/Build/BackEnd/Shared/BuildRequestConfiguration.cs @@ -299,7 +299,11 @@ public bool IsTraversal { if (!_isTraversalProject.HasValue) { - if (String.Equals(Path.GetFileName(ProjectFullPath), "dirs.proj", StringComparison.OrdinalIgnoreCase)) +#if NET471_OR_GREATER + if (MemoryExtensions.Equals(Microsoft.IO.Path.GetFileName(ProjectFullPath.AsSpan()), "dirs.proj".AsSpan(), StringComparison.OrdinalIgnoreCase)) +#else + if (MemoryExtensions.Equals(Path.GetFileName(ProjectFullPath.AsSpan()), "dirs.proj", StringComparison.OrdinalIgnoreCase)) +#endif { // dirs.proj are assumed to be traversals _isTraversalProject = true; diff --git a/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs b/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs index 0e4c160336f..dc2383d7034 100644 --- a/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs +++ b/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs @@ -1223,15 +1223,18 @@ private void EnsureParameterInitialized(TaskPropertyInfo parameter, Lookup looku string taskAndParameterName = _taskName + "_" + parameter.Name; string key = "DisableLogTaskParameter_" + taskAndParameterName; - string metadataKey = "DisableLogTaskParameterItemMetadata_" + taskAndParameterName; if (string.Equals(lookup.GetProperty(key)?.EvaluatedValue, "true", StringComparison.OrdinalIgnoreCase)) { parameter.Log = false; } - else if (string.Equals(lookup.GetProperty(metadataKey)?.EvaluatedValue, "true", StringComparison.OrdinalIgnoreCase)) + else { - parameter.LogItemMetadata = false; + string metadataKey = "DisableLogTaskParameterItemMetadata_" + taskAndParameterName; + if (string.Equals(lookup.GetProperty(metadataKey)?.EvaluatedValue, "true", StringComparison.OrdinalIgnoreCase)) + { + parameter.LogItemMetadata = false; + } } } diff --git a/src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd b/src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd index 607f6acafe9..05365f4f62a 100644 --- a/src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd +++ b/src/MSBuild/MSBuild/Microsoft.Build.CommonTypes.xsd @@ -162,6 +162,11 @@ elementFormDefault="qualified"> + + + Whether the types in this reference need to embedded into the target assembly - interop assemblies only (optional, boolean) + + diff --git a/src/Tasks/SystemState.cs b/src/Tasks/SystemState.cs index cf3ad3dad96..f85dc93eb7e 100644 --- a/src/Tasks/SystemState.cs +++ b/src/Tasks/SystemState.cs @@ -456,9 +456,7 @@ private AssemblyNameExtension GetAssemblyName(string path) // then we can short-circuit the File IO involved with GetAssemblyName() if (redistList != null) { - string extension = Path.GetExtension(path); - - if (string.Equals(extension, ".dll", StringComparison.OrdinalIgnoreCase)) + if (!string.IsNullOrEmpty(path) && path.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)) { IEnumerable assemblyNames = redistList.FindAssemblyNameFromSimpleName( Path.GetFileNameWithoutExtension(path));