[msbuild] Install a `deniedAssembliesList.txt` to support denied ... (#5358)
authorAnkit Jain <radical@gmail.com>
Wed, 16 Aug 2017 03:51:29 +0000 (23:51 -0400)
committerGitHub <noreply@github.com>
Wed, 16 Aug 2017 03:51:29 +0000 (23:51 -0400)
... assemblies.

msbuild tries to filter out the denied assemblies, which mono refuses to
load, during a build. It uses the `deniedAssembliesList.txt` installed
to `$mono_prefix/lib/mono/xbuild` to identify them.

This was generated with:

 `$ mono tools/nuget-hash-extractor/nuget-hash-extractor.exe nugets guids_for_msbuild > mcs/tools/xbuild/data/deniedAssembliesList.txt`

This file needs to be kept in sync with any changes in the assemblies
denied by the runtime.

msbuild PR that adds support for this -
https://github.com/mono/msbuild/pull/23 .

mcs/tools/xbuild/Makefile
mcs/tools/xbuild/data/deniedAssembliesList.txt [new file with mode: 0644]
mono/metadata/image.c
tools/nuget-hash-extractor/download.sh

index 406829f8021e462580eb1fbdd272df99a1602f0f..20268929bff93d35118ce83778a464fe510710cc 100644 (file)
@@ -18,6 +18,7 @@ install-local: install-extras
 
 PORTABLE_TARGETS_SRC:=data/Portable/Targets
 PCL5_FX_SRC:=data/Portable/Frameworks/v5.0
+DENIED_ASSEMBLY_LIST_SRC=data/deniedAssembliesList.txt
 
 NETFRAMEWORK_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETFramework
 PCL5_FX_DIR=$(mono_libdir)/mono/xbuild-frameworks/.NETPortable/v5.0
@@ -35,7 +36,7 @@ endif
 install-versioned-files: install-bin-data install-nuget-imports
 
 #install files that are only installed once across all xbuild versions
-install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets
+install-global-files: install-frameworks install-web-targets install-pcl-targets install-pcl5-framework install-nuget-targets install-msbuild-specific-files
 
 install-bin-data:
        $(MKINSTALLDIRS) $(DESTDIR)$(XBUILD_BIN_DIR)/MSBuild
@@ -122,6 +123,10 @@ install-pcl5-framework:
        $(INSTALL_DATA) "$(PCL5_FX_SRC)/ASP.NET Core 1.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/ASP.NET Core 1.0.xml"
        $(INSTALL_DATA) "$(PCL5_FX_SRC)/Windows Universal 10.0.xml" "$(DESTDIR)$(PCL5_FX_DIR)/SupportedFrameworks/Windows Universal 10.0.xml"
 
+install-msbuild-specific-files:
+       $(MKINSTALLDIRS) $(DESTDIR)$(mono_libdir)/mono/xbuild
+       $(INSTALL_DATA) $(DENIED_ASSEMBLY_LIST_SRC) $(DESTDIR)$(mono_libdir)/mono/xbuild
+
 EXTRA_DISTFILES = \
        data/xbuild.rsp \
        data/xbuild.exe.config.in \
@@ -164,6 +169,7 @@ EXTRA_DISTFILES = \
        "data/Portable/Frameworks/v5.0/ASP.NET Core 1.0.xml" \
        "data/Portable/Frameworks/v5.0/FrameworkList.xml" \
        "data/Portable/Frameworks/v5.0/Windows Universal 10.0.xml" \
+       data/deniedAssembliesList.txt \
        frameworks/net_2.0.xml \
        frameworks/net_3.0.xml \
        frameworks/net_3.5.xml \
diff --git a/mcs/tools/xbuild/data/deniedAssembliesList.txt b/mcs/tools/xbuild/data/deniedAssembliesList.txt
new file mode 100644 (file)
index 0000000..7b653e1
--- /dev/null
@@ -0,0 +1,20 @@
+System.Globalization.Extensions.dll,475DBF02-9F68-44F1-8FB5-C9F69F1BD2B1,4,0,0,0
+System.Globalization.Extensions.dll,5FCD54F0-4B97-4259-875D-30E481F02EA2,4,0,1,0
+System.Globalization.Extensions.dll,E9FCFF5B-4DE1-4BDC-9CE8-08C640FC78CC,4,0,2,0
+System.IO.Compression.dll,44FCA06C-A510-4B3E-BDBF-D08D697EF65A,4,1,0,0
+System.IO.Compression.dll,3A58A219-266B-47C3-8BE8-4E4F394147AB,4,1,2,0
+System.Net.Http.dll,269B562C-CC15-4736-B1B1-68D4A43CAA98,4,1,0,0
+System.Net.Http.dll,EA2EC6DC-51DD-479C-BFC2-E713FB9E7E47,4,1,0,1
+System.Net.Http.dll,C0E04D9C-70CF-48A6-A179-FBFD8CE69FD0,4,1,1,0
+System.Net.Http.dll,817F01C3-4011-477D-890A-98232B85553D,4,1,1,0
+System.Net.Http.dll,09D4A140-061C-4884-9B63-22067E841931,4,1,1,1
+System.Reflection.DispatchProxy.dll,E40AFEB4-CABE-4124-8412-B46AB79C92FD,4,0,0,0
+System.Reflection.DispatchProxy.dll,2A69F0AD-B86B-40F2-8E4C-5B671E47479F,4,0,1,0
+System.Reflection.DispatchProxy.dll,D4E8D2DB-BD65-4168-99EA-D2C1BDEBF9CC,4,0,2,0
+System.Runtime.InteropServices.RuntimeInformation.dll,F13660F8-9D0D-419F-BA4E-315693DD26EA,4,0,0,0
+System.Runtime.InteropServices.RuntimeInformation.dll,DD91439F-3167-478E-BD2C-BF9C036A1395,4,0,1,0
+System.Text.Encoding.CodePages.dll,C142254F-DEB5-46A7-AE43-6F10320D1D1F,4,0,1,0
+System.Text.Encoding.CodePages.dll,FD178CD4-EF4F-44D5-9C3F-812B1E25126B,4,0,2,0
+System.Threading.Overlapped.dll,9F5D4F09-787A-458A-BA08-553AA71470F1,4,0,0,0
+System.Threading.Overlapped.dll,FCBD003B-2BB4-4940-BAEF-63AF520C2336,4,0,1,0
+System.Threading.Overlapped.dll,87697E71-D192-4F0B-BAD4-02BBC7793005,4,0,2,0
index 827ba841c3d5ec61836f1d62c42356499427340b..5c952efa4ac27f5d8ad2943c8a3a382781f58567 100644 (file)
@@ -1113,6 +1113,11 @@ Right now the list of nugets are the ones that provide the assemblies in $ignore
 
 This is to be removed once a proper fix is shipped through nuget.
 
+Please keep this in sync with mcs/tools/xbuild/data/deniedAssembliesList.txt
+If any assemblies are added/removed, then this should be regenerated with:
+
+  $ mono tools/nuget-hash-extractor/nuget-hash-extractor.exe nugets guids_for_msbuild > mcs/tools/xbuild/data/deniedAssembliesList.txt
+
 */
 
 typedef enum {
index 375666e3b6b0702371cc3eb210239f1a4853db09..3e413ea253107644245ceff1bfca38695d987e78 100755 (executable)
@@ -8,6 +8,12 @@ mkdir nugets
 ## We don’t want to fix all broken nugets we only focus on few system-like that are likely to be used by broad audience and
 ## we have working implementation available in one of Mono assemblies.
 ##
+## PLEASE keep this in sync with mcs/tools/xbuild/data/deniedAssembliesList.txt
+##
+## If any nugets are added or removed here, then make sure to regenerate the above file with:
+##
+##   $ mono nuget-hash-extractor.exe nugets guids_for_msbuild > ../../mcs/tools/xbuild/data/deniedAssembliesList.txt
+##
 
 #System.Runtime.InteropServices.RuntimeInformation
 wget https://www.nuget.org/api/v2/package/System.Runtime.InteropServices.RuntimeInformation/4.3.0 -O nugets/system.runtime.interopservices.runtimeinformation.4.3.0.nupkg