File copy_hostfxr.patch of Package msbuild
diff -urNad msbuild-16.9.old/eng/cibuild_bootstrapped_msbuild.sh msbuild-16.9/eng/cibuild_bootstrapped_msbuild.sh
--- msbuild-16.9.old/eng/cibuild_bootstrapped_msbuild.sh 2021-04-15 11:57:47.842467086 -0400
+++ msbuild-16.9/eng/cibuild_bootstrapped_msbuild.sh 2021-04-15 11:58:07.890620649 -0400
@@ -62,6 +62,7 @@
# rename just to make it obvious when reading logs!
mv $artifacts_dir/msbuild $mono_msbuild_dir
chmod +x $artifacts_dir/mono-msbuild/MSBuild.dll
+ cp /usr/lib/mono/msbuild/Current/bin/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/libhostfxr.so $artifacts_dir/mono-msbuild/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver/
if [[ `uname -s` != 'Darwin' ]]; then
# with no .so available, this ends up breaking the build
Index: xamarin-pkg-msbuild/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj
===================================================================
--- xamarin-pkg-msbuild.orig/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj
+++ xamarin-pkg-msbuild/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj
@@ -63,7 +63,6 @@
<!-- Ignoring the .so for linux, because it works on a smaller set of distributions -->
<Exec
- Condition="'$([MSBuild]::IsOSPlatform(OSX))'"
Command="$(MSBuildThisFileDirectory)/../extract_and_copy_hostfxr.sh $(DotNetSdkVersionForLibHostFxr) $(MSBuildSdkResolverOutDir)" />
<Exec Command="$(MSBuildThisFileDirectory)/../get_sdk_files.sh $(DotNetOverlayDirectory)\msbuild-bin" />
</Target>