Skip to content

Commit

Permalink
[msbuild] Install a deniedAssembliesList.txt to support denied ... (#…
Browse files Browse the repository at this point in the history
…5358)

... 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 -
mono/msbuild#23 .

cherry-pick 823bca4
  • Loading branch information
radical authored and Ankit Jain committed Aug 16, 2017
1 parent 7f9739d commit cbc738c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mcs/tools/xbuild/Makefile
Expand Up @@ -22,6 +22,7 @@ endif

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
Expand All @@ -39,7 +40,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
Expand Down Expand Up @@ -126,6 +127,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 \
Expand Down Expand Up @@ -168,6 +173,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 \
Expand Down
20 changes: 20 additions & 0 deletions mcs/tools/xbuild/data/deniedAssembliesList.txt
@@ -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
5 changes: 5 additions & 0 deletions mono/metadata/image.c
Expand Up @@ -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 {
Expand Down
15 changes: 15 additions & 0 deletions tools/nuget-hash-extractor/download.sh
@@ -1,5 +1,20 @@
mkdir nugets

##
## Following are nugets which have net4* implementation but that implementation is Windows specific and won’t work on Mono or
## with any profile derived from Mono net_4_x profile like Xamarin.Mac. This is due to no TFM for Mono or Xamarin.Mac which
## would allow us to customize the behaviors.
##
## 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
wget https://www.nuget.org/api/v2/package/System.Runtime.InteropServices.RuntimeInformation/4.0.0 -O nugets/system.runtime.interopservices.runtimeinformation.4.0.0.nupkg
Expand Down

0 comments on commit cbc738c

Please sign in to comment.