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

Commit d482afe

Browse files
radicalmarek-safar
authored andcommitted
[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.
1 parent 89dc20a commit d482afe

File tree

6 files changed

+16
-8
lines changed

6 files changed

+16
-8
lines changed

eng/cibuild_bootstrapped_msbuild.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ function DownloadMSBuildForMono {
5757
# rename just to make it obvious when reading logs!
5858
mv $artifacts_dir/msbuild $mono_msbuild_dir
5959
chmod +x $artifacts_dir/mono-msbuild/MSBuild.dll
60+
61+
if [[ `uname -s` != 'Darwin' ]]; then
62+
# with no .so available, this ends up breaking the build
63+
rm -Rf $mono_msbuild_dir/SdkResolvers/Microsoft.DotNet.MSBuildSdkResolver
64+
fi
6065
rm "$msbuild_zip"
6166
fi
6267
}

mono/build/extract_and_copy_hostfxr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ OLDCWD=`pwd`
4444
cd $TMPDIR
4545

4646
GetDotNetInstallScript $TMPDIR
47-
sh ./dotnet-install.sh --version $1 --install-dir $DOTNET_DIR --architecture x64 --runtime dotnet --skip-non-versioned-files
47+
bash ./dotnet-install.sh --version $1 --install-dir $DOTNET_DIR --architecture x64 --runtime dotnet --skip-non-versioned-files
4848
find $DOTNET_DIR -name libhostfxr.dylib | xargs -I {} cp -v {} $DESTDIR
4949

5050
cd $OLDCWD

mono/build/install.proj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@
182182
<Exec
183183
Condition="Exists('$(AllInstalledFiles_FileCanonical)')"
184184
IgnoreExitCode="$(IgnoreDiffFailure)"
185-
Command="sort -o $(AllInstalledFiles_File) $(AllInstalledFiles_File) ; diff -u $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_File)" />
185+
Command="sort -o $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_FileCanonical) ; sort -o $(AllInstalledFiles_File) $(AllInstalledFiles_File) ; diff -u $(AllInstalledFiles_FileCanonical) $(AllInstalledFiles_File)" />
186186

187187
<Exec
188188
Condition="Exists('$(RemainingFiles_FileCanonical)')"
189189
IgnoreExitCode="$(IgnoreDiffFailure)"
190-
Command="sort -o $(RemainingFiles_File) $(RemainingFiles_File); diff -u $(RemainingFiles_FileCanonical) $(RemainingFiles_File)" />
190+
Command="sort -o $(RemainingFiles_FileCanonical) $(RemainingFiles_FileCanonical) ; sort -o $(RemainingFiles_File) $(RemainingFiles_File); diff -u $(RemainingFiles_FileCanonical) $(RemainingFiles_File)" />
191191
</Target>
192192
</Project>

mono/build/sdks_and_nugets/dotnet_resolver.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ItemGroup>
99
<FilesToCopy
1010
Include="$(DependencyNuPkgPath)/lib/net472/**"
11-
OutputDirectory="$(DotnetSdkResolverDir)" />
11+
OutputDirectory="$(DotNetSdkResolverDir)" />
1212

1313
</ItemGroup>
1414
</Target>

mono/build/sdks_and_nugets/update_sdks_and_nugets.proj

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project DefaultTargets="DeploySdksAndNuGets">
22
<Import Project="$(MSBuildThisFileDirectory)\..\common.props" />
3-
<Import Project="$(MSBuildThisFileDirectory)\..\DotnetBitsVersions.props" />
3+
<Import Project="$(MSBuildThisFileDirectory)\..\DotNetBitsVersions.props" />
44

55
<PropertyGroup>
66
<HostOSName Condition="'$(HostOSName)' == ''">osx</HostOSName>
@@ -51,7 +51,7 @@
5151
DependencyPackageName=Microsoft.DotNet.MSBuildSdkResolver;
5252
DependencyPackageVersion=$(MicrosoftDotNetMSBuildSdkResolverVersion);
5353
NuGetPackagesDir=$(NuGetPackagesDir);
54-
DotnetSdkResolverDir=$(MSBuildSdkResolverOutDir)
54+
DotNetSdkResolverDir=$(MSBuildSdkResolverOutDir)
5555
</Properties>
5656
</NuGetsToBundle>
5757
</ItemGroup>
@@ -63,6 +63,9 @@
6363
Targets="Restore;Build"
6464
Properties="OutputDirectory=$(DotNetOverlayDirectory)\nuget-support\msbuild-bin"/>
6565

66-
<Exec Command="$(MSBuildThisFileDirectory)/../extract_and_copy_hostfxr.sh $(DotNetSdkVersionForLibHostFxr) $(MSBuildSdkResolverOutDir)" />
66+
<!-- Ignoring the .so for linux, because it works on a smaller set of distributions -->
67+
<Exec
68+
Condition="'$([MSBuild]::IsOSPlatform(OSX))'"
69+
Command="$(MSBuildThisFileDirectory)/../extract_and_copy_hostfxr.sh $(DotNetSdkVersionForLibHostFxr) $(MSBuildSdkResolverOutDir)" />
6770
</Target>
6871
</Project>

mono/build/update_bundled_bits.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<Project DefaultTargets="FetchAndUpdateSdksAndNuGets">
2-
<Import Project="$(MSBuildThisFileDirectory)\DotnetBitsVersions.props" />
2+
<Import Project="$(MSBuildThisFileDirectory)\DotNetBitsVersions.props" />
33

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

0 commit comments

Comments
 (0)