Update to .NET Core Runtime 5.0.0 and SDK 5.0.100

This commit is contained in:
Omair Majid 2020-12-04 17:09:37 -05:00
parent 260d2eab64
commit 1204433667
9 changed files with 1293 additions and 157 deletions

View File

@ -1,6 +1,6 @@
# Overview # Overview
This is the .NET Core 5.0 package for Fedora. This is the .NET 5.0 package for Fedora.
This package is maintained by the Fedora DotNet SIG (Special Interest This package is maintained by the Fedora DotNet SIG (Special Interest
Group). You can find out more about the DotNet SIG at: Group). You can find out more about the DotNet SIG at:

1184
SHAHashProvider.Browser.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
diff --git a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/PublishCoreSetupBinaries.cs b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/PublishCoreSetupBinaries.cs
index 4394a8b..e32d338 100644
--- a/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/PublishCoreSetupBinaries.cs
+++ b/tools-local/tasks/Microsoft.DotNet.SourceBuild.Tasks.XPlat/PublishCoreSetupBinaries.cs
@@ -36,12 +36,15 @@ namespace Microsoft.DotNet.Build.Tasks
// should include the delimiter immediately before the RID, arch, or extension.
protected string[] BadAtoms = new[] { "-x64", ".x64",
".tar", ".gz",
- "-rhel.7", "-rhel.8",
- ".rhel.7", ".rhel.8",
- "-centos.7", "-centos.8",
- ".centos.7", ".centos.8",
+ "-rhel.7", "-rhel.8", "-rhel.9",
+ ".rhel.7", ".rhel.8", ".rhel.9",
+ "-centos.7", "-centos.8", "-centos.9",
+ ".centos.7", ".centos.8", ".centos.9",
".fedora.30", "-fedora.30",
".fedora.31", "-fedora.31",
+ ".fedora.32", "-fedora.32",
+ ".fedora.33", "-fedora.33",
+ ".fedora.34", "-fedora.34",
"-linux", ".linux",
"-osx", ".osx",
"-OSX", ".OSX",

View File

@ -91,10 +91,8 @@ if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then
git checkout "${tag}" git checkout "${tag}"
git submodule update --init --recursive git submodule update --init --recursive
clean_dotnet_cache clean_dotnet_cache
sed -i -e 's|cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE||' repos/runtime.common.props
# FIXME remove contineuonprebuilterror # FIXME remove contineuonprebuilterror
patch -p1 -i ../../build-additional-rids.patch ./build.sh -p:SkipPrebuiltEnforcement=true -p:ContinueOnPrebuiltBaselineError=true -p:ArchiveDownloadedPackages=true -p:UseSystemLibraries=true
./build.sh -p:SkipPrebuiltEnforcement=true -p:ContinueOnPrebuiltBaselineError=true -p:ArchiveDownloadedPackages=true
./build-source-tarball.sh "${unmodified_tarball_name}" --skip-build -- -p:ContinueOnPrebuiltBaselineError=true -p:SkipPrebuiltEnforcement=true ./build-source-tarball.sh "${unmodified_tarball_name}" --skip-build -- -p:ContinueOnPrebuiltBaselineError=true -p:SkipPrebuiltEnforcement=true
popd popd
popd popd
@ -113,8 +111,23 @@ pushd "${tarball_name}"
# not-very-useful artifacts to reduce tarball size # not-very-useful artifacts to reduce tarball size
rm -r src/aspnetcore.*/src/SignalR/clients/java/signalr/gradle* rm -r src/aspnetcore.*/src/SignalR/clients/java/signalr/gradle*
find src/aspnetcore.*/src -type d -name samples -print0 | xargs -0 rm -r find src/aspnetcore.*/src -type d -name samples -print0 | xargs -0 rm -r
rm -r src/NuGet.Client.*/test/EndToEnd/ProjectTemplates/NetCoreWebApplication1.0.zip rm -r src/NuGet.Client.*/test/EndToEnd
find src/runtime.*/ -depth -name tests -print0 | xargs -0 rm -r find src/runtime.*/ -depth -name tests -print0 | xargs -0 rm -r
rm -r src/runtime.*/src/mono/
rm -r src/Humanizer.*/samples/
# FIXME delete when upstream has a new release with this file fixed
if ! grep "RSA Data Security" src/runtime.*/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/SHAHashProvider.Browser.cs; then
echo "SHAHashProvider.Browser.cs has been fixed upstream. Please fix build-dotnet-tarball"
exit 1
fi
# Delete the bad source
rm src/runtime.*/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/SHAHashProvider.Browser.cs
# Delete the patch that modifies the bad source
rm patches/runtime/0001-Use-substitute-SHA-1-implementation-in-wasm-44982.patch
# Add pre-patched copy
cp ../SHAHashProvider.Browser.cs src/runtime.*/src/libraries/System.Security.Cryptography.Algorithms/src/Internal/Cryptography/
popd popd
tar czf "${tarball_name}.tar.gz" "${tarball_name}" tar czf "${tarball_name}.tar.gz" "${tarball_name}"

View File

@ -14,23 +14,23 @@
%global __provides_exclude ^(%{privlibs})\\.so %global __provides_exclude ^(%{privlibs})\\.so
%global __requires_exclude ^(%{privlibs})\\.so %global __requires_exclude ^(%{privlibs})\\.so
# Filter flags not supported by clang # LTO triggers a compilation error for a source level issue. Given that LTO should not
# -fstack-clash-protection # change the validity of any given source and the nature of the error (undefined enum), I
# -specs= # suspect a generator program is mis-behaving in some way. This needs further debugging,
%global dotnet_cflags %(echo %optflags | sed -e 's/-fstack-clash-protection//' | sed -re 's/-specs=[^ ]*//g') # until that's done, disable LTO. This has to happen before setting the flags below.
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g') %define _lto_cflags %{nil}
%global host_version 5.0.0-preview.8.20407.11 %global host_version 5.0.0
%global runtime_version 5.0.0-preview.8.20407.11 %global runtime_version 5.0.0
%global aspnetcore_runtime_version 5.0.0-preview.8.20414.8 %global aspnetcore_runtime_version 5.0.0
%global sdk_version 5.0.100-preview.8.20417.9 %global sdk_version 5.0.100
%global templates_version 5.0.0-preview.8.20417.9 %global templates_version 5.0.0
#%%global templates_version %%(echo %%{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }') #%%global templates_version %%(echo %%{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }')
%global host_rpm_version 5.0.0 %global host_rpm_version %{host_version}
%global aspnetcore_runtime_rpm_version 5.0.0 %global aspnetcore_runtime_rpm_version %{aspnetcore_runtime_version}
%global runtime_rpm_version 5.0.0 %global runtime_rpm_version %{runtime_version}
%global sdk_rpm_version 5.0.100 %global sdk_rpm_version %{sdk_version}
# upstream can update releases without revving the SDK version so these don't always match # upstream can update releases without revving the SDK version so these don't always match
%global src_version %{sdk_version} %global src_version %{sdk_version}
@ -52,44 +52,36 @@
%global runtime_arch arm64 %global runtime_arch arm64
%endif %endif
%if 0%{?fedora} %{!?runtime_id:%global runtime_id %(. /etc/os-release ; echo "${ID}.${VERSION_ID%%.*}")-%{runtime_arch}}
%global runtime_id fedora.%{fedora}-%{runtime_arch}
%else
%if 0%{?centos}
%global runtime_id centos.%{centos}-%{runtime_arch}
%else
%global runtime_id rhel.%{rhel}-%{runtime_arch}
%endif
%endif
Name: dotnet5.0 Name: dotnet5.0
Version: %{sdk_rpm_version} Version: %{sdk_rpm_version}
Release: 0.3.preview8%{?dist} Release: 1%{?dist}
Summary: .NET Runtime and SDK Summary: .NET Runtime and SDK
License: MIT and ASL 2.0 and BSD and LGPLv2+ and CC-BY and CC0 and MS-PL and EPL-1.0 and GPL+ and GPLv2 and ISC and OFL and zlib License: MIT and ASL 2.0 and BSD and LGPLv2+ and CC-BY and CC0 and MS-PL and EPL-1.0 and GPL+ and GPLv2 and ISC and OFL and zlib
URL: https://github.com/dotnet/ URL: https://github.com/dotnet/
# The source is generated on a Fedora box via: # The source is generated on a Fedora box via:
# ./build-dotnet-tarball v%%{src_version}-SDK # ./build-dotnet-tarball v%%{src_version}-SDK
Source0: dotnet-v%{src_version}-SDK.tar.gz Source0: dotnet-v%{src_version}-SDK-337413b.tar.gz
Source1: check-debug-symbols.py Source1: check-debug-symbols.py
Source2: dotnet.sh.in Source2: dotnet.sh.in
# https://github.com/dotnet/runtime/pull/39203 Patch1: source-build-runtime-fixup-linker-order.patch
# Do not strip debuginfo from (native/unmanaged) binaries
Patch100: runtime-dont-strip.patch
# https://github.com/dotnet/runtime/pull/42094 # https://github.com/dotnet/runtime/pull/42094
# Fix linker order when linking with --as-needed # Fix linker order when linking with --as-needed
Patch101: runtime-linker-order.patch Patch100: runtime-linker-order.patch
# https://github.com/dotnet/runtime/pull/39191
# Fix building with our additional CFLAGS/CXXFLAGS/LDFLAGS
Patch102: runtime-flags-support.patch
# Disable telemetry by default; make it opt-in # Disable telemetry by default; make it opt-in
Patch500: sdk-telemetry-optout.patch Patch500: sdk-telemetry-optout.patch
# ExclusiveArch: aarch64 x86_64 %if 0%{?fedora} > 32 || 0%{?rhel} > 8
ExclusiveArch: aarch64 x86_64
%else
ExclusiveArch: x86_64 ExclusiveArch: x86_64
%endif
BuildRequires: clang BuildRequires: clang
BuildRequires: cmake BuildRequires: cmake
@ -318,7 +310,7 @@ These are not meant for general use.
%prep %prep
%setup -q -n dotnet-v%{src_version}-SDK %setup -q -n dotnet-v%{src_version}-SDK-337413b
%if %{without bootstrap} %if %{without bootstrap}
# Remove all prebuilts # Remove all prebuilts
@ -344,24 +336,16 @@ sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/runtime.*/src/installer/core
# Disable warnings # Disable warnings
sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props sed -i 's|skiptests|skiptests ignorewarnings|' repos/runtime.common.props
%patch1 -p1
pushd src/runtime.* pushd src/runtime.*
%patch100 -p1 %patch100 -p1
%patch101 -p1
%patch102 -p1
popd popd
pushd src/sdk.* pushd src/sdk.*
%patch500 -p1 %patch500 -p1
popd popd
# If CLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE is misisng, add it back
grep CLR_CMAKE_USE_SYSTEM_LIBUNWIND repos/runtime.common.props || \
sed -i 's|\$(BuildArguments) </BuildArguments>|$(BuildArguments) cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE</BuildArguments>|' repos/runtime.common.props
%if %{use_bundled_libunwind}
sed -i 's|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE|-DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=FALSE|' repos/runtime.common.props
%endif
%ifnarch x86_64 %ifnarch x86_64
mkdir -p artifacts/obj/%{runtime_arch}/Release mkdir -p artifacts/obj/%{runtime_arch}/Release
cp artifacts/obj/x64/Release/PackageVersions.props artifacts/obj/%{runtime_arch}/Release/PackageVersions.props cp artifacts/obj/x64/Release/PackageVersions.props artifacts/obj/%{runtime_arch}/Release/PackageVersions.props
@ -380,9 +364,37 @@ cat /etc/os-release
cp -a %{_libdir}/dotnet previously-built-dotnet cp -a %{_libdir}/dotnet previously-built-dotnet
%endif %endif
export EXTRA_CFLAGS="%{dotnet_cflags}" %if 0%{?fedora} > 32 || 0%{?rhel} > 8
export EXTRA_CXXFLAGS="%{dotnet_cflags}" # Setting this macro ensures that only clang supported options will be
export EXTRA_LDFLAGS="%{dotnet_ldflags}" # added to ldflags and cflags.
%global toolchain clang
%set_build_flags
%else
# Filter flags not supported by clang
%global dotnet_cflags %(echo %optflags | sed -re 's/-specs=[^ ]*//g')
%global dotnet_ldflags %(echo %{__global_ldflags} | sed -re 's/-specs=[^ ]*//g')
export CFLAGS="%{dotnet_cflags}"
export CXXFLAGS="%{dotnet_cflags}"
export LDFLAGS="%{dotnet_ldflags}"
%endif
%ifarch aarch64
# -mbranch-protection=standard breaks unwinding in CoreCLR through libunwind
CFLAGS=$(echo $CFLAGS | sed -e 's/-mbranch-protection=standard //')
CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/-mbranch-protection=standard //')
%endif
# -fstack-clash-protection breaks CoreCLR
CFLAGS=$(echo $CFLAGS | sed -e 's/-fstack-clash-protection//' )
CXXFLAGS=$(echo $CXXFLAGS | sed -e 's/-fstack-clash-protection//' )
export EXTRA_CFLAGS="$CFLAGS"
export EXTRA_CXXFLAGS="$CXXFLAGS"
export EXTRA_LDFLAGS="$LDFLAGS"
unset CFLAGS
unset CXXFLAGS
unset LDFLAGS
#%%if %%{without bootstrap} #%%if %%{without bootstrap}
# --with-ref-packages %%{_libdir}/dotnet/reference-packages/ \ # --with-ref-packages %%{_libdir}/dotnet/reference-packages/ \
@ -400,6 +412,11 @@ VERBOSE=1 ./build.sh \
/p:LogVerbosity=n \ /p:LogVerbosity=n \
/p:MinimalConsoleLogOutput=false \ /p:MinimalConsoleLogOutput=false \
/p:ContinueOnPrebuiltBaselineError=true \ /p:ContinueOnPrebuiltBaselineError=true \
%if %{use_bundled_libunwind}
/p:UseSystemLibunwind=false \
%else
/p:UseSystemLibunwind=true \
%endif
sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE2} > dotnet.sh sed -e 's|[@]LIBDIR[@]|%{_libdir}|g' %{SOURCE2} > dotnet.sh
@ -415,12 +432,14 @@ tar xf artifacts/%{runtime_arch}/Release/runtime/dotnet-runtime-symbols-%{runtim
-C %{buildroot}/%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}/ -C %{buildroot}/%{_libdir}/dotnet/shared/Microsoft.NETCore.App/%{runtime_version}/
# Fix executable permissions on files # Fix executable permissions on files
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.a' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.dll' -exec chmod -x {} \; find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.dll' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.h' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pdb' -exec chmod -x {} \; find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pdb' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.props' -exec chmod -x {} \; find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.props' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pubxml' -exec chmod -x {} \; find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.pubxml' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.targets' -exec chmod -x {} \; find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.targets' -exec chmod -x {} \;
find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.a' -exec chmod -x {} \; find %{buildroot}%{_libdir}/dotnet/ -type f -name '*.xml' -exec chmod -x {} \;
chmod 0755 %{buildroot}/%{_libdir}/dotnet/sdk/%{sdk_version}/AppHostTemplate/apphost chmod 0755 %{buildroot}/%{_libdir}/dotnet/sdk/%{sdk_version}/AppHostTemplate/apphost
chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/apphost chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/apphost
chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/libnethost.so chmod 0755 %{buildroot}/%{_libdir}/dotnet/packs/Microsoft.NETCore.App.Host.%{runtime_id}/%{runtime_version}/runtimes/%{runtime_id}/native/libnethost.so
@ -509,6 +528,15 @@ echo "Testing build results for debug symbols..."
%changelog %changelog
* Fri Dec 04 13:22:13 EST 2020 Omair Majid <omajid@redhat.com> - 5.0.100-1
- Update to .NET Core Runtime 5.0.0 and SDK 5.0.100
* Thu Dec 03 2020 Omair Majid <omajid@redhat.com> - 5.0.100-0.4.20201202git337413b
- Update to latest 5.0 pre-GA commit
* Tue Nov 24 2020 Omair Majid <omajid@redhat.com> - 5.0.100-0.4.20201123gitdee899c
- Update to 5.0 pre-GA commit
* Mon Sep 14 2020 Omair Majid <omajid@redhat.com> - 5.0.100-0.3.preview8 * Mon Sep 14 2020 Omair Majid <omajid@redhat.com> - 5.0.100-0.3.preview8
- Update to Preview 8 - Update to Preview 8

View File

@ -1,47 +0,0 @@
Do not strip native/unmanaged symbols from binaries
This is a hack. It rips out the calls to strip directly.
The correct/upstreamable fix is to add a configure/build option to
keep symbols for some builds, such as those needed by upstream.
diff --git a/eng/native/functions.cmake b/eng/native/functions.cmake
index 8b73581ed14..7697908425e 100644
--- a/eng/native/functions.cmake
+++ b/eng/native/functions.cmake
@@ -282,7 +282,7 @@ function(target_precompile_header)
endif(MSVC)
endfunction()
-function(strip_symbols targetName outputFilename)
+function(strip_symbols_renamed targetName outputFilename)
if (CLR_CMAKE_HOST_UNIX)
set(strip_source_file $<TARGET_FILE:${targetName}>)
@@ -336,8 +336,8 @@ function(strip_symbols targetName outputFilename)
endfunction()
function(install_with_stripped_symbols targetName kind destination)
- strip_symbols(${targetName} symbol_file)
- install_symbols(${symbol_file} ${destination})
+ # strip_symbols_renamed(${targetName} symbol_file)
+ # install_symbols(${symbol_file} ${destination})
if ("${kind}" STREQUAL "TARGETS")
set(install_source ${targetName})
elseif("${kind}" STREQUAL "PROGRAMS")
@@ -375,13 +375,13 @@ function(install_clr)
foreach(targetName ${INSTALL_CLR_TARGETS})
list(FIND CLR_CROSS_COMPONENTS_LIST ${targetName} INDEX)
if (NOT DEFINED CLR_CROSS_COMPONENTS_LIST OR NOT ${INDEX} EQUAL -1)
- strip_symbols(${targetName} symbol_file)
+ # strip_symbols_renamed(${targetName} symbol_file)
foreach(destination ${destinations})
# We don't need to install the export libraries for our DLLs
# since they won't be directly linked against.
install(PROGRAMS $<TARGET_FILE:${targetName}> DESTINATION ${destination})
- install_symbols(${symbol_file} ${destination})
+ # install_symbols(${symbol_file} ${destination})
if(CLR_CMAKE_PGO_INSTRUMENT)
if(WIN32)

View File

@ -1,30 +0,0 @@
diff --git a/eng/native/build-commons.sh b/eng/native/build-commons.sh
index b976f5fdc6c..853580b1c7a 100755
--- a/eng/native/build-commons.sh
+++ b/eng/native/build-commons.sh
@@ -163,6 +163,14 @@ EOF
return
fi
+ SAVED_CFLAGS="${CFLAGS}"
+ SAVED_CXXFLAGS="${CXXFLAGS}"
+ SAVED_LDFLAGS="${LDFLAGS}"
+
+ export CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
+ export CXXFLAGS="${CXXFLAGS} ${EXTRA_CXXFLAGS}"
+ export LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
+
if [[ "$__StaticAnalyzer" == 1 ]]; then
pushd "$intermediatesDir"
@@ -181,6 +189,10 @@ EOF
$cmake_command --build "$intermediatesDir" --target install -- -j "$__NumProc"
fi
+ CFLAGS="${SAVED_CFLAGS}"
+ CXXFLAGS="${SAVED_CXXFLAGS}"
+ LDFLAGS="${SAVED_LDFLAGS}"
+
local exit_code="$?"
if [[ "$exit_code" != 0 ]]; then
echo "${__ErrMsgPrefix}Failed to build \"$message\"."

View File

@ -0,0 +1,13 @@
--- a/patches/runtime/0014-Fix-singlefilehost-build-in-non-portable-mode-42415.patch
+++ b/patches/runtime/0014-Fix-singlefilehost-build-in-non-portable-mode-42415.patch
@@ -45,8 +45,8 @@
# These options are used to force every object to be included even if it's unused.
set(START_WHOLE_ARCHIVE -Wl,--whole-archive)
@@ -212,3 +217,10 @@ target_link_libraries(singlefilehost
- ${NATIVE_LIBS}
- ${END_WHOLE_ARCHIVE}
+ ${NATIVE_LIBS_EXTRA}
+
)
+
+if(NOT FEATURE_DISTRO_AGNOSTIC_SSL)

View File

@ -9,6 +9,7 @@
repositories: repositories:
- repo: "https://github.com/redhat-developer/dotnet-regular-tests.git" - repo: "https://github.com/redhat-developer/dotnet-regular-tests.git"
dest: "dotnet-regular-tests" dest: "dotnet-regular-tests"
version: main
tests: tests:
- download_test_runner: - download_test_runner:
dir: ./ dir: ./
@ -18,17 +19,15 @@
run: ./turkey --version run: ./turkey --version
- regular: - regular:
dir: ./ dir: ./
run: ./turkey -l={{ remote_artifacts }} -s=$(pwd)/nuget-prerelease dotnet-regular-tests run: ./turkey -l={{ remote_artifacts }} dotnet-regular-tests
required_packages: required_packages:
- babeltrace - babeltrace
- bash-completion - bash-completion
- binutils - binutils
- expect - expect
- git
- jq - jq
- lldb - lldb
- lttng-tools - lttng-tools
- make
- npm - npm
- python3 - python3
- strace - strace