Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
[mono] Linux build fixes (#128)
Browse files Browse the repository at this point in the history
* [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.
  • Loading branch information
radical authored and marek-safar committed Oct 18, 2019
1 parent 89dc20a commit d482afe
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 8 deletions.
5 changes: 5 additions & 0 deletions eng/cibuild_bootstrapped_msbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion mono/build/extract_and_copy_hostfxr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions mono/build/install.proj
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,11 @@
<Exec
Condition="Exists('$(AllInstalledFiles_FileCanonical)')"
IgnoreExitCode="$(IgnoreDiffFailure)"
Command="sort -o $(AllInstalledFiles_File) $(AllInstalledFiles_File) ; diff -u $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_File)" />
Command="sort -o $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_FileCanonical) ; sort -o $(AllInstalledFiles_File) $(AllInstalledFiles_File) ; diff -u $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_File)" />

<Exec
Condition="Exists('$(RemainingFiles_FileCanonical)')"
IgnoreExitCode="$(IgnoreDiffFailure)"
Command="sort -o $(RemainingFiles_File) $(RemainingFiles_File); diff -u $(RemainingFiles_FileCanonical) $(RemainingFiles_File)" />
Command="sort -o $(RemainingFiles_FileCanonical) $(RemainingFiles_FileCanonical) ; sort -o $(RemainingFiles_File) $(RemainingFiles_File); diff -u $(RemainingFiles_FileCanonical) $(RemainingFiles_File)" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion mono/build/sdks_and_nugets/dotnet_resolver.proj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<ItemGroup>
<FilesToCopy
Include="$(DependencyNuPkgPath)/lib/net472/**"
OutputDirectory="$(DotnetSdkResolverDir)" />
OutputDirectory="$(DotNetSdkResolverDir)" />

</ItemGroup>
</Target>
Expand Down
9 changes: 6 additions & 3 deletions mono/build/sdks_and_nugets/update_sdks_and_nugets.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project DefaultTargets="DeploySdksAndNuGets">
<Import Project="$(MSBuildThisFileDirectory)\..\common.props" />
<Import Project="$(MSBuildThisFileDirectory)\..\DotnetBitsVersions.props" />
<Import Project="$(MSBuildThisFileDirectory)\..\DotNetBitsVersions.props" />

<PropertyGroup>
<HostOSName Condition="'$(HostOSName)' == ''">osx</HostOSName>
Expand Down Expand Up @@ -51,7 +51,7 @@
DependencyPackageName=Microsoft.DotNet.MSBuildSdkResolver;
DependencyPackageVersion=$(MicrosoftDotNetMSBuildSdkResolverVersion);
NuGetPackagesDir=$(NuGetPackagesDir);
DotnetSdkResolverDir=$(MSBuildSdkResolverOutDir)
DotNetSdkResolverDir=$(MSBuildSdkResolverOutDir)
</Properties>
</NuGetsToBundle>
</ItemGroup>
Expand All @@ -63,6 +63,9 @@
Targets="Restore;Build"
Properties="OutputDirectory=$(DotNetOverlayDirectory)\nuget-support\msbuild-bin"/>

<Exec Command="$(MSBuildThisFileDirectory)/../extract_and_copy_hostfxr.sh $(DotNetSdkVersionForLibHostFxr) $(MSBuildSdkResolverOutDir)" />
<!-- 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)" />
</Target>
</Project>
2 changes: 1 addition & 1 deletion mono/build/update_bundled_bits.proj
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project DefaultTargets="FetchAndUpdateSdksAndNuGets">
<Import Project="$(MSBuildThisFileDirectory)\DotnetBitsVersions.props" />
<Import Project="$(MSBuildThisFileDirectory)\DotNetBitsVersions.props" />

<Target Name="Build" DependsOnTargets="FetchAndUpdateSdksAndNuGets" />

Expand Down

0 comments on commit d482afe

Please sign in to comment.