From c0725fa2c562fdc4cee138ab6acdf28e71ae601b Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Thu, 20 May 2021 17:45:40 -0400 Subject: [PATCH] Update to .NET SDK 3.1.115 and Runtime 3.1.15 Resolves: RHBZ#1961848 --- .gitignore | 1 + boot-sdk-centos-rid.patch | 57 ----------- build-dotnet-tarball | 2 + corefx-43032-fedora-35-rid.patch | 124 ----------------------- dotnet3.1.rpmlintrc | 35 +++++++ dotnet3.1.spec | 31 ++---- rename-tarball | 10 +- source-build-ilasm-ildasm-path-fix.patch | 15 +++ sources | 2 +- update-release | 52 ++++++++-- 10 files changed, 112 insertions(+), 217 deletions(-) delete mode 100644 boot-sdk-centos-rid.patch delete mode 100644 corefx-43032-fedora-35-rid.patch create mode 100644 dotnet3.1.rpmlintrc create mode 100644 source-build-ilasm-ildasm-path-fix.patch diff --git a/.gitignore b/.gitignore index 96905a3..664c9ec 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ /dotnet-v3.1.111-SDK.tar.gz /dotnet-v3.1.112-SDK.tar.gz /dotnet-v3.1.113-SDK.tar.gz +/dotnet-v3.1.115-SDK.tar.gz diff --git a/boot-sdk-centos-rid.patch b/boot-sdk-centos-rid.patch deleted file mode 100644 index 436240c..0000000 --- a/boot-sdk-centos-rid.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff --git a/previously-built-dotnet/sdk/3.1.112/RuntimeIdentifierGraph.json b/previously-built-dotnet/sdk/3.1.112/RuntimeIdentifierGraph.json ---- a/previously-built-dotnet/sdk/3.1.112/RuntimeIdentifierGraph.json -+++ b/previously-built-dotnet/sdk/3.1.112/RuntimeIdentifierGraph.json -@@ -151,6 +151,12 @@ - "rhel" - ] - }, -+ "centos-arm64": { -+ "#import": [ -+ "centos", -+ "rhel-arm64" -+ ] -+ }, - "centos-x64": { - "#import": [ - "centos", -@@ -176,6 +182,13 @@ - "rhel.8" - ] - }, -+ "centos.8-arm64": { -+ "#import": [ -+ "centos.8", -+ "centos-arm64", -+ "rhel.8-arm64" -+ ] -+ }, - "centos.8-x64": { - "#import": [ - "centos.8", -@@ -183,6 +196,26 @@ - "rhel.8-x64" - ] - }, -+ "centos.9": { -+ "#import": [ -+ "centos", -+ "rhel.9" -+ ] -+ }, -+ "centos.9-arm64": { -+ "#import": [ -+ "centos.9", -+ "centos-arm64", -+ "rhel.9-arm64" -+ ] -+ }, -+ "centos.9-x64": { -+ "#import": [ -+ "centos.9", -+ "centos-x64", -+ "rhel.9-x64" -+ ] -+ }, - "debian": { - "#import": [ - "linux" diff --git a/build-dotnet-tarball b/build-dotnet-tarball index a3e7dfc..b7cd08a 100755 --- a/build-dotnet-tarball +++ b/build-dotnet-tarball @@ -97,6 +97,8 @@ if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then cp ../../coreclr-libunwind-fno-common.patch patches/coreclr/ mkdir -p patches/corefx/ cp ../../corefx-42900-clang-10.patch patches/corefx/ + mkdir -p patches/core-setup/ + cp ../../core-setup-gcc11.patch patches/core-setup/ mkdir -p patches/aspnetcore/ cp ../../disable-aspnetcore-targetingpackoverride.patch patches/aspnetcore/ ./build.sh /p:ArchiveDownloadedPackages=true /p:DownloadSourceBuildReferencePackagesTimeoutSeconds=100000 /p:DownloadSourceBuildReferencePackagesTimeoutSeconds=100000 diff --git a/corefx-43032-fedora-35-rid.patch b/corefx-43032-fedora-35-rid.patch deleted file mode 100644 index 656158b..0000000 --- a/corefx-43032-fedora-35-rid.patch +++ /dev/null @@ -1,124 +0,0 @@ -From 66d0116c74a33e43b171f3ef5323e8a3883ceb18 Mon Sep 17 00:00:00 2001 -From: Omair Majid -Date: Fri, 12 Feb 2021 11:01:36 -0500 -Subject: [PATCH] Add Fedora 35 RID - -Fedora rawhide now uses the fedora.35-x64 RID: - - $ podman run -it registry.fedoraproject.org/fedora:rawhide /bin/bash -c 'cat /etc/os-release' - NAME=Fedora - VERSION="35 (Container Image Prerelease)" - ID=fedora - VERSION_ID=35 - VERSION_CODENAME="" - PLATFORM_ID="platform:f35" - PRETTY_NAME="Fedora 35 (Container Image Prerelease)" - ANSI_COLOR="0;38;2;60;110;180" - LOGO=fedora-logo-icon - CPE_NAME="cpe:/o:fedoraproject:fedora:35" - HOME_URL="https://fedoraproject.org/" - DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/rawhide/system-administrators-guide/" - SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" - BUG_REPORT_URL="https://bugzilla.redhat.com/" - REDHAT_BUGZILLA_PRODUCT="Fedora" - REDHAT_BUGZILLA_PRODUCT_VERSION=rawhide - REDHAT_SUPPORT_PRODUCT="Fedora" - REDHAT_SUPPORT_PRODUCT_VERSION=rawhide - PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" - VARIANT="Container Image" - VARIANT_ID=container - -This is a backport of https://github.com/dotnet/runtime/pull/48200. ---- - eng/Packaging.props | 2 +- - .../runtime.compatibility.json | 32 +++++++++++++++++++ - pkg/Microsoft.NETCore.Platforms/runtime.json | 17 ++++++++++ - .../runtimeGroups.props | 2 +- - .../packageIndex.json | 5 +-- - src/packages.builds | 3 ++ - 6 files changed, 57 insertions(+), 4 deletions(-) - -diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json -index 382ee4552177..bb045b0856f1 100644 ---- a/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json -+++ b/pkg/Microsoft.NETCore.Platforms/runtime.compatibility.json -@@ -1102,6 +1102,38 @@ - "any", - "base" - ], -+ "fedora.35": [ -+ "fedora.35", -+ "fedora", -+ "linux", -+ "unix", -+ "any", -+ "base" -+ ], -+ "fedora.35-arm64": [ -+ "fedora.35-arm64", -+ "fedora.35", -+ "fedora-arm64", -+ "fedora", -+ "linux-arm64", -+ "linux", -+ "unix-arm64", -+ "unix", -+ "any", -+ "base" -+ ], -+ "fedora.35-x64": [ -+ "fedora.35-x64", -+ "fedora.35", -+ "fedora-x64", -+ "fedora", -+ "linux-x64", -+ "linux", -+ "unix-x64", -+ "unix", -+ "any", -+ "base" -+ ], - "freebsd": [ - "freebsd", - "unix", -diff --git a/pkg/Microsoft.NETCore.Platforms/runtime.json b/pkg/Microsoft.NETCore.Platforms/runtime.json -index a50be8567ce0..10b204def550 100644 ---- a/pkg/Microsoft.NETCore.Platforms/runtime.json -+++ b/pkg/Microsoft.NETCore.Platforms/runtime.json -@@ -544,6 +544,23 @@ - "fedora-x64" - ] - }, -+ "fedora.35": { -+ "#import": [ -+ "fedora" -+ ] -+ }, -+ "fedora.35-arm64": { -+ "#import": [ -+ "fedora.35", -+ "fedora-arm64" -+ ] -+ }, -+ "fedora.35-x64": { -+ "#import": [ -+ "fedora.35", -+ "fedora-x64" -+ ] -+ }, - "freebsd": { - "#import": [ - "unix" -diff --git a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props -index faa697f34e20..8b9c2e47ba2d 100644 ---- a/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props -+++ b/pkg/Microsoft.NETCore.Platforms/runtimeGroups.props -@@ -43,7 +43,7 @@ - - linux - x64;arm64 -- 23;24;25;26;27;28;29;30;31;32;33;34 -+ 23;24;25;26;27;28;29;30;31;32;33;34;35 - false - - diff --git a/dotnet3.1.rpmlintrc b/dotnet3.1.rpmlintrc new file mode 100644 index 0000000..1396c43 --- /dev/null +++ b/dotnet3.1.rpmlintrc @@ -0,0 +1,35 @@ +# Tarball is generated, no upstream URL +addFilter("W:.*invalid-url Source0: dotnet-.*tar.gz") + +# macOS is the correct name +addFilter("W: spelling-error %description -l en_US macOS ->.*") +# The name of the nuget package includes NETCore +addFilter("W: spelling-error .* NETCore -> Net Core.*") + +# Upstream really has no README or documentation files. They suggest using online resources. +addFilter("W: no-documentation") + +# This is a script that we run; it's expected to have execute permissions +addFilter("W: strange-permission check-debug-symbols.py") + +# libicu is a required dependency, but it's used via a dlopen() +addFilter("E: explicit-lib-dependency libicu") + +# There's no devel package for us to place .h files +addFilter("W: devel-file-in-non-devel-package /usr/lib64/dotnet/.*\.h") +addFilter("W: devel-file-in-non-devel-package /usr/lib64/dotnet/.*\.a") + +# These paths are non-standard, so we need $ORIGIN to find these libraries +addFilter("E: binary-or-shlib-defines-rpath /usr/lib64/dotnet/.*\['\$ORIGIN/netcoredeps'\]") +addFilter("E: binary-or-shlib-defines-rpath /usr/lib64/dotnet/.*\['\$ORIGIN'\]") + +# We put dll files in /usr/lib/dotnet, but rpmlint somehow doesn't see it as a binary? +addFilter("W: only-non-binary-in-usr-lib") + +# We use a number of zero-length files, including _._ +addFilter("E: zero-length /usr/lib64/dotnet/.*/_\._") + +# Upstream uses hidden files, even though we ask them not to, as much as possible +addFilter("W: hidden-file-or-dir /usr/lib64/dotnet/.*/\.version") +addFilter("W: hidden-file-or-dir /usr/lib64/dotnet/.*/\.toolsetversion") + diff --git a/dotnet3.1.spec b/dotnet3.1.spec index a7d1dca..b4b5af5 100644 --- a/dotnet3.1.spec +++ b/dotnet3.1.spec @@ -21,10 +21,10 @@ %define _lto_cflags %{nil} -%global host_version 3.1.13 -%global runtime_version 3.1.13 +%global host_version 3.1.15 +%global runtime_version 3.1.15 %global aspnetcore_runtime_version %{runtime_version} -%global sdk_version 3.1.113 +%global sdk_version 3.1.115 # upstream can update releases without revving the SDK version so these don't always match %global src_version %{sdk_version} %global templates_version %(echo %{runtime_version} | awk 'BEGIN { FS="."; OFS="." } {print $1, $2, $3+1 }') @@ -55,7 +55,7 @@ Name: dotnet3.1 Version: %{sdk_rpm_version} -Release: 3%{?dist} +Release: 1%{?dist} Summary: .NET Core 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 URL: https://github.com/dotnet/ @@ -65,9 +65,9 @@ URL: https://github.com/dotnet/ Source0: dotnet-v%{src_version}-SDK.tar.gz Source1: check-debug-symbols.py Source2: dotnet.sh.in -Source3: boot-sdk-centos-rid.patch Patch1: source-build-warnings-are-not-errors.patch +Patch2: source-build-ilasm-ildasm-path-fix.patch # Fix building with our additional CFLAGS/CXXFLAGS/LDFLAGS Patch100: corefx-optflags-support.patch @@ -78,8 +78,6 @@ Patch101: corefx-39686-cgroupv2-01.patch Patch102: corefx-39686-cgroupv2-02.patch Patch103: corefx-39633-cgroupv2-mountpoints.patch -# https://github.com/dotnet/corefx/pull/43032 -Patch104: corefx-43032-fedora-35-rid.patch # https://github.com/dotnet/corefx/pull/43068 Patch105: corefx-43068-centos-9-rid.patch @@ -94,7 +92,6 @@ Patch200: coreclr-hardening-flags.patch # Build with with hardening flags, including -pie Patch300: core-setup-hardening-flags.patch -Patch301: core-setup-gcc11.patch # Disable telemetry by default; make it opt-in Patch500: cli-telemetry-optout.patch @@ -360,13 +357,13 @@ sed -i 's|/usr/share/dotnet|%{_libdir}/dotnet|' src/core-setup.*/src/corehost/co sed -i 's|skiptests|skiptests ignorewarnings|' repos/coreclr.proj %patch1 -p1 +%patch2 -p1 pushd src/corefx.* %patch100 -p1 %patch101 -p1 %patch102 -p1 %patch103 -p1 -%patch104 -p1 %patch105 -p1 popd @@ -378,7 +375,6 @@ popd pushd src/core-setup.* %patch300 -p1 -%patch301 -p1 popd pushd src/cli.* @@ -410,17 +406,6 @@ cat /etc/os-release %if %{without bootstrap} # We need to create a copy because we will mutate this cp -a %{_libdir}/dotnet previously-built-dotnet - -# .NET Core 3.1 doesn't (yet) know about CentOS 9, so lets hack the -# CentOS 9 RID into there, for now. This hack can be removed when an -# SDK that knows about CentOS 9 is available in the buildroot. -%if 0%{?rhel} == 9 -cat /etc/os-release -find -iname RuntimeIdentifierGraph.json -patch -p1 -i %{SOURCE3} -cat $(find -iname RuntimeIdentifierGraph.json) -%endif - %endif %if 0%{?fedora} > 32 || 0%{?rhel} > 8 @@ -575,6 +560,10 @@ echo "Testing build results for debug symbols..." %changelog +* Tue May 18 2021 Omair Majid - 3.1.115-1 +- Update to .NET SDK 3.1.115 and Runtime 3.1.15 +- Resolves: RHBZ#1961848 + * Wed Apr 21 2021 Omair Majid - 3.1.113-3 - Fix build by adding CentOS 9 RIDs - Resolves: RHBZ#1951312 diff --git a/rename-tarball b/rename-tarball index b6b6086..ea7e65c 100755 --- a/rename-tarball +++ b/rename-tarball @@ -21,12 +21,14 @@ while [[ "$#" -gt 0 ]]; do esac done -original_name=${positional_args[0]:-} -if [[ -z ${original_name} ]]; then +if [[ -z "${positional_args[0]:-}" ]]; then echo "error: missing original tarball name" exit 1 fi +original_path=$(readlink -f "${positional_args[0]:-}") +original_name=$(basename "$original_path") + new_name=${positional_args[1]:-} if [[ -z ${new_name} ]]; then echo "error: missing new tarball name" @@ -41,8 +43,8 @@ echo "New name: ${new_name}.tar.gz" mkdir "temp-${new_name}" pushd "temp-${new_name}" -tar xf "../${original_name}.tar.gz" -mv "${original_name}" "${new_name}" +tar xf "${original_path}" +mv -- * "${new_name}" tar czf ../"${new_name}.tar.gz" "${new_name}" rm -rf "${new_name}" popd diff --git a/source-build-ilasm-ildasm-path-fix.patch b/source-build-ilasm-ildasm-path-fix.patch new file mode 100644 index 0000000..298b50f --- /dev/null +++ b/source-build-ilasm-ildasm-path-fix.patch @@ -0,0 +1,15 @@ +diff --git a/Directory.Build.props b/Directory.Build.props +index f6a6f54a..8247c3ee 100644 +--- a/Directory.Build.props ++++ b/Directory.Build.props +@@ -133,8 +133,8 @@ + $(BaseOutputPath)aspnet-debug + $(AspNetRazorBuildServerLogDir)razor-build-server.log + invalid: ILAsm is not expected to be needed in the online build +- $(PrebuiltSourceBuiltPackagesPath)coreclr-tools/$(BuildArchitecture)/ilasm +- $(ToolPackageExtractDir)coreclr-tools/$(BuildArchitecture)/ildasm ++ $(PrebuiltSourceBuiltPackagesPath)coreclr-tools/ilasm ++ $(ToolPackageExtractDir)coreclr-tools/ildasm + invalid: ILDasm is not expected to be needed in the offline build + + $(BaseOutputPath)git-info/ diff --git a/sources b/sources index 4972002..e3819a1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dotnet-v3.1.113-SDK.tar.gz) = ed8dd57e9179d833084edc536340befc99065ef8f53aaddd2b3d2223787fe0b904d42ed46f506b00bc8a40e44610aff7474cecdfdf24ad232fad34ac847027cd +SHA512 (dotnet-v3.1.115-SDK.tar.gz) = f991505c0f34be5847acdec1197c99579cdcaba5f1ef8e314e0cb52ce667a80436e99e69acf236c5d6217516a730d9b9360799867657d9dc1d1d12e2addc43f6 diff --git a/update-release b/update-release index 7332161..70b3c87 100755 --- a/update-release +++ b/update-release @@ -1,24 +1,37 @@ #!/bin/bash # Usage: -# ./update-release sdk-version runtime-version +# ./update-release sdk-version runtime-version [--bug bug-id] [--tarball tarball-name] set -euo pipefail IFS=$'\n\t' print_usage() { echo " Usage:" - echo " ./update-release sdk-version runtime-version" + echo " ./update-release sdk-version runtime-version [--bug bug-id] [--tarball tarball-name]" } +user_provided_tarball_name="" + positional_args=() +bug_ids=() while [[ "$#" -gt 0 ]]; do - arg="${1}" + arg="$1" case "${arg}" in + --bug) + bug_ids+=("$2") + shift; + shift; + ;; -h|--help) print_usage exit 0 ;; + --tarball) + user_provided_tarball_name="$2" + shift; + shift; + ;; *) positional_args+=("$1") shift @@ -26,7 +39,8 @@ while [[ "$#" -gt 0 ]]; do esac done -spec_file=dotnet3.1.spec +spec_files=( ./*.spec ) +spec_file="${spec_files[0]}" sdk_version=${positional_args[0]:-} if [[ -z ${sdk_version} ]]; then @@ -42,8 +56,22 @@ fi host_version="$runtime_version" -if [[ ! -f "dotnet-v${sdk_version}-SDK.tar.gz" ]]; then - ./build-dotnet-tarball "v${sdk_version}-SDK" +tag=v${sdk_version}-SDK + +if [[ -f "dotnet-${tag}-original.tar.gz" ]]; then + echo "dotnet-${tag}-original.tar.gz alredy exists, not rebuilding tarball" +else + if [[ -n "${user_provided_tarball_name}" ]]; then + ./rename-tarball "$user_provided_tarball_name" "dotnet-${tag}-original.tar.gz" + elif [[ -f "dotnet-${sdk_version}-SDK.tar.gz" ]]; then + ./rename-tarball "dotnet-${sdk_version}-SDK.tar.gz" "dotnet-${tag}-original.tar.gz" + elif [[ -f "dotnet-${runtime_version}.tar.gz" ]]; then + ./rename-tarball "dotnet-${runtime_version}.tar.gz" "dotnet-${tag}-original.tar.gz" + fi +fi + +if [[ ! -f "dotnet-${tag}.tar.gz" ]]; then + ./build-dotnet-tarball "${tag}" fi set -x @@ -52,12 +80,16 @@ sed -i -E "s|^%global host_version [[:digit:]]\.[[:digit:]]\.[[:digit:]]+|%globa sed -i -E "s|^%global runtime_version [[:digit:]]\.[[:digit:]]\.[[:digit:]]+|%global runtime_version ${runtime_version}|" "$spec_file" sed -i -E "s|^%global sdk_version [[:digit:]]\.[[:digit:]]\.[[:digit:]][[:digit:]][[:digit:]]|%global sdk_version ${sdk_version}|" "$spec_file" -comment="Update to .NET Core SDK ${sdk_version} and Runtime ${runtime_version}" +comment="Update to .NET SDK ${sdk_version} and Runtime ${runtime_version}" +for bug_id in "${bug_ids[@]}"; do + comment="$comment +- Resolves: RHBZ#$bug_id" +done -rpmdev-bumpspec -D --comment="$comment" $spec_file +rpmdev-bumpspec --comment="$comment" "$spec_file" # Reset release to 1 in 'Release' tag -sed -i -E 's|^Release: [[:digit:]]+%|Release: 1%|' $spec_file +sed -i -E 's|^Release: [[:digit:]]+%|Release: 1%|' "$spec_file" # Reset Release in changelog comment # See https://stackoverflow.com/questions/18620153/find-matching-text-and-replace-next-line -sed -i -E '/^%changelog$/!b;n;s/-[[:digit:]]+$/-1/' $spec_file +sed -i -E '/^%changelog$/!b;n;s/-[[:digit:]]+$/-1/' "$spec_file"