From 2ec2a1e028e501c16006b60df52b98db190eccbd Mon Sep 17 00:00:00 2001 From: David Federman Date: Tue, 9 Jan 2024 11:00:30 -0800 Subject: [PATCH 1/4] Add FileAccessData Id and CorrelationId --- .../BackEnd/TaskHostTaskComplete_Tests.cs | 6 +++-- .../Communications/DetouredNodeLauncher.cs | 2 ++ src/Build/FileAccess/FileAccessData.cs | 27 +++++++++++++++++-- 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/Build.UnitTests/BackEnd/TaskHostTaskComplete_Tests.cs b/src/Build.UnitTests/BackEnd/TaskHostTaskComplete_Tests.cs index 23cf234576d..b6b6025441b 100644 --- a/src/Build.UnitTests/BackEnd/TaskHostTaskComplete_Tests.cs +++ b/src/Build.UnitTests/BackEnd/TaskHostTaskComplete_Tests.cs @@ -32,8 +32,10 @@ public void TestConstructors() new FileAccessData( ReportedFileOperation.CreateFile, RequestedAccess.Read, - 0, - 0, + processId: 123, + id: 1, + correlationId: 0, + error: 0, DesiredAccess.GENERIC_READ, FlagsAndAttributes.FILE_ATTRIBUTE_NORMAL, "foo", diff --git a/src/Build/BackEnd/Components/Communications/DetouredNodeLauncher.cs b/src/Build/BackEnd/Components/Communications/DetouredNodeLauncher.cs index a10c7b4eb8b..8bfb43b1ecb 100644 --- a/src/Build/BackEnd/Components/Communications/DetouredNodeLauncher.cs +++ b/src/Build/BackEnd/Components/Communications/DetouredNodeLauncher.cs @@ -173,6 +173,8 @@ public override void HandleFileAccess(FileAccessData fileAccessData) => _fileAcc (Experimental.FileAccess.ReportedFileOperation)fileAccessData.Operation, (Experimental.FileAccess.RequestedAccess)fileAccessData.RequestedAccess, fileAccessData.ProcessId, + fileAccessData.Id, + fileAccessData.CorrelationId, fileAccessData.Error, (Experimental.FileAccess.DesiredAccess)fileAccessData.DesiredAccess, (Experimental.FileAccess.FlagsAndAttributes)fileAccessData.FlagsAndAttributes, diff --git a/src/Build/FileAccess/FileAccessData.cs b/src/Build/FileAccess/FileAccessData.cs index 64cd45a92d4..7d66385def7 100644 --- a/src/Build/FileAccess/FileAccessData.cs +++ b/src/Build/FileAccess/FileAccessData.cs @@ -2,7 +2,6 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; - using Microsoft.Build.BackEnd; namespace Microsoft.Build.Experimental.FileAccess @@ -17,6 +16,8 @@ public struct FileAccessData private ReportedFileOperation _operation; private RequestedAccess _requestedAccess; private uint _processId; + private uint _id; + private uint _correlationId; private uint _error; private DesiredAccess _desiredAccess; private FlagsAndAttributes _flagsAndAttributes; @@ -28,6 +29,8 @@ public FileAccessData( ReportedFileOperation operation, RequestedAccess requestedAccess, uint processId, + uint id, + uint correlationId, uint error, DesiredAccess desiredAccess, FlagsAndAttributes flagsAndAttributes, @@ -38,6 +41,8 @@ public FileAccessData( _operation = operation; _requestedAccess = requestedAccess; _processId = processId; + _id = id; + _correlationId = correlationId; _error = error; _desiredAccess = desiredAccess; _flagsAndAttributes = flagsAndAttributes; @@ -56,7 +61,7 @@ public ReportedFileOperation Operation /// The requested access. public RequestedAccess RequestedAccess { - get => _requestedAccess; + readonly get => _requestedAccess; private set => _requestedAccess = value; } @@ -67,6 +72,22 @@ public uint ProcessId private set => _processId = value; } + /// Id of file access. + public uint Id + { + readonly get => _id; + private set => _id = value; + } + + + /// Correlation id of file access. + public uint CorrelationId + { + readonly get => _correlationId; + private set => _correlationId = value; + } + + /// The error code of the operation. public uint Error { @@ -114,6 +135,8 @@ void ITranslatable.Translate(ITranslator translator) translator.TranslateEnum(ref _operation, (int)_operation); translator.TranslateEnum(ref _requestedAccess, (int)_requestedAccess); translator.Translate(ref _processId); + translator.Translate(ref _id); + translator.Translate(ref _correlationId); translator.Translate(ref _error); translator.TranslateEnum(ref _desiredAccess, (int)_desiredAccess); translator.TranslateEnum(ref _flagsAndAttributes, (int)_flagsAndAttributes); From 671d929f38379ae71f20671d57bab51783a43e79 Mon Sep 17 00:00:00 2001 From: dfederm Date: Tue, 9 Jan 2024 13:12:13 -0800 Subject: [PATCH 2/4] Suppress API compat --- src/Build/CompatibilitySuppressions.xml | 32 +++++++++++++++++++++ src/Framework/CompatibilitySuppressions.xml | 9 ++---- src/Tasks/CompatibilitySuppressions.xml | 14 ++------- src/Utilities/CompatibilitySuppressions.xml | 9 ++---- 4 files changed, 38 insertions(+), 26 deletions(-) create mode 100644 src/Build/CompatibilitySuppressions.xml diff --git a/src/Build/CompatibilitySuppressions.xml b/src/Build/CompatibilitySuppressions.xml new file mode 100644 index 00000000000..3103304beec --- /dev/null +++ b/src/Build/CompatibilitySuppressions.xml @@ -0,0 +1,32 @@ + + + + + CP0002 + M:Microsoft.Build.Experimental.FileAccess.FileAccessData.#ctor(Microsoft.Build.Experimental.FileAccess.ReportedFileOperation,Microsoft.Build.Experimental.FileAccess.RequestedAccess,System.UInt32,System.UInt32,Microsoft.Build.Experimental.FileAccess.DesiredAccess,Microsoft.Build.Experimental.FileAccess.FlagsAndAttributes,System.String,System.String,System.Boolean) + lib/net472/Microsoft.Build.dll + lib/net472/Microsoft.Build.dll + true + + + CP0002 + M:Microsoft.Build.Experimental.FileAccess.FileAccessData.#ctor(Microsoft.Build.Experimental.FileAccess.ReportedFileOperation,Microsoft.Build.Experimental.FileAccess.RequestedAccess,System.UInt32,System.UInt32,Microsoft.Build.Experimental.FileAccess.DesiredAccess,Microsoft.Build.Experimental.FileAccess.FlagsAndAttributes,System.String,System.String,System.Boolean) + lib/net8.0/Microsoft.Build.dll + lib/net8.0/Microsoft.Build.dll + true + + + CP0002 + M:Microsoft.Build.Experimental.FileAccess.FileAccessData.#ctor(Microsoft.Build.Experimental.FileAccess.ReportedFileOperation,Microsoft.Build.Experimental.FileAccess.RequestedAccess,System.UInt32,System.UInt32,Microsoft.Build.Experimental.FileAccess.DesiredAccess,Microsoft.Build.Experimental.FileAccess.FlagsAndAttributes,System.String,System.String,System.Boolean) + ref/net472/Microsoft.Build.dll + ref/net472/Microsoft.Build.dll + true + + + CP0002 + M:Microsoft.Build.Experimental.FileAccess.FileAccessData.#ctor(Microsoft.Build.Experimental.FileAccess.ReportedFileOperation,Microsoft.Build.Experimental.FileAccess.RequestedAccess,System.UInt32,System.UInt32,Microsoft.Build.Experimental.FileAccess.DesiredAccess,Microsoft.Build.Experimental.FileAccess.FlagsAndAttributes,System.String,System.String,System.Boolean) + ref/net8.0/Microsoft.Build.dll + ref/net8.0/Microsoft.Build.dll + true + + \ No newline at end of file diff --git a/src/Framework/CompatibilitySuppressions.xml b/src/Framework/CompatibilitySuppressions.xml index 2545a39b99a..e45d8b2d23e 100644 --- a/src/Framework/CompatibilitySuppressions.xml +++ b/src/Framework/CompatibilitySuppressions.xml @@ -1,11 +1,6 @@  - - + PKV004 .NETCoreApp,Version=v2.0 @@ -54,4 +49,4 @@ PKV004 Xamarin.XboxOne,Version=v0.0 - + \ No newline at end of file diff --git a/src/Tasks/CompatibilitySuppressions.xml b/src/Tasks/CompatibilitySuppressions.xml index 9647c21c161..fc1bc1328af 100644 --- a/src/Tasks/CompatibilitySuppressions.xml +++ b/src/Tasks/CompatibilitySuppressions.xml @@ -1,10 +1,6 @@  - - + CP0007 T:Microsoft.Build.Tasks.AL @@ -71,12 +67,6 @@ ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll ref/net472/Microsoft.Build.Tasks.Core.dll - - PKV004 .NETCoreApp,Version=v2.0 @@ -125,4 +115,4 @@ PKV004 Xamarin.XboxOne,Version=v0.0 - + \ No newline at end of file diff --git a/src/Utilities/CompatibilitySuppressions.xml b/src/Utilities/CompatibilitySuppressions.xml index 2545a39b99a..e45d8b2d23e 100644 --- a/src/Utilities/CompatibilitySuppressions.xml +++ b/src/Utilities/CompatibilitySuppressions.xml @@ -1,11 +1,6 @@  - - + PKV004 .NETCoreApp,Version=v2.0 @@ -54,4 +49,4 @@ PKV004 Xamarin.XboxOne,Version=v0.0 - + \ No newline at end of file From 6686f7b086976ac519d616c89db0ae777bb30530 Mon Sep 17 00:00:00 2001 From: dfederm Date: Tue, 9 Jan 2024 13:16:11 -0800 Subject: [PATCH 3/4] Revert files I didn't mean to change --- src/Framework/CompatibilitySuppressions.xml | 9 +++++++-- src/Tasks/CompatibilitySuppressions.xml | 14 ++++++++++++-- src/Utilities/CompatibilitySuppressions.xml | 9 +++++++-- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/Framework/CompatibilitySuppressions.xml b/src/Framework/CompatibilitySuppressions.xml index e45d8b2d23e..2545a39b99a 100644 --- a/src/Framework/CompatibilitySuppressions.xml +++ b/src/Framework/CompatibilitySuppressions.xml @@ -1,6 +1,11 @@  - + + PKV004 .NETCoreApp,Version=v2.0 @@ -49,4 +54,4 @@ PKV004 Xamarin.XboxOne,Version=v0.0 - \ No newline at end of file + diff --git a/src/Tasks/CompatibilitySuppressions.xml b/src/Tasks/CompatibilitySuppressions.xml index fc1bc1328af..9647c21c161 100644 --- a/src/Tasks/CompatibilitySuppressions.xml +++ b/src/Tasks/CompatibilitySuppressions.xml @@ -1,6 +1,10 @@  - + + CP0007 T:Microsoft.Build.Tasks.AL @@ -67,6 +71,12 @@ ref/netstandard2.0/Microsoft.Build.Tasks.Core.dll ref/net472/Microsoft.Build.Tasks.Core.dll + + PKV004 .NETCoreApp,Version=v2.0 @@ -115,4 +125,4 @@ PKV004 Xamarin.XboxOne,Version=v0.0 - \ No newline at end of file + diff --git a/src/Utilities/CompatibilitySuppressions.xml b/src/Utilities/CompatibilitySuppressions.xml index e45d8b2d23e..2545a39b99a 100644 --- a/src/Utilities/CompatibilitySuppressions.xml +++ b/src/Utilities/CompatibilitySuppressions.xml @@ -1,6 +1,11 @@  - + + PKV004 .NETCoreApp,Version=v2.0 @@ -49,4 +54,4 @@ PKV004 Xamarin.XboxOne,Version=v0.0 - \ No newline at end of file + From 019f0f7f1ee9155562d2d8f88c39724fc5b62a2f Mon Sep 17 00:00:00 2001 From: David Federman Date: Fri, 12 Jan 2024 09:39:22 -0800 Subject: [PATCH 4/4] Update src/Build/CompatibilitySuppressions.xml Co-authored-by: Rainer Sigwald --- src/Build/CompatibilitySuppressions.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Build/CompatibilitySuppressions.xml b/src/Build/CompatibilitySuppressions.xml index 3103304beec..eebf61e063c 100644 --- a/src/Build/CompatibilitySuppressions.xml +++ b/src/Build/CompatibilitySuppressions.xml @@ -1,6 +1,7 @@  + CP0002 M:Microsoft.Build.Experimental.FileAccess.FileAccessData.#ctor(Microsoft.Build.Experimental.FileAccess.ReportedFileOperation,Microsoft.Build.Experimental.FileAccess.RequestedAccess,System.UInt32,System.UInt32,Microsoft.Build.Experimental.FileAccess.DesiredAccess,Microsoft.Build.Experimental.FileAccess.FlagsAndAttributes,System.String,System.String,System.Boolean)