From 9382d427e2e907ecca5e554311d14017e5d433a9 Mon Sep 17 00:00:00 2001 From: Omair Majid Date: Apr 19 2021 14:15:39 +0000 Subject: Update to .NET SDK 3.1.114 and Runtime 3.1.14 Also add an rpmlintrc to reduce lint noise. Update rename-tarball to support mismatch in tarball and top-level directory name. Add ability to set bugs in update-release. --- diff --git a/.gitignore b/.gitignore index 96905a3..a22aa7c 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.114-SDK.tar.gz diff --git a/build-dotnet-tarball b/build-dotnet-tarball index a3e7dfc..3d95382 100755 --- a/build-dotnet-tarball +++ b/build-dotnet-tarball @@ -91,6 +91,7 @@ if [ ! -f "${unmodified_tarball_name}.tar.gz" ]; then git checkout "${tag}" git submodule update --init --recursive clean_dotnet_cache + patch -p1 -i ../../build-source-tarball-bad-dir.patch sed -i -e 's|cmakeargs -DCLR_CMAKE_USE_SYSTEM_LIBUNWIND=TRUE||' repos/coreclr.proj mkdir -p patches/coreclr/ cp ../../build-coreclr-clang10.patch patches/coreclr/ diff --git a/build-source-tarball-bad-dir.patch b/build-source-tarball-bad-dir.patch new file mode 100644 index 0000000..d12756b --- /dev/null +++ b/build-source-tarball-bad-dir.patch @@ -0,0 +1,13 @@ +diff --git a/build-source-tarball.sh b/build-source-tarball.sh +index b95885fe..e7c5404d 100755 +--- a/build-source-tarball.sh ++++ b/build-source-tarball.sh +@@ -117,7 +117,7 @@ while [[ -h $fullTarballRoot ]]; do + # symlink file was located + [[ $fullTarballRoot != /* ]] && fullTarballRoot="$SCRIPT_ROOT/$fullTarballRoot" + done +-export FULL_TARBALL_ROOT="$fullTarballRoot" ++export FULL_TARBALL_ROOT="$(readlink -f "$fullTarballRoot")" + + if [ -e "$TARBALL_ROOT" ]; then + echo "info: '$TARBALL_ROOT' already exists" 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 6fabc28..741abb9 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.14 +%global runtime_version 3.1.14 %global aspnetcore_runtime_version %{runtime_version} -%global sdk_version 3.1.113 +%global sdk_version 3.1.114 # 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: 2%{?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/ @@ -67,6 +67,7 @@ Source1: check-debug-symbols.py Source2: dotnet.sh.in 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 @@ -77,9 +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 - # Build with with hardening flags, including -pie Patch200: coreclr-hardening-flags.patch # Fix build with clang 10; Already applied at tarball-build time @@ -357,13 +355,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 popd pushd src/coreclr.* @@ -407,15 +405,6 @@ cat /etc/os-release # 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 RHEL 9, so lets hack the RHEL -# 9 RID into there, for now. This hack can be removed when the 3.1.112 -# SDK is available in the buildroot. -%if 0%{?rhel} == 9 -find -iname RuntimeIdentifierGraph.json -cat $(find -iname RuntimeIdentifierGraph.json) -sed -i -e 's|rhel.8|rhel.9|g' $(find -iname RuntimeIdentifierGraph.json) -%endif - %endif %if 0%{?fedora} > 32 || 0%{?rhel} > 8 @@ -570,6 +559,9 @@ echo "Testing build results for debug symbols..." %changelog +* Fri Apr 16 2021 Omair Majid - 3.1.114-1 +- Update to .NET SDK 3.1.114 and Runtime 3.1.14 + * Tue Mar 30 2021 Jonathan Wakely - 3.1.113-2 - Rebuilt for removed libstdc++ symbol (#1937698) 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..ffaaeda 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (dotnet-v3.1.113-SDK.tar.gz) = ed8dd57e9179d833084edc536340befc99065ef8f53aaddd2b3d2223787fe0b904d42ed46f506b00bc8a40e44610aff7474cecdfdf24ad232fad34ac847027cd +SHA512 (dotnet-v3.1.114-SDK.tar.gz) = 8f4affefa9b82fc17c2e172147a96ef7d8bb8ac999b5d2fd2bf5f316d023e042260485619bd7778baf06f03e722486a1cfefa59cb7ef844891e559401f18a4e5 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"