Fix build on ppc64le and s390x

This commit is contained in:
Omair Majid 2023-06-01 18:26:50 -04:00
parent 4fd04b3643
commit 6d7669732a
4 changed files with 94 additions and 7 deletions

View File

@ -68,9 +68,9 @@ Source0: %{tarball_name}.tar.xz
# Generated via ./build-arm64-bootstrap-tarball
Source1: dotnet-arm64-prebuilts-2023-05-17.tar.gz
# Generated manually, same pattern as the arm64 tarball
#Source2: dotnet-ppc64le-prebuilts-2022-10-21.tar.gz
Source2: dotnet-ppc64le-prebuilts-2023-05-18.tar.gz
# Generated manually, same pattern as the arm64 tarball
#Source3: dotnet-s390x-prebuilts-2022-10-12.tar.gz
Source3: dotnet-s390x-prebuilts-2023-05-25.tar.gz
%else
# For non-releases, the source is generated on a Fedora box via:
# ./build-dotnet-tarball %%{upstream_tag} or commit
@ -87,10 +87,13 @@ Source21: dotnet.sh.in
# Disable apphost; there's no net6.0 apphost for ppc64le
Patch1: roslyn-analyzers-ppc64le-apphost.patch
# https://github.com/dotnet/source-build/discussions/3481
Patch2: nuget-client-use-net8.0.patch
Patch3: fsharp-use-net8.0.patch
Patch4: vstest-intent-net8.0.patch
%if 0%{?fedora} || 0%{?rhel} >= 8
#ExclusiveArch: aarch64 ppc64le s390x x86_64
ExclusiveArch: aarch64 x86_64
ExclusiveArch: aarch64 ppc64le s390x x86_64
%else
ExclusiveArch: x86_64
%endif
@ -114,7 +117,12 @@ BuildRequires: libicu-devel
%if ! %{use_bundled_libunwind}
BuildRequires: libunwind-devel
%endif
%ifnarch s390x
BuildRequires: lld
%else
# lld is not supported/available/usable on s390x
BuildRequires: binutils
%endif
# If the build ever crashes, then having lldb installed might help the
# runtime generate a backtrace for the crash
BuildRequires: lldb
@ -394,15 +402,15 @@ boot_sdk_version=$(ls -1 .dotnet/sdk/)
sed -i -E 's|"dotnet": "[^"]+"|"dotnet" : "'$boot_sdk_version'"|' global.json
%ifarch ppc64le s390x
ilasm_version=$(ls packages/prebuilt| grep -i ilasm | tr 'A-Z' 'a-z' | sed -E 's|runtime.linux-'%{runtime_arch}'.microsoft.netcore.ilasm.||' | sed -E 's|.nupkg$||')
ilasm_version=$(ls prereqs/packages/prebuilt| grep -i ilasm | tr 'A-Z' 'a-z' | sed -E 's|runtime.linux-'%{runtime_arch}'.microsoft.netcore.ilasm.||' | sed -E 's|.nupkg$||')
echo $ilasm_version
mkdir -p packages-customized-local
pushd packages-customized-local
tar xf ../packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz
tar xf ../prereqs/packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz
sed -i -E 's|<MicrosoftNETCoreILAsmVersion>[^<]+</MicrosoftNETCoreILAsmVersion>|<MicrosoftNETCoreILAsmVersion>'$ilasm_version'</MicrosoftNETCoreILAsmVersion>|' PackageVersions.props
sed -i -E 's|<MicrosoftNETCoreILDAsmVersion>[^<]+</MicrosoftNETCoreILDAsmVersion>|<MicrosoftNETCoreILDAsmVersion>'$ilasm_version'</MicrosoftNETCoreILDAsmVersion>|' PackageVersions.props
tar czf ../packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz *
tar czf ../prereqs/packages/archive/Private.SourceBuilt.Artifacts.*.tar.gz *
popd
%endif

11
fsharp-use-net8.0.patch Normal file
View File

@ -0,0 +1,11 @@
--- a/src/fsharp/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj
+++ b/src/fsharp/src/Microsoft.FSharp.Compiler/Microsoft.FSharp.Compiler.fsproj
@@ -3,7 +3,7 @@
<PropertyGroup>
<PreRelease>true</PreRelease>
<OutputType>Exe</OutputType>
- <TargetFramework>net7.0</TargetFramework>
+ <TargetFramework>net8.0</TargetFramework>
<NuspecFile>Microsoft.FSharp.Compiler.nuspec</NuspecFile>
<IsPackable>true</IsPackable>
<PackageDescription>.NET Core compatible version of the F# compiler fsc.exe.</PackageDescription>

View File

@ -0,0 +1,55 @@
From https://github.com/dotnet/source-build/discussions/3481
--- a/src/nuget-client/build/common.project.props
+++ a/src/nuget-client/build/common.project.props
@@ -14,7 +14,7 @@
<NETFXTargetFrameworkVersion>v4.7.2</NETFXTargetFrameworkVersion>
<NETFXTargetFramework>net472</NETFXTargetFramework>
<NETCoreTargetFramework>netcoreapp3.1</NETCoreTargetFramework>
- <NETCoreTargetFramework Condition="'$(DotNetBuildFromSource)' == 'true'">net7.0</NETCoreTargetFramework>
+ <NETCoreTargetFramework Condition="'$(DotNetBuildFromSource)' == 'true'">net8.0</NETCoreTargetFramework>
<NETCoreTestTargetFrameworks>net7.0;net8.0</NETCoreTestTargetFrameworks>
<NetStandardVersion>netstandard2.0</NetStandardVersion>
<TargetFrameworksExe>$(NETFXTargetFramework);$(NETCoreTargetFramework)</TargetFrameworksExe>
@@ -24,7 +24,7 @@
<TargetFrameworksExeForSigning Condition="'$(DotNetBuildFromSource)' == 'true'">$(TargetFrameworksExe);net7.0</TargetFrameworksExeForSigning>
<MinimalTargetFrameworksExeSigning>$(NETFXTargetFramework);netcoreapp5.0</MinimalTargetFrameworksExeSigning>
<MinimalTargetFrameworksExeSigning Condition=" '$(IsXPlat)' == 'true' ">netcoreapp5.0</MinimalTargetFrameworksExeSigning>
- <MinimalTargetFrameworksExeSigning Condition="'$(DotNetBuildFromSource)' == 'true'">net7.0</MinimalTargetFrameworksExeSigning>
+ <MinimalTargetFrameworksExeSigning Condition="'$(DotNetBuildFromSource)' == 'true'">net8.0</MinimalTargetFrameworksExeSigning>
<TargetFrameworksLibrary>$(NETFXTargetFramework);$(NetStandardVersion)</TargetFrameworksLibrary>
<TargetFrameworksLibrary Condition="'$(DotNetBuildFromSource)' == 'true'">$(NETCoreTargetFramework);$(NetStandardVersion)</TargetFrameworksLibrary>
<TargetFrameworksLibraryForSigning>$(TargetFrameworksLibrary);netcoreapp5.0</TargetFrameworksLibraryForSigning>
--- a/src/nuget-client/build/common.targets
+++ b/src/nuget-client/build/common.targets
@@ -6,7 +6,7 @@
<IsDesktop>true</IsDesktop>
</PropertyGroup>
- <PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp')) OR $(TargetFramework.StartsWith('netstandard')) OR $(TargetFramework.StartsWith('net6')) OR $(TargetFramework.StartsWith('net7')) ">
+ <PropertyGroup Condition=" $(TargetFramework.StartsWith('netcoreapp')) OR $(TargetFramework.StartsWith('netstandard')) OR $(TargetFramework.StartsWith('net6')) OR $(TargetFramework.StartsWith('net7')) OR $(TargetFramework.StartsWith('net8')) ">
<DefineConstants>$(DefineConstants);IS_CORECLR</DefineConstants>
<IsCore>true</IsCore>
</PropertyGroup>
--- a/src/nuget-client/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj
+++ a/src/nuget-client/src/NuGet.Core/NuGet.Configuration/NuGet.Configuration.csproj
@@ -26,7 +26,7 @@
<Reference Include="System.Xml.Linq" />
</ItemGroup>
- <ItemGroup Condition=" '$(TargetFramework)' == '$(NetStandardVersion)' or '$(TargetFramework)' == 'net7.0' ">
+ <ItemGroup Condition=" '$(TargetFramework)' == '$(NetStandardVersion)' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="System.Security.Cryptography.ProtectedData" />
</ItemGroup>
--- a/src/nuget-client/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj
+++ b/src/nuget-client/src/NuGet.Core/NuGet.PackageManagement/NuGet.PackageManagement.csproj
@@ -32,7 +32,7 @@
<Reference Include="System.Net.Http" />
</ItemGroup>
- <ItemGroup Condition=" '$(TargetFramework)' == '$(NetStandardVersion)' or '$(TargetFramework)' == 'net7.0' ">
+ <ItemGroup Condition=" '$(TargetFramework)' == '$(NetStandardVersion)' or '$(TargetFramework)' == 'net7.0' or '$(TargetFramework)' == 'net8.0' ">
<PackageReference Include="System.ComponentModel.Composition" />
</ItemGroup>

View File

@ -0,0 +1,13 @@
diff --git a/src/vstest/test/Intent/Intent.csproj b/src/vstest/test/Intent/Intent.csproj
index bb711c9256..6d0b199a9b 100644
--- a/src/vstest/test/Intent/Intent.csproj
+++ b/src/vstest/test/Intent/Intent.csproj
@@ -2,7 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
- <TargetFramework>net6.0</TargetFramework>
+ <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>