From d482afec88b303303905958653fa906e65b2a1c2 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Fri, 18 Oct 2019 14:46:10 +0530 Subject: [PATCH] [mono] Linux build fixes (#128) * [mono] Fix casing for `DotNet*` to be consistent and match the file on .. disk. * [mono] Remove Microsoft.DotNet.MSBuildSdkResolver on linux for the .. bootstrap build. This is because it depends on a native lib, libhostfxr*, which is not present in the bootrap msbuild, which breaks the resolver and thus the build. Removing this should be fine, because msbuild then just falls back to the bundled SDKs. * [mono] Run the dotnet-install.sh script with `bash` instead of `sh` as .. it breaks for `set -o pipefail` on ubuntu 16.04 . * [mono] Skip copying the native lib, libhostfxr* for Linux .. because this might or might not work on whatever distribution we are actually building on. * [mono] Sort both canonical and new files list, as the order can differ .. between linux and macOS. --- eng/cibuild_bootstrapped_msbuild.sh | 5 +++++ mono/build/extract_and_copy_hostfxr.sh | 2 +- mono/build/install.proj | 4 ++-- mono/build/sdks_and_nugets/dotnet_resolver.proj | 2 +- mono/build/sdks_and_nugets/update_sdks_and_nugets.proj | 9 ++++++--- mono/build/update_bundled_bits.proj | 2 +- 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/eng/cibuild_bootstrapped_msbuild.sh b/eng/cibuild_bootstrapped_msbuild.sh index 44d64ce58a8..d94bfda7bd6 100755 --- a/eng/cibuild_bootstrapped_msbuild.sh +++ b/eng/cibuild_bootstrapped_msbuild.sh @@ -57,6 +57,11 @@ function DownloadMSBuildForMono { # rename just to make it obvious when reading logs! mv $artifacts_dir/msbuild $mono_msbuild_dir chmod +x $artifacts_dir/mono-msbuild/MSBuild.dll + + if [[ `uname -s` != 'Darwin' ]]; then + # with no .so available, this ends up breaking the build + rm -Rf $mono_msbuild_dir/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver + fi rm "$msbuild_zip" fi } diff --git a/mono/build/extract_and_copy_hostfxr.sh b/mono/build/extract_and_copy_hostfxr.sh index f4281bd9007..d4b70026b7b 100755 --- a/mono/build/extract_and_copy_hostfxr.sh +++ b/mono/build/extract_and_copy_hostfxr.sh @@ -44,7 +44,7 @@ OLDCWD=`pwd` cd $TMPDIR GetDotNetInstallScript $TMPDIR -sh ./dotnet-install.sh --version $1 --install-dir $DOTNET_DIR --architecture x64 --runtime dotnet --skip-non-versioned-files +bash ./dotnet-install.sh --version $1 --install-dir $DOTNET_DIR --architecture x64 --runtime dotnet --skip-non-versioned-files find $DOTNET_DIR -name libhostfxr.dylib | xargs -I {} cp -v {} $DESTDIR cd $OLDCWD diff --git a/mono/build/install.proj b/mono/build/install.proj index 93f5eeebb23..ed01b27d7c1 100644 --- a/mono/build/install.proj +++ b/mono/build/install.proj @@ -182,11 +182,11 @@ + Command="sort -o $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_FileCanonical) ; sort -o $(AllInstalledFiles_File) $(AllInstalledFiles_File) ; diff -u $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_File)" /> + Command="sort -o $(RemainingFiles_FileCanonical) $(RemainingFiles_FileCanonical) ; sort -o $(RemainingFiles_File) $(RemainingFiles_File); diff -u $(RemainingFiles_FileCanonical) $(RemainingFiles_File)" /> diff --git a/mono/build/sdks_and_nugets/dotnet_resolver.proj b/mono/build/sdks_and_nugets/dotnet_resolver.proj index 9606cac3166..de689ce23d8 100644 --- a/mono/build/sdks_and_nugets/dotnet_resolver.proj +++ b/mono/build/sdks_and_nugets/dotnet_resolver.proj @@ -8,7 +8,7 @@ + OutputDirectory="$(DotNetSdkResolverDir)" /> diff --git a/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj b/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj index c3670ea1d23..9d7db181732 100644 --- a/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj +++ b/mono/build/sdks_and_nugets/update_sdks_and_nugets.proj @@ -1,6 +1,6 @@ - + osx @@ -51,7 +51,7 @@ DependencyPackageName=Microsoft.DotNet.MSBuildSdkResolver; DependencyPackageVersion=$(MicrosoftDotNetMSBuildSdkResolverVersion); NuGetPackagesDir=$(NuGetPackagesDir); - DotnetSdkResolverDir=$(MSBuildSdkResolverOutDir) + DotNetSdkResolverDir=$(MSBuildSdkResolverOutDir) @@ -63,6 +63,9 @@ Targets="Restore;Build" Properties="OutputDirectory=$(DotNetOverlayDirectory)\nuget-support\msbuild-bin"/> - + + diff --git a/mono/build/update_bundled_bits.proj b/mono/build/update_bundled_bits.proj index eb4cee4d726..0f9ebd3a1eb 100644 --- a/mono/build/update_bundled_bits.proj +++ b/mono/build/update_bundled_bits.proj @@ -1,5 +1,5 @@ - +