aboutsummaryrefslogtreecommitdiffstats
path: root/community/dotnet6-build/msbuild_optional-systemsecurity.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/dotnet6-build/msbuild_optional-systemsecurity.patch')
-rw-r--r--community/dotnet6-build/msbuild_optional-systemsecurity.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/community/dotnet6-build/msbuild_optional-systemsecurity.patch b/community/dotnet6-build/msbuild_optional-systemsecurity.patch
new file mode 100644
index 00000000000..02429f96be8
--- /dev/null
+++ b/community/dotnet6-build/msbuild_optional-systemsecurity.patch
@@ -0,0 +1,32 @@
+From 06707ec777769f1756230caf54391302e4378777 Mon Sep 17 00:00:00 2001
+Patch-Source: https://src.fedoraproject.org/rpms/dotnet6.0/blob/src/msbuild/rawhide/f/msbuild-no-systemsecurity.patch
+From: Antoine Martin <dev@ayakael.net>
+Date: Fri, 21 Oct 2022 14:13:29 -0400
+Subject: [PATCH 2/2] optional-systemsecurity
+
+Fix mono-specific runtime crashes running msbuild. CoreCLR does not
+load types that are not actually used/invoked at runtime, while mono
+does. System.Configuration and System.Security are missing in
+source-build builds, which breaks msbuild.
+
+---
+ src/Shared/ExceptionHandling.cs | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/msbuild/src/Shared/ExceptionHandling.cs b/src/msbuild/src/Shared/ExceptionHandling.cs
+index 16a0576b5..1c7cd5967 100644
+--- a/src/msbuild/src/Shared/ExceptionHandling.cs
++++ b/src/msbuild/src/Shared/ExceptionHandling.cs
+@@ -153,7 +153,9 @@ namespace Microsoft.Build.Shared
+ internal static bool IsXmlException(Exception e)
+ {
+ return e is XmlException
++#if FEATURE_SECURITY_PERMISSIONS
+ || e is XmlSyntaxException
++#endif
+ || e is XmlSchemaException
+ || e is UriFormatException; // XmlTextReader for example uses this under the covers
+ }
+--
+2.36.3
+