From f3757e29e95fdb1c7a66ded7933da8b41dffd816 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Wed, 19 Jul 2023 14:18:05 -0700 Subject: [PATCH 1/3] Address unused suppressions --- .../src/CompatibilitySuppressions.xml | 14 +------------- .../System/Runtime/InteropServices/Marshal.Com.cs | 2 +- .../src/CompatibilitySuppressions.Browser.xml | 9 +++++++++ .../src/CompatibilitySuppressions.xml | 8 +------- ...ystem.Runtime.InteropServices.JavaScript.csproj | 3 ++- 5 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.Browser.xml diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml index c410fee4e530d..d5fbde8e348dc 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/CompatibilitySuppressions.xml @@ -800,10 +800,6 @@ CP0001 T:System.Diagnostics.DebugAnnotations - - CP0001 - T:System.Diagnostics.DebuggerGuidedStepThroughAttribute - CP0001 T:System.MDArray @@ -868,10 +864,6 @@ CP0001 T:System.Reflection.RuntimeAssemblyName - - CP0001 - T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute - CP0001 T:System.Runtime.CompilerServices.ForceDictionaryLookupsAttribute @@ -1006,8 +998,4 @@ ref/net8.0/System.Private.CoreLib.dll lib/net8.0/System.Private.CoreLib.dll - - CP0016 - M:System.Runtime.InteropServices.Marshal.GetObjectForNativeVariant``1(System.IntPtr)->T?:[T:System.Diagnostics.CodeAnalysis.MaybeNullAttribute] - - \ No newline at end of file + diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs index ba72bcaad12f3..a1af61b3a03c2 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs @@ -345,7 +345,7 @@ public static object GetObjectForIUnknown(IntPtr pUnk) [return: MaybeNull] [SupportedOSPlatform("windows")] [EditorBrowsable(EditorBrowsableState.Never)] - public static T GetObjectForNativeVariant(IntPtr pSrcNativeVariant) + public static T? GetObjectForNativeVariant(IntPtr pSrcNativeVariant) { throw new NotSupportedException(SR.PlatformNotSupported_ComInterop); } diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.Browser.xml b/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.Browser.xml new file mode 100644 index 0000000000000..5f6463b613136 --- /dev/null +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.Browser.xml @@ -0,0 +1,9 @@ + + + + CP0001 + T:System.Runtime.InteropServices.JavaScript.WebWorker + ref/net8.0/System.Runtime.InteropServices.JavaScript.dll + runtimes/browser/lib/net8.0/System.Runtime.InteropServices.JavaScript.dll + + diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.xml b/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.xml index ce09898be3a45..0f9c4fcf9fb0f 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.xml +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.xml @@ -43,12 +43,6 @@ ref/net8.0/System.Runtime.InteropServices.JavaScript.dll runtimes/browser/lib/net8.0/System.Runtime.InteropServices.JavaScript.dll - - CP0001 - T:System.Runtime.InteropServices.JavaScript.WebWorker - ref/net8.0/System.Runtime.InteropServices.JavaScript.dll - runtimes/browser/lib/net8.0/System.Runtime.InteropServices.JavaScript.dll - CP0001 T:System.Runtime.InteropServices.JavaScript.CancelablePromise @@ -67,4 +61,4 @@ ref/net8.0/System.Runtime.InteropServices.JavaScript.dll runtimes/browser/lib/net8.0/System.Runtime.InteropServices.JavaScript.dll - \ No newline at end of file + diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj index 3cc3478d9f491..532dec1f15f36 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj @@ -77,6 +77,7 @@ + @@ -90,7 +91,7 @@ - + From 0dc40f2354d0c3e2d34a00b4b3497b754c16e433 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 21 Jul 2023 09:46:47 -0700 Subject: [PATCH 2/3] Remove unnecssary MaybeNullAttribute --- .../src/System/Runtime/InteropServices/Marshal.Com.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs index a1af61b3a03c2..18828c7ad17f7 100644 --- a/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs +++ b/src/coreclr/nativeaot/System.Private.CoreLib/src/System/Runtime/InteropServices/Marshal.Com.cs @@ -342,7 +342,6 @@ public static object GetObjectForIUnknown(IntPtr pUnk) } } - [return: MaybeNull] [SupportedOSPlatform("windows")] [EditorBrowsable(EditorBrowsableState.Never)] public static T? GetObjectForNativeVariant(IntPtr pSrcNativeVariant) From 53410d0c3c61e13fb7be6d37724a21f2ea25877f Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Fri, 21 Jul 2023 10:14:29 -0700 Subject: [PATCH 3/3] Ensure ApiCompatSuppressionFile is set in outer build --- ....Browser.xml => CompatibilitySuppressions.WasmThreads.xml} | 0 .../src/System.Runtime.InteropServices.JavaScript.csproj | 4 +++- 2 files changed, 3 insertions(+), 1 deletion(-) rename src/libraries/System.Runtime.InteropServices.JavaScript/src/{CompatibilitySuppressions.Browser.xml => CompatibilitySuppressions.WasmThreads.xml} (100%) diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.Browser.xml b/src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.WasmThreads.xml similarity index 100% rename from src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.Browser.xml rename to src/libraries/System.Runtime.InteropServices.JavaScript/src/CompatibilitySuppressions.WasmThreads.xml diff --git a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj index 532dec1f15f36..33a44fdb05cd7 100644 --- a/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj +++ b/src/libraries/System.Runtime.InteropServices.JavaScript/src/System.Runtime.InteropServices.JavaScript.csproj @@ -77,7 +77,9 @@ - + + +